/** * Returns own parents as array of AR-Items. * @param \stdClass $parents. * @return array */ protected function getOwnParents($parents) { $links = $this->getUpLinks()->all(); $out = []; foreach ($links as $link) { $parents->set[] = $link->from; $out[] = Items::findOne($link->from); } return $out; }
/** * Finds the Items model based on its primary key value. * If the model is not found, a 404 HTTP exception will be thrown. * @param integer $id * @return Items the loaded model * @throws NotFoundHttpException if the model cannot be found */ protected function findModel($id) { if (($model = Items::findOne($id)) !== null) { return $model; } else { throw new NotFoundHttpException('The requested page does not exist.'); } }