Пример #1
0
 /**
  * Standard constructor
  */
 public function __construct(Repository $repository, $namespace)
 {
     $this->repository = $repository;
     $this->class = new PhpClass($this->repository->class->class, $namespace, false);
     $this->class->addExtends($this->repository->class->getFullyQualifiedClassname(true));
     $this->class->setClassComment($this->repository->class->classComment);
 }
Пример #2
0
    /**
     * Entity generated Headers
     * @return array Headers
     */
    private function setClassComment()
    {
        $connectionSettings = $this->entity->pgClass->getCatalog()->db->resource->connectionSettings;
        $header = new Sformatf(<<<TEXT
            ConnectionInfo %s@%s:%s,
            Relation %s
TEXT
, $connectionSettings->dbname, $connectionSettings->user, $connectionSettings->host, $this->entity->pgClass->getFullyQualifiedName());
        $this->class->setClassComment($header->docblockify());
    }
Пример #3
0
    /**
     * Standard constructor
     */
    public function __construct(Entity $entity, $namespace)
    {
        $this->entity = $entity;
        $this->class = new PhpClass($this->entity->class->class, $namespace, false);
        $this->class->addExtends($this->entity->class->getFullyQualifiedClassname(true));
        $this->class->setClassComment($this->entity->class->classComment);
        $this->class->addUses('Symfony\\Component\\Validator\\Mapping\\ClassMetadata');
        $this->class->classComponents[] = new FunctionDeclaration('loadValidatorMetadata', (new Format(<<<'PHP'
                /**
                 * Symfony Validator Metadata.
                 * WARNING! Workaround. Symfony validator uses its own inheritance mechanism. This unusual setup is designed to short circuit that.
                 *
                 * @param ClassMetadata $metadata
                 * @return void
                 */
                public static function loadValidatorMetadata( ClassMetadata $metadata )
                {
                    parent::_loadValidatorMetaData( $metadata );
                }
PHP
))->deindent());
    }