/** * Renvoie le plus récent * @return Application_Model_About_Legal_Multilang * @throws Application_Model_Exception */ public static function getLatest() { try { $cgvSet = new Application_Model_DbTable_About_Legal(); $id = $cgvSet->getLatestId(); $model = new self($id); if (!$model instanceof self) { throw new Application_Model_Exception("Can't create an About Legal Object"); } else { return $model; } } catch (Zend_Exception $e) { throw new Application_Model_Exception("Can't get latest Legal", null, $e); } }
public static function getLatestByLocale($locale) { try { $cgvSet = new Application_Model_DbTable_About_Legal(); $id = $cgvSet->getLatestId(); $model = new self($id, $locale); if (!$model instanceof self) { throw new Application_Model_Exception("Can't create a Legal Model Object"); } else { return $model; } } catch (Zend_Exception $e) { throw new Application_Model_Exception("Can't get latest legals for locale {$locale}", null, $e); } }