Example #1
0
 public function get(Request $request)
 {
     if ($request->has('ofDomain')) {
         $realm = $this->orgRepo->organizationOfDomain(new DomainName($request->get('ofDomain')));
         return $this->jsonResponse($realm);
     }
 }
Example #2
0
 private function getKlimtoren()
 {
     $dn = new DomainName('klimtoren.be');
     $klimtoren = $this->orgRepo->organizationOfDomain($dn);
     if (!$klimtoren) {
         throw new OrganizationNotFoundException($dn->toString());
     }
     return $klimtoren;
 }
Example #3
0
 public function add($orgId, $data)
 {
     $organization = $this->orgRepo->organizationOfId($orgId);
     $name = new Name($data['name']);
     $url = new URL($data['url']);
     $description = isset($data['description']) ? $data['description'] : null;
     /** @var Blog $blog */
     $blog = Blog::register($name, $url, $organization);
     $blog->setDescription($description);
     $this->blogRepo->add($blog);
 }
Example #4
0
 public function add($orgId, $data)
 {
     $organization = $this->orgRepo->organizationOfId($orgId);
     if (!$organization) {
         throw new OrganizationNotFoundException($orgId);
     }
     $name = $this->nameIsRequired($data);
     $group = Group::register($name);
     $this->setDescription($data, $group);
     $this->setKind($data, $group);
     //TODO: set avatar
     $this->groupRepo->add($group);
     $this->setParent($data, $group);
     return $group;
 }
Example #5
0
 /**
  * @param $orgId
  * @return \Bakgat\Notos\Domain\Model\Identity\Organization
  * @throws OrganizationNotFoundException
  */
 private function organizationOfId($orgId)
 {
     $organization = $this->orgRepo->organizationOfId($orgId);
     if (!$organization) {
         throw new OrganizationNotFoundException($orgId);
     }
     return $organization;
 }
Example #6
0
 /**
  * Adds a new book
  *
  * @param $orgId
  * @param $data
  * @return Book
  * @throws OrganizationNotFoundException
  * @throws UnprocessableEntityException
  */
 public function add($orgId, $data)
 {
     $organization = $this->orgRepo->organizationOfId($orgId);
     if (!$organization) {
         throw new OrganizationNotFoundException($orgId);
     }
     $name = $this->nameIsRequired($data);
     $isbn = $this->isbnIsRequired($data);
     $book = Book::register($name, $isbn);
     $book->setOrganization($organization);
     $this->setDescription($data, $book);
     $this->addImage($data, $book);
     $this->setAgeRange($data, $book);
     $this->syncAuthors($data, $book);
     $this->syncPublishers($data, $book);
     $this->syncTags($data, $book);
     $this->bookRepo->add($book);
     return $book;
 }
Example #7
0
 /**
  * @param $orgId
  * @return \Bakgat\Notos\Domain\Model\Identity\Organization
  */
 public function edit($orgId)
 {
     $org = $this->orgRepo->organizationOfId($orgId);
     return $this->json($org, ['detail']);
 }
 private function getKlimtoren()
 {
     $dn_klimtoren = new DomainName('klimtoren.be');
     $klimtoren = $this->orgRepo->organizationOfDomain($dn_klimtoren);
     return $klimtoren;
 }
 public function getOrg($domainName)
 {
     $dn = new DomainName($domainName);
     $organization = $this->orgRepo->organizationOfDomain($dn);
     return $organization;
 }
Example #10
0
 public function eventsBetween($orgId, $start, $end)
 {
     $organization = $this->orgRepo->organizationOfId($orgId);
     return $this->calendarRepo->eventsBetween($organization, $start, $end);
 }
 private function get_klimtoren()
 {
     $dn = 'klimtoren.be';
     $organization = $this->orgRepo->organizationOfDomain($dn);
     return $organization;
 }