Пример #1
0
 /**
  * Callback to search annotated PHP classes
  *
  * @param \Includes\Decorator\DataStructure\Graph\Classes $node Current node
  *
  * @return void
  */
 public function checkClassForListChildTag(\Includes\Decorator\DataStructure\Graph\Classes $node)
 {
     if (!$node->isLowLevelNode() && ($lists = $node->getTag(static::TAG_LIST_CHILD))) {
         $data = array('child' => $node->getTopLevelNode()->getClass());
         foreach ($lists as $tags) {
             $this->annotatedPHPCLasses[] = $data + $tags;
         }
     }
 }
Пример #2
0
 /**
  * Returns repository class for model class of current node
  *
  * @param \Includes\Decorator\DataStructure\Graph\Classes $node Current node
  *
  * @return string
  */
 protected function getRepositoryClass(\Includes\Decorator\DataStructure\Graph\Classes $node)
 {
     $repositoryClass = null;
     if (!($node->isLowLevelNode() || $node->isTopLevelNode() || !$node->isDecorator())) {
         $children = $node->getChildren();
         $repositoryClass = isset($children[0]) ? $this->getRepositoryClass($children[0]) : $this->getDefaultRepositoryClass('');
     } else {
         $repositoryClass = \Includes\Utils\Converter::getPureClassName($node->getClass());
         $repositoryClass = \Includes\Utils\Converter::prepareClassName(str_replace('\\Model\\', '\\Model\\Repo\\', $repositoryClass), false);
         if (!\XLite\Core\Operator::isClassExists($repositoryClass)) {
             $repositoryClass = $this->getDefaultRepositoryClass($repositoryClass);
         }
     }
     return $repositoryClass;
 }
Пример #3
0
 /**
  * Callback to search annotated PHP classes
  *
  * @param \Includes\Decorator\DataStructure\Graph\Classes $node Current node
  *
  * @return void
  */
 public function checkClassForListChildTag(\Includes\Decorator\DataStructure\Graph\Classes $node)
 {
     if (!$node->isLowLevelNode() && preg_match('/^XLite(?:\\\\Module\\\\[A-Za-z0-9]+\\\\[A-Za-z0-9]+)?\\\\View\\\\/Ss', $node->getClass())) {
         $lists = $node->getTag(static::TAG_LIST_CHILD);
         if ($lists) {
             $data = array('child' => $node->getTopLevelNode()->getClass());
             foreach ($lists as $tags) {
                 $this->annotatedPHPCLasses[] = $data + $tags;
             }
         }
     }
 }