Nette\ComponentModel\Component::lookupPath PHP Метод

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

A path is the concatenation of component names separated by self::NAME_SEPARATOR.
public lookupPath ( $type = NULL, $need = TRUE ) : string
Результат string
    public function lookupPath($type = NULL, $need = TRUE)
    {
        $this->lookup($type, $need);
        return $this->monitors[$type][2];
    }

Usage Example

Пример #1
0
 /**
  * {@inheritdoc}
  */
 public function load(ClassMetadata $meta, Component $component, $entity)
 {
     if (!$component instanceof BaseControl) {
         return FALSE;
     }
     if ($meta->hasField($name = $component->getOption(self::FIELD_NAME, $component->getName()))) {
         $component->setValue($this->accessor->getValue($entity, $name));
         return TRUE;
     }
     if (!$meta->hasAssociation($name)) {
         return FALSE;
     }
     /** @var SelectBox|RadioList $component */
     if (($component instanceof SelectBox || $component instanceof RadioList) && !count($component->getItems()) && !$component->getOption(self::FIELD_NOT_LOAD, false)) {
         if (!($nameKey = $component->getOption(self::ITEMS_TITLE, FALSE))) {
             $path = $component->lookupPath('Nette\\Application\\UI\\Form');
             throw new Kdyby\DoctrineForms\InvalidStateException('Either specify items for ' . $path . ' yourself, or set the option Kdyby\\DoctrineForms\\IComponentMapper::ITEMS_TITLE ' . 'to choose field that will be used as title');
         }
         $criteria = $component->getOption(self::ITEMS_FILTER, array());
         $orderBy = $component->getOption(self::ITEMS_ORDER, array());
         $related = $this->relatedMetadata($entity, $name);
         $items = $this->findPairs($related, $criteria, $orderBy, $nameKey);
         $component->setItems($items);
     }
     if ($relation = $this->accessor->getValue($entity, $name)) {
         $UoW = $this->em->getUnitOfWork();
         $component->setValue($UoW->getSingleIdentifierValue($relation));
     }
     return TRUE;
 }
All Usage Examples Of Nette\ComponentModel\Component::lookupPath