Exemplo n.º 1
0
    public static function buildDefinition()
    {
        $definition = new Definition(
            new ClassName(EntityFake::getClassName()),
            new Definition\Identity("id")
        );

        $definition->setObserved([
            new Definition\Property("firstName"),
            new Definition\Property("lastName")
        ]);

        return $definition;
    }
Exemplo n.º 2
0
    /**
     * @return Definition
     */
    public function createDefinition()
    {
        $definition = new Definition(
            new ClassName(EntityFake::getClassName()),
            [
                new LazyProperty(
                    new Name("items"),
                    new InitializerStub($this->itemsInitializerValue),
                    [new Method('getItems')]
                )
            ]
        );

        return $definition;
    }
Exemplo n.º 3
0
    public static function buildDefinition($itemsInitializationResult = null)
    {
        $definition = new Definition(
            new ClassName(EntityFake::getClassName()),
            [
                new LazyProperty(
                    new Name("items"),
                    new InitializerStub($itemsInitializationResult),
                    [new Method('getItems')]
                )
            ]
        );

        return $definition;
    }