'cmsps_editos', 'primary' => 'id_edito', 'multilang' => TRUE, 'multilang_shop' => TRUE, 'fields' => array( 'active' => array('type' => self::TYPE_INT, 'validate' => 'isInt'), // Lang fields 'title' => array('type' => self::TYPE_STRING, 'lang' => TRUE, 'validate' => 'isGenericName', 'required' => TRUE), 'slug' => array('type' => self::TYPE_STRING, 'lang' => TRUE, 'validate' => 'isGenericName'), 'intro' => array('type' => self::TYPE_HTML, 'lang' => TRUE, 'validate' => 'isCleanHtml'), 'content' => array('type' => self::TYPE_HTML, 'lang' => TRUE, 'validate' => 'isCleanHtml'), 'meta_title' => array('type' => self::TYPE_STRING, 'lang' => TRUE, 'validate' => 'isGenericName'), 'meta_desc' => array('type' => self::TYPE_STRING, 'lang' => TRUE, 'validate' => 'isGenericName'), 'date_add' => array('type' => self::TYPE_DATE), 'date_upd' => array('type' => self::TYPE_DATE) ), ); public function __construct($id = NULL, $id_lang = NULL, $id_shop = NULL) { parent::__construct($id, $id_lang, $id_shop); } public static function getLast($id_lang) { $collection_post = new Collection('CmsPsEdito', $id_lang); $collection_post->where('active', '=', 1); $collection_post->orderby('date_add', 'DESC'); $collection_post->setPageSize(1); $edito = $collection_post->getFirst(); return $edito; } }