255], ]; } /** * {@inheritdoc} */ public function attributeLabels(): array { return [ 'id' => '公告ID', 'title' => '标题', 'content' => '内容', 'published_at' => '发布时间', 'updated_at' => '更新时间', ]; } /** * give me the latest 3 announcements * @return array */ public static function fetchLatestAnnouncements(): array { return self::find() ->orderBy(['updated_at' => SORT_DESC]) ->limit(3) ->all(); } }