Esempio n. 1
0
File: fun.php Progetto: 318io/318-io
 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;
 }
Esempio n. 2
0
 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;
     }
 }