findOne() public method

This method will return only the first bean of the array. If no beans are found, this method will return NULL.
See also: Finder::find
public findOne ( string $type, string $sql = NULL, array $bindings = [] ) : redbeanphp\OODBBean
$type string type the type of bean you are looking for
$sql string sql SQL query to find the desired bean, starting right after WHERE clause
$bindings array values array of values to be bound to parameters in query
return redbeanphp\OODBBean
コード例 #1
0
ファイル: Facade.php プロジェクト: up9cloud/redbean
 /**
  * @see Facade::find
  * This variation returns the first bean only.
  *
  * @param string $type     the type of bean you are looking for
  * @param string $sql      SQL query to find the desired bean, starting right after WHERE clause
  * @param array  $bindings array of values to be bound to parameters in query
  *
  * @return OODBBean
  */
 public static function findOne($type, $sql = NULL, $bindings = array())
 {
     return self::$finder->findOne($type, $sql, $bindings);
 }