/**
  * @param \Bjr\BjrLend\Domain\Model\Organization $organization
  * @return array|\TYPO3\CMS\Extbase\Persistence\QueryResultInterface
  * find all articles for pid which belongs to organization
  */
 public function findByOrganization(\Bjr\BjrLend\Domain\Model\Organization $organization, $sortBy = 'issueStart', $sortOrder = 'desc')
 {
     $pid = $organization->getArticleFolderPid();
     $querySettings = $this->createQuery()->getQuerySettings();
     $querySettings->setStoragePageIds(array($pid));
     $this->setDefaultQuerySettings($querySettings);
     if (strtoupper($sortOrder) == 'ASC') {
         $sortOrder = \TYPO3\CMS\Extbase\Persistence\QueryInterface::ORDER_ASCENDING;
     } elseif (strtoupper($sortOrder) == 'DESC') {
         $sortOrder = \TYPO3\CMS\Extbase\Persistence\QueryInterface::ORDER_DESCENDING;
     }
     $query = $this->createQuery();
     return $query->matching($query->equals('pid', $pid))->setOrderings(array($sortBy => $sortOrder))->execute();
 }
 /**
  * @param \Bjr\BjrLend\Domain\Model\Organization $organization
  * @return array|\TYPO3\CMS\Extbase\Persistence\QueryResultInterface
  * find all articles for pid which belongs to organization
  */
 public function findByOrganization(\Bjr\BjrLend\Domain\Model\Organization $organization)
 {
     $pid = $organization->getArticleFolderPid();
     $querySettings = $this->createQuery()->getQuerySettings();
     $querySettings->setStoragePageIds(array($pid));
     $this->setDefaultQuerySettings($querySettings);
     return $this->findByPid($pid);
 }
 /**
  * @test
  */
 public function setOpeningTimesForStringSetsOpeningTimes()
 {
     $this->fixture->setOpeningTimes('Conceived at T3CON10');
     $this->assertSame('Conceived at T3CON10', $this->fixture->getOpeningTimes());
 }
Пример #4
0
 /**
  * @param Organization $organization
  * set article with data from organization
  */
 public function copyDataFromOrganization(\Bjr\BjrLend\Domain\Model\Organization $organization)
 {
     $this->setPhone($organization->getAddress()->getPhone());
     $this->setByEmail($organization->getAddress()->getEmail());
     $this->setEmail($organization->getAddress()->getEmail());
     $this->setOrganization($organization);
     $this->setShowCalendar(true);
     $this->setPid($organization->getArticleFolderPid());
     //$this->setPhone($organization->getAddress()->getPhone());
 }