コード例 #1
0
 /**
  * make MySQL INSERT
  *
  * @see    Insert
  * @throws RuntimeException
  * @return bool
  */
 private final function insert()
 {
     $this->toReadOnly();
     $request = new Request($this->config, $this->accessPoint);
     $queryList = array();
     for ($i = 0; $i < $this->getLength(); $i++) {
         $insert = new Insert($this->getTableName());
         foreach ($this->columnList as $column => $settings) {
             if ($this->content->isNull($i, $column)) {
                 if ($settings['null'] === false && $settings['default'] === false) {
                     throw new RuntimeException('column `' . $column . '` is null (not null & no default)');
                 }
             } else {
                 $insert->addValue($column, $settings['type'], $this->content->get($i, $column));
             }
         }
         $queryList[] = $insert->assemble();
     }
     try {
         $request->queryList($queryList);
     } catch (Exception $e) {
         return false;
     }
     return true;
 }
コード例 #2
0
ファイル: BucketTest.php プロジェクト: map-framework/map
 public function testIsNull_false()
 {
     $this->assertFalse($this->bucket->isNull(self::GROUP, self::KEY_STRING));
 }