Example #1
0
 /**
  * @return Response
  */
 public function send()
 {
     if ($this->autologin) {
         $this->client->checkLogin();
     }
     $this->options['query'] = $this->query->toArray();
     return new Response($this->internalClient->request($this->method, $this->getAbsoluteUri(), $this->options));
 }
Example #2
0
 /**
  * Load all items defined by fluent.
  *
  * 
  * @return DbRecordCollection
  */
 public function load()
 {
     if ($this->isLoaded()) {
         return $this;
     }
     if (!$this->isLoadable()) {
         throw new Exception('This collection is not loadable! Maybe items were set manualy before load!');
     }
     if (!$this->query) {
         // pokud neni fluent set, nastav defaultni
         $this->query();
         #throw new Exception('Fluent is not set');
     }
     foreach ($this->query->toArray() as $values) {
         $this->repository->createObjectFromValues($values);
         // map by IdentityMap
         if ($this->options['mapped']) {
             $item = $class::identity()->map($item);
         }
         $this->append($item);
     }
     $this->setLoaded(true);
     return $this;
 }