Пример #1
0
 /**
  * Specifies the SQL statement or sql file to be executed.
  * Any previous execution will be terminated or cancel.
  * @param string $value The SQL statement or sql file to be executed.
  * @param array $params Параметры построения запроса.
  * @return DbCommand Для цепочечных вызовов.
  */
 public function setText($value, &$params = null)
 {
     if (!empty($value)) {
         if (substr($value, -4) === '.sql') {
             $value = file_get_contents($value);
         }
         $value = $this->prepareSql($value, $params);
     }
     return parent::setText($value);
 }
Пример #2
0
 /**
  * 打上标签,未了数据库的安全日志
  */
 public function setText($value)
 {
     $value .= ' /* mis-data-stream-secure-tag */';
     return parent::setText($value);
 }