Ejemplo n.º 1
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;
 }