Nextras\Orm\Entity\IEntity::hasValue PHP Метод

hasValue() публичный Метод

Returns true if property has a value (not null).
public hasValue ( string $name ) : boolean
$name string
Результат boolean
    public function hasValue($name);

Usage Example

Пример #1
0
 protected function createComponentOneHasOne(Nextras\Orm\Entity\Reflection\PropertyMetadata $metadata, bool $force = FALSE)
 {
     if (!$force && !$metadata->relationship->isMain) {
         return NULL;
     }
     if ($this->entity->hasValue($metadata->name)) {
         $entity = $this->entity->getValue($metadata->name);
     } else {
         $repository = $this->model->getRepository($metadata->relationship->repository);
         $relationshipEntityClass = $repository->getEntityMetadata()->getClassName();
         $entity = new $relationshipEntityClass();
     }
     return $this->addComponent($this->form->createComponent($entity), $metadata->name);
 }
All Usage Examples Of Nextras\Orm\Entity\IEntity::hasValue