Collections\Collection::findLast PHP 메소드

findLast() 공개 메소드

public findLast ( callable $condition )
$condition callable
    public function findLast(callable $condition)
    {
        $index = $this->findLastIndex($condition);
        return $index == -1 ? false : $this->items[$index];
    }

Usage Example

예제 #1
0
 /**
  * Finds and returns the last item in the collection that satisfies the callback.
  *
  * @param callback $condition The condition criteria to test each item, requires one argument that represents the Collection item during an iteration.
  * @return {{foo}} The last item that matched condition or -1 if no item was found matching the condition.
  */
 public function findLast(callable $condition)
 {
     return parent::findLast($condition);
 }