<?php

namespace Hateoas\Tests\Fixtures;

use Hateoas\Configuration\Annotation as Hateoas;

/**
 * @Hateoas\Relation("self", href = @Hateoas\Route("user_get", parameters = {"id" = "expr(object.getId())"}))
 * @Hateoas\Relation(
 *     "post",
 *     href = "expr(link(object.getPost(), 'self', true))"
 * )
 */
class Will
{
    private $id;

    private $post;

    public function __construct($id, Post $post = null)
    {
        $this->id   = $id;
        $this->post = $post;
    }

    public function getId()
    {
        return $this->id;
    }

    public function getPost()
    {
        return $this->post;
    }
}
                                                                                                                                                                                                                                                                                                                                                                                                              Hateoas\Tests\Fixtures\User:
    relations:
        -
            rel: self
            href: http://hateoas.web/user/42
            attributes:
                type: application/json
        -
            rel: foo
            href:
                route: user_get
                parameters: { id: expr(object.getId()) }
            embedded: expr(object.getFoo())
        -
            rel: bar
            href: foo
            embedded:
                content: data
                xmlElementName: barTag
        -
            rel: baz
            href:
                route: user_get
                parameters: { id: expr(object.getId()) }
                absolute: true
        -
            rel: boom
            href:
                route: user_get
                parameters: { id: expr(object.getId()) }
                absolute: false
        -
            rel: badaboom
            embedded: expr(object.getFoo())
        -
            rel: hello
            href: /hello
            exclusion:
                groups: [group1, group2]
                since_version: 1
                until_version: 2.2
                max_depth: 42
                exclude_if: foo
            embedded:
                content: hello
                exclusion:
                    groups: [group3, group4]
                    since_version: 1.1
                    until_version: 2.3
                    max_depth: 43
                    exclude_if: bar
    relation_providers: [ getRelations ]
