Ejemplo n.º 1
0
 public function testIfSqlIsnotNull()
 {
     /**
      * @var ModuleRepository
      */
     $objectRepository = new ModuleRepository();
     $objectRepository->setEntityManager($this->em);
     $objectRepository->setColumnMapper($this->columnMapper);
     $object = new EavColumns($this->em, $this->columnMapper, $this->module);
     $this->assertNotNull($object->getSql());
 }
Ejemplo n.º 2
0
 public function setUp()
 {
     parent::setUp();
     $this->createModuleData();
     $this->module = $this->em->getRepository('BigfishEavBundle:Module')->find(1);
     $this->columnMapper = $this->container->get('eav.column.mapper');
     /**
      * @var ModuleRepository
      */
     $objectRepository = new ModuleRepository();
     $objectRepository->setEntityManager($this->em);
     $objectRepository->setColumnMapper($this->columnMapper);
     $objectRepository->getRepository($this->module);
     $this->queryBuilder = new QueryBuilder($objectRepository);
 }
Ejemplo n.º 3
0
 /**
  * @param $method
  * @param $arguments
  */
 public function __call($method, $arguments)
 {
     if (strpos($method, 'findBy') === false && strpos($method, 'findOne') === false) {
         throw new \InvalidArgumentException(sprintf('Method %s must follow code standards. Use findBy or findOne. For example: findOneAuthor', $method));
     }
     if ($this->_class) {
         $this->_class->getRepository($this->_module);
         $this->_class->setInvokeColumns($this->getInvokeColumns());
         $this->_class->setColumnMapper($this->getColumnMapper());
         $this->_class->setEntityManager($this->getEntityManager());
         $this->_class->setLanguageManager($this->getLanguageManager());
         $this->_class->setContextManager($this->getContextManager());
         $this->_class->setPivotResultChain($this->getPivotResultChain());
         if (method_exists($this->_class, $method)) {
             return call_user_func_array(array($this->_class, $method), $arguments);
         }
     }
     throw new \InvalidArgumentException(sprintf('Method %s does not exists', $method));
 }