コード例 #1
0
ファイル: RepositoryTest.php プロジェクト: blazarecki/lug
 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
ファイル: DataSourceBuilder.php プロジェクト: blazarecki/lug
 /**
  * {@inheritdoc}
  */
 public function getProperty($field)
 {
     return $this->repository->getProperty($field, $this->queryBuilder);
 }