FOF30\Model\DataModel::firstOrFail PHP Method

firstOrFail() public method

Return the first item found or throw a \RuntimeException
public firstOrFail ( ) : static
return static
    public function firstOrFail()
    {
        $item = $this->get(true, 0, 1)->first();
        if (is_null($item)) {
            throw new NoItemsFound(get_class($this));
        }
        return $item;
    }