andWhere(['>', 'depth', 0])->all(); } public function find($id): ?Page { return Page::findOne($id); } public function findBySlug($slug): ?Page { return Page::find()->andWhere(['slug' => $slug])->andWhere(['>', 'depth', 0])->one(); } }