当前位置: 首页>>代码示例>>PHP>>正文


PHP EntityRepository::findAll方法代码示例

本文整理汇总了PHP中Doctrine\ORM\EntityRepository::findAll方法的典型用法代码示例。如果您正苦于以下问题:PHP EntityRepository::findAll方法的具体用法?PHP EntityRepository::findAll怎么用?PHP EntityRepository::findAll使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Doctrine\ORM\EntityRepository的用法示例。


在下文中一共展示了EntityRepository::findAll方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: load

 /**
  * {@inheritdoc}
  */
 public function load(ObjectManager $manager)
 {
     $this->users = $this->user->findAll();
     $this->organization = $this->getReference('default_organization');
     $this->loadCalendars();
     $this->connectCalendars();
 }
开发者ID:antrampa,项目名称:crm,代码行数:10,代码来源:LoadUsersCalendarData.php

示例2: indexAction

 /**
  * Get the attribute collection
  *
  * @return JsonResponse
  */
 public function indexAction()
 {
     $attributes = $this->attributeRepository->findAll();
     $filteredAttributes = $this->collectionFilter->filterCollection($attributes, 'pim.internal_api.attribute.view');
     $normalizedAttributes = $this->normalizer->normalize($filteredAttributes, 'internal_api');
     return new JsonResponse($normalizedAttributes);
 }
开发者ID:noglitchyo,项目名称:pim-community-dev,代码行数:12,代码来源:AttributeController.php

示例3: getFormValue

 /**
  * {@inheritdoc}
  */
 public function getFormValue(array $converterAttributes, $value)
 {
     if ($value === null) {
         return $this->businessUnitRepository->findAll();
     }
     return parent::getFormValue($converterAttributes, $value);
 }
开发者ID:snorchel,项目名称:platform,代码行数:10,代码来源:WidgetBusinessUnitSelectConverter.php

示例4: givenDatabaseIsClear

 protected function givenDatabaseIsClear()
 {
     if (0 !== count($this->items->findAll())) {
         $purger = new ORMPurger($this->entityManager);
         $purger->purge();
     }
 }
开发者ID:lzakrzewski,项目名称:tests-with-database-examples,代码行数:7,代码来源:TestCase.php

示例5: getEmoteGenerator

 /**
  * @return \Generator
  */
 private function getEmoteGenerator()
 {
     /** @var Emote[] $emotes */
     $emotes = $this->entityRepository->findAll();
     foreach ($emotes as $emote) {
         (yield $emote);
     }
 }
开发者ID:jlwitthuhn,项目名称:emotepack,代码行数:11,代码来源:ReleaseCompiler.php

示例6: indexAction

 /**
  * Get the family collection
  *
  * @return JsonResponse
  */
 public function indexAction()
 {
     $families = $this->familyRepository->findAll();
     $normalizedFamilies = [];
     foreach ($families as $family) {
         $normalizedFamilies[$family->getCode()] = $this->normalizer->normalize($family, 'json');
     }
     return new JsonResponse($normalizedFamilies);
 }
开发者ID:alexisfroger,项目名称:pim-community-dev,代码行数:14,代码来源:FamilyController.php

示例7: readSettings

 /**
  * Reads all settings from database.
  *
  * @return void
  */
 private function readSettings()
 {
     /**
      * @var \Ableron\Modules\Core\Model\Entities\SettingEntity $settingEntity
      */
     foreach ($this->settingEntityRepository->findAll() as $settingEntity) {
         $this->settings->set($settingEntity->getName(), $settingEntity);
     }
 }
开发者ID:ableron,项目名称:ableron-core,代码行数:14,代码来源:ApplicationConfiguration.php

示例8: indexAction

 /**
  * Get attribute group collection
  *
  * @return JsonResponse
  */
 public function indexAction()
 {
     $attributeGroups = $this->attributeGroupRepo->findAll();
     $filteredAttrGroups = $this->collectionFilter->filterCollection($attributeGroups, 'pim.internal_api.attribute_group.view');
     $normalizedAttrGroups = [];
     foreach ($filteredAttrGroups as $attributeGroup) {
         $normalizedAttrGroups[$attributeGroup->getCode()] = $this->normalizer->normalize($attributeGroup, 'json');
     }
     return new JsonResponse($normalizedAttrGroups);
 }
开发者ID:a2xchip,项目名称:pim-community-dev,代码行数:15,代码来源:AttributeGroupController.php

示例9: getConfigOrEmpty

 /**
  * @return NotificationPluginConfiguration|null
  */
 public function getConfigOrEmpty()
 {
     $result = $this->notificationPluginConfigurationRepository->findAll();
     $config = null;
     if (count($result) > 0) {
         $config = $result[0];
     } else {
         $config = new NotificationPluginConfiguration();
     }
     return $config;
 }
