public function fetchRelation(array $fields = array())
 {
     $requestAction = Requests::getRelationships($this->module->getModuleName(), $this->module->id, $this->relation->getDbName(), $this->relation->getModuleName(), $fields);
     $results = Request::call($requestAction);
     if ($this->relation->isCollection()) {
         return Converter::toModules($results, $this->relationModule);
     }
     return Converter::toModule($results->entry_list[0], $this->relationModule);
 }
예제 #2
0
 public function delete()
 {
     $attributes = Arrays::map($this->whereClauses, Functions::extract()->getParams());
     $queryInsert = new QueryInsert(Arrays::firstOrNull($attributes));
     $id = $queryInsert->into($this->module->getModuleName());
     return !is_null($id);
 }