Nextras\Orm\Repository\IRepository::getEntityMetadata PHP Méthode

getEntityMetadata() public méthode

Returns entity metadata.
public getEntityMetadata ( ) : EntityMetadata
Résultat Nextras\Orm\Entity\Reflection\EntityMetadata
    public function getEntityMetadata();

Usage Example

Exemple #1
0
 protected function createComponentGrid() : Ytnuk\Grid\Control
 {
     $grid = new Ytnuk\Grid\Control(function (Nextras\Orm\Entity\IEntity $entity = NULL) {
         if (!$entity) {
             $entityClass = $this->repository->getEntityMetadata()->getClassName();
             $entity = new $entityClass();
         }
         $form = $this->form->create($entity);
         $form->onSubmit[] = function () {
             $this->redirect('this');
         };
         return $form;
     }, function (array $order, array $filter) {
         return $this->repository->findBy($this->prepareValues($filter))->orderBy($this->prepareValues($order))->fetchPairs(current($this->repository->getEntityMetadata()->getPrimaryKey()));
     });
     return $grid->setLink(function ($entity) {
         return $entity ? $this->getPresenter()->link('Presenter:edit', [current($this->repository->getEntityMetadata()->getPrimaryKey()) => $entity->id]) : $this->getPresenter()->link('Presenter:add');
     })->filterInputs(['this']);
 }
All Usage Examples Of Nextras\Orm\Repository\IRepository::getEntityMetadata