Ejemplo n.º 1
0
 public function testFactoryFail()
 {
     $this->setExpectedException('\\Aimeos\\MW\\Tree\\Exception');
     $this->object = \Aimeos\MW\Tree\Factory::createManager('notDefined', array(), null);
 }
Ejemplo n.º 2
0
 /**
  * Creates an object for managing the nested set.
  *
  * @param integer $siteid Site ID for the specific tree
  * @return \Aimeos\MW\Tree\Manager\Iface Tree manager
  */
 protected function createTreeManager($siteid)
 {
     if (!isset($this->treeManagers[$siteid])) {
         $context = $this->getContext();
         $config = $context->getConfig();
         $dbm = $context->getDatabaseManager();
         $treeConfig = array('search' => $this->searchConfig, 'dbname' => $this->getResourceName(), 'sql' => array('delete' => str_replace(':siteid', $siteid, $this->getSqlConfig('mshop/catalog/manager/standard/delete')), 'get' => str_replace(':siteid', $siteid, $this->getSqlConfig('mshop/catalog/manager/standard/get')), 'insert' => str_replace(':siteid', $siteid, $this->getSqlConfig('mshop/catalog/manager/standard/insert')), 'move-left' => str_replace(':siteid', $siteid, $this->getSqlConfig('mshop/catalog/manager/standard/move-left')), 'move-right' => str_replace(':siteid', $siteid, $this->getSqlConfig('mshop/catalog/manager/standard/move-right')), 'search' => str_replace(':siteid', $siteid, $this->getSqlConfig('mshop/catalog/manager/standard/search')), 'update' => str_replace(':siteid', $siteid, $this->getSqlConfig('mshop/catalog/manager/standard/update')), 'update-parentid' => str_replace(':siteid', $siteid, $this->getSqlConfig('mshop/catalog/manager/standard/update-parentid')), 'newid' => $this->getSqlConfig('mshop/catalog/manager/standard/newid')));
         $this->treeManagers[$siteid] = \Aimeos\MW\Tree\Factory::createManager('DBNestedSet', $treeConfig, $dbm);
     }
     return $this->treeManagers[$siteid];
 }
Ejemplo n.º 3
0
 public function testFactoryFail()
 {
     $this->setExpectedException('\\Aimeos\\MW\\Tree\\Exception');
     \Aimeos\MW\Tree\Factory::createManager('invalid', array(), null);
 }