AppBundle\Model\RecipeCollection::findOneBySlug PHP Method

findOneBySlug() public method

public findOneBySlug ( $slug )
    public function findOneBySlug($slug)
    {
        foreach ($this->recipes as $recipe) {
            if ($recipe->slug == $slug) {
                return $recipe;
            }
        }
        return null;
    }