private function buildData() { // Construts a query criteria $criteria_t = new TActiveRecordCriteria(); $criteria_t->Condition = 'idtm_user = :idtm_user'; $criteria_t->Parameters[':idtm_user'] = $this->User->getUserId($this->User->Name); $criteria_t->OrdersBy['partei_name'] = 'asc'; // query for the posts with the above criteria and with author information return ParteiRecord::finder()->findAll($criteria_t); }
/** * Initializes the inputs with existing user data. * This method is invoked by the framework when the page is being initialized. * @param mixed event parameter */ public function onInit($param) { parent::onInit($param); if (!$this->IsPostBack && !$this->isCallback) { $sql = "SELECT idtm_user_role, user_role_name FROM tm_user_role"; $this->User->isInRole('Administrator') ? '' : ($sql .= " WHERE user_role_name = 'Benutzer'"); $data = PFH::convertdbObjectArray(UserRoleRecord::finder()->findAllBySql($sql), array("idtm_user_role", "user_role_name")); $this->Role->DataSource = $data; $this->Role->dataBind(); // Retrieves the existing user data. This is equivalent to: $userRecord = $this->getUserRecord(); //$userRecord=$this->UserRecord; // Populates the input controls with the existing user data $this->Username->Text = $userRecord->user_username; $this->Email->Text = $userRecord->user_mail; $this->Role->SelectedValue = $userRecord->idtm_user_role; $this->FirstName->Text = $userRecord->user_vorname; $this->LastName->Text = $userRecord->user_name; $parteiRecord = ParteiRecord::finder()->findBy_idtm_user($userRecord->idtm_user); $this->idta_partei->Text = $parteiRecord->idta_partei; $this->bind_lstAdress(); } }
/** * Fetches posts from database with offset and limit. */ protected function getPartei($offset, $limit) { // Construts a query criteria $criteria_t = new TActiveRecordCriteria(); $criteria_t->Condition = 'idtm_user = :idtm_user'; $criteria_t->Parameters[':idtm_user'] = $this->User->getUserId($this->User->Name); $criteria_t->OrdersBy['partei_name'] = 'asc'; $criteria_t->Limit = $limit; $criteria_t->Offset = $offset; // query for the posts with the above criteria and with author information return ParteiRecord::finder()->findAll($criteria_t); }
protected function getSelectedPartei($key) { $SQL = "SELECT partei_name, partei_name2, ta_partei.idta_partei FROM ta_partei INNER JOIN ta_partei_has_ta_adresse ON ta_partei.idta_partei=ta_partei_has_ta_adresse.idta_partei INNER JOIN ta_adresse ON ta_adresse.idta_adresse = ta_partei_has_ta_adresse.idta_adresse INNER JOIN ta_waren ON ta_waren.idta_adresse = ta_adresse.idta_adresse WHERE ta_waren.idta_waren = " . $key; $item = ParteiRecord::finder()->findBySQL($SQL); return $item; }