示例#1
0
 /**
  * @return bool
  */
 public final function close()
 {
     if (!$this->isEmpty()) {
         return false;
     }
     $this->clear();
     return Buffer::close();
 }
示例#2
0
 /**
  * @iterations 500
  */
 public function updating10times()
 {
     $idx = rand(0, count($this->_ids) - 1);
     $_id = $this->_ids[$idx];
     $model = TestSchema::findOne($_id);
     Buffer::open();
     for ($i = 0; $i < 10; $i++) {
         $model->title = 'updating ' . $i;
         if (!$model->save()) {
             throw new Exception(__METHOD__);
         }
     }
     Buffer::flush();
     Buffer::close();
 }