/** * @param $userid * @return array|\Zend_Db_Table_Rowset_Abstract */ public function getAllByUser($userid) { $pt = new Privacy(); $res = $pt->checkPrivacy("visit", $userid); if ($res) { return $this->fetchAll($this->select()->where("userid=?", $userid)->order("row")); } else { return ["status" => true]; } }
private function updateProfileFields() { $view = new \Cunity\Profile\View\ProfileEdit(); /** @noinspection PhpUndefinedMethodInspection */ $user = $this->user->getTable()->get($_SESSION['user']->userid); /** @var User $user */ $profile = $user->toArray(["userid", "username", "email", "firstname", "lastname", "registered", "pimg", "timg", "palbumid", "talbumid"]); $table = new Db\Table\Privacy(); $privacy = $table->getPrivacy(); $table = new NotificationSettings(); $notificationSettings = $table->getSettings(); $profileFields = new ProfileFields(); $view->assign('profileFields', $profileFields->getAll()); $view->assign("profile", array_merge($profile, ["privacy" => $privacy, 'notificationSettings' => $notificationSettings])); $view->render(); }