/**
  * Return LudoDBCollection handled by the parser.
  * @return LudoDBModel|null
  */
 public function getModel()
 {
     if (isset($this->config['model'])) {
         // TODO singleton.
         $this->model = $this->getModelInstance();
         $this->model->clearValues();
         return $this->model;
     }
     return null;
 }
Example #2
0
 public function read()
 {
     $pr = new Project();
     if ($pr->exists()) {
         $pr->drop()->yesImSure();
     }
     $pr->createTable();
     #if(!$pr->exists()){
     $pr->drop()->yesImSure();
     $pr->createTable();
     #}
     return parent::read();
 }
 /**
  * Return values in a tree structure
  * @return array
  */
 public function getValues()
 {
     $rows = parent::getValues();
     $rowReferences = array();
     $ret = array();
     $pk = $this->parser->getPK();
     $fk = $this->parser->getFK();
     $childKey = $this->parser->getChildKey();
     foreach ($rows as &$row) {
         $rowReferences[$row[$pk]] =& $row;
         if (isset($row[$fk])) {
             $parent =& $rowReferences[$row[$fk]];
             if (!isset($parent[$childKey])) {
                 $parent[$childKey] = array();
             }
             $parent[$childKey][] =& $row;
         } else {
             $ret[] =& $row;
         }
         unset($row[$fk]);
     }
     return $ret;
 }
Example #4
0
 public function __construct($fen)
 {
     $fen = $this->getValidFen($fen);
     parent::__construct($fen);
 }
Example #5
0
 public function __construct($playerId, $finished, $category = 1)
 {
     parent::__construct($playerId, $playerId, $finished, $category);
 }
Example #6
0
 public function getValues()
 {
     return parent::getValues();
 }
Example #7
0
 public function __construct($fromZip, $toZip)
 {
     parent::__construct($fromZip, $toZip);
 }