public function project(array $columns) { $new_table = new RelationTable($columns); if (array_diff($columns, $this->columns) == array()) { $list = new FList($this->table); $new_records = $list->foldl(function ($acc, $record) use($columns) { $acc[] = $this->record_project($columns, $record); return $acc; }, array()); $new_table->insert_array($new_records); } return $new_table; }
private function checkRelation(RelationTable $reltable, array $instances) { $pattern = $this->prepare_for_selection($instances); $get = $reltable->select($pattern); if ($get->isEmpty()) { return FALSE; } else { return TRUE; } }