开发者ID:claroline,项目名称:distribution,代码行数:14,代码来源:NotificationPluginConfigurationManager.php

示例10: readEventHandlers

 /**
  * Reads event handlers from database.
  *
  * Event handlers can be stored in database, so they do not have to be
  * registered at the event manager manually during script execution.
  *
  * @return void
  */
 private function readEventHandlers()
 {
     /** @var \Ableron\Modules\Core\Model\Entities\EventHandlerEntity $eventHandlerEntity */
     foreach ($this->eventHandlerEntityRepository->findAll() as $eventHandlerEntity) {
         $this->registerEventHandler($eventHandlerEntity->getEventName(), ClassUtil::getInstance($eventHandlerEntity->getEventHandlerClass()));
     }
 }
开发者ID:ableron,项目名称:ableron-core,代码行数:15,代码来源:EventManager.php

示例11:

 function it_handles_a_find_all_query(FindAll $query, EntityRepository $repository, EntityManagerInterface $em)
 {
     $query->getEntityClass()->willReturn('Indigo\\Crud\\Stub\\Entity');
     $repository->findAll()->shouldBeCalled();
     $em->getRepository('Indigo\\Crud\\Stub\\Entity')->willReturn($repository);
     $this->handle($query);
 }
开发者ID:indigophp,项目名称:crud-doctrine,代码行数:7,代码来源:AllFinderSpec.php

示例12: initialize

 public function initialize(RequestConfiguration $requestConfiguration, MetadataInterface $metadataInterface, $resource, EntityRepository $repository)
 {
     if (!$requestConfiguration->isSortable()) {
         return;
     }
     $accessor = PropertyAccess::createPropertyAccessor();
     $property = $requestConfiguration->getSortablePosition();
     $strategy = $requestConfiguration->getSortingStrategy();
     if ($strategy == self::STRATEGY_DESC_LAST || $strategy == self::STRATEGY_ASC_FIRST) {
         // target value is 0, and we need to move all other elements one up
         $existingResources = $repository->findAll();
         if ($existingResources) {
             foreach ($existingResources as $existingResource) {
                 if ($resource === $existingResource) {
                     continue;
                 }
                 $value = $accessor->getValue($existingResource, $property);
                 $accessor->setValue($existingResource, $property, $value + 1);
             }
         }
         $newValue = 0;
     } else {
         // Initial value is maximum of other elements + 1
         $maxResource = $repository->createQueryBuilder('r')->orderBy('r.' . $property, 'desc')->setMaxResults(1)->getQuery()->getOneOrNullResult();
         if (!$maxResource) {
             $newValue = 0;
         } else {
             $maxValue = $accessor->getValue($maxResource, $property);
             $newValue = $maxValue + 1;
         }
     }
     $accessor->setValue($resource, $property, $newValue);
     $this->em->flush();
 }
开发者ID:enhavo,项目名称:enhavo,代码行数:34,代码来源:SortingManager.php

示例13: findAll

 public function findAll($published = false)
 {
     if (!$published) {
         return parent::findAll();
     } else {
         return $this->getPublishedProjectsQuery();
     }
 }
开发者ID:BelkaB,项目名称:tangara-server,代码行数:8,代码来源:ProjectRepository.php

示例14: getItems

 public function getItems()
 {
     $accessor = PropertyAccess::createPropertyAccessor();
     $objects = $this->repository->findAll();
     $items = [];
     foreach ($objects as $object) {
         $item = new Item();
         $item->setValue($object);
         $properties = array();
         foreach ($this->itemProperties as $itemProperty => $itemPropertyLabel) {
             $properties[$itemProperty] = $accessor->getValue($object, $itemProperty);
         }
         $item->setProperties($properties);
         $items[] = $item;
     }
     return $items;
 }
开发者ID:mia3,项目名称:expose,代码行数:17,代码来源:DoctrineEntityIndex.php

示例15: ArticleCategory

 function it_returns_article_category_list(EntityRepository $repository)
 {
     $firstArticleCategory = new ArticleCategory();
     $firstArticleCategory->setSlug('chrono-trigger');
     $secondArticleCategory = new ArticleCategory();
     $secondArticleCategory->setSlug('chrono-cross');
     $repository->findAll()->willReturn([$firstArticleCategory, $secondArticleCategory]);
     $this->getAll()->shouldReturn([$firstArticleCategory, $secondArticleCategory]);
 }
开发者ID:lukasz-jakub-adamczuk,项目名称:sapi,代码行数:9,代码来源:ArticleCategoryProviderSpec.php


注:本文中的Doctrine\ORM\EntityRepository::findAll方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。