コード例 #1
0
ファイル: Arr.php プロジェクト: krisanalfa/docolight
 /**
  * Sort the array using the given callback.
  *
  * @param array    $array
  * @param callable $callback
  *
  * @return array
  */
 public static function sort($array, callable $callback)
 {
     return Collection::make($array)->sortBy($callback)->all();
 }
コード例 #2
0
 /**
  * Fetches the data item keys from the persistent data storage.
  *
  * @return array list of data item keys.
  */
 protected function fetchKeys()
 {
     return $this->collection->first() instanceof Fluent ? array_keys($this->collection->first()->attributes()) : array();
 }