예제 #1
0
 public function testFindForDelete()
 {
     $queryBuilder = $this->setUpQueryBuilder($value = 'bar');
     $queryBuilder->expects($this->once())->method('getQuery')->will($this->returnValue($query = $this->createQueryMock()));
     $query->expects($this->once())->method('getOneOrNullResult')->will($this->returnValue($result = 'result'));
     $this->assertSame($result, $this->repository->findForDelete(['foo' => $value], ['baz' => 'ASC']));
 }
예제 #2
0
 /**
  * {@inheritdoc}
  */
 public function getProperty($property, $root = null)
 {
     if ($this->cache === null) {
         $translatableFields = $this->getClassMetadata()->getFieldNames();
         $translationFields = $this->getEntityManager()->getClassMetadata($this->getClassMetadata()->getAssociationMapping('translations')['targetEntity'])->getFieldNames();
         $this->cache = array_diff($translationFields, $translatableFields);
     }
     if (in_array($property, $this->cache, true)) {
         $root = $this->getTranslationAlias($root);
     }
     return parent::getProperty($property, $root);
 }
예제 #3
0
 public function testProperty()
 {
     $this->repository->expects($this->once())->method('getProperty')->with($this->identicalTo($field = 'field'), $this->identicalTo($this->queryBuilder))->will($this->returnValue($property = 'property'));
     $this->assertSame($property, $this->builder->getProperty($field));
 }
예제 #4
0
 /**
  * {@inheritdoc}
  */
 public function getProperty($field)
 {
     return $this->repository->getProperty($field, $this->queryBuilder);
 }