exists() public method

Returns a value indicating whether the query result contains any row of data.
public exists ( Connection $db = null ) : boolean
$db Connection the database connection used to generate the SQL statement. If this parameter is not given, the `db` application component will be used.
return boolean whether the query result contains any row of data.
Ejemplo n.º 1
0
 /**
  * @inheritdoc
  */
 public function exists($db = null)
 {
     if ($db === null) {
         /* @var $modelClass ActiveRecord */
         $modelClass = $this->modelClass;
         $db = $modelClass::getDb();
     }
     return parent::exists($db);
 }