コード例 #1
0
ファイル: Model.php プロジェクト: rotexsoft/leanorm
 /**
  * 
  * {@inheritDoc}
  */
 public function fetchCol(array $params = array())
 {
     if (array_key_exists('cols', $params) && (!is_array($params['cols']) || count($params['cols']) < 1)) {
         //throw Exception
         $msg = "ERROR: Bad param entry. Array containing at least 1 string " . "value expected as the value of the item with the key named 'cols' ." . PHP_EOL . var_export($params, true) . PHP_EOL . " passed to " . get_class($this) . '::' . __FUNCTION__ . '(...).' . PHP_EOL;
         throw new ModelBadFetchParamsSuppliedException($msg);
     }
     $query_obj = $this->_buildFetchQueryObjectFromParams($params);
     $sql = $query_obj->__toString();
     $params_2_bind_2_sql = $query_obj->getBindValues();
     return $this->_db_connector->dbFetchCol($sql, $params_2_bind_2_sql);
 }