/** * getById function. Get Ingredient Object by id in array. In fact it is only a more modern and convenient way to access data. For the sake of coherence ! * * @access public * @static * @param int id - $id * @return Ingredient Object */ public static function getById($id) { if (Ingredient::getDataAt($id)) { return new Ingredient($id); } return null; }