Ejemplo n.º 1
0
 /**
  * Find database record collection by column name and its value.
  * This is generic method that should be used in nested classes to find its
  * records by some its column values.
  *
  * @param QueryInterface $query Query object instance
  * @param string $columnName Column name for searching in calling class
  * @param mixed $columnValue Column value
  * @return self[]  Record instance if it was found and 4th variable has NOT been passed,
  *                      NULL if record has NOT been found and 4th variable has NOT been passed
  * @deprecated Record should not be queryable, query class ancestor must be used
  */
 public static function collectionByColumn(QueryInterface $query, $columnName, $columnValue)
 {
     // Perform db request and get materials
     return $query->className(get_called_class())->cond($columnName, $columnValue)->exec();
 }