コード例 #1
0
 function getObjectElements(Table $object = null, $row = null)
 {
     if (!$row) {
         $row = $this->getElements();
     }
     $id = null;
     if ($object) {
         $id = $object->getId();
         if (!is_array($id)) {
             $id = array($id);
         }
     }
     $idStr = '';
     if ($id) {
         foreach ($id as $i) {
             $idStr .= '[' . $i . ']';
         }
     }
     $formRow = array();
     foreach ($row as $colname => $r) {
         $name = $r->attributes['name'];
         $r = clone $r;
         if ($object) {
             $r->setValue($object->getSQLField($name));
         }
         $r->attributes['name'] = $name . $idStr;
         $formRow[] = new Element\Label($colname, $r);
         $formRow[] = $r;
     }
     return $formRow;
 }
コード例 #2
0
 /**
  * @param string $sql
  * @return Table\CacheableTableSet|Table\TableSet|static[]
  */
 static function getAll($sql = '')
 {
     if (\Radical\Core\Server::isCLI()) {
         return parent::getAll($sql);
     }
     $obj = static::_getAll($sql);
     $cached = Table\TableCache::Get($obj);
     if ($cached) {
         return $cached;
     } else {
         return new Table\CacheableTableSet($obj, get_called_class());
     }
 }
コード例 #3
0
ファイル: DeleteBuffer.php プロジェクト: splitice/radical-db
 function add(Table $table)
 {
     $this->data[] = $table->getId();
 }