protected function prepare() { parent::prepare(); // data description для информера if (in_array($this->getState(), ['main'])) { $data = $this->getData(); $dd = $this->getDataDescription(); if ($data) { $fd = new FieldDescription('is_subscribed'); $fd->setType(FieldDescription::FIELD_TYPE_BOOL); $dd->addFieldDescription($fd); $f = new Field('is_subscribed'); $data->addField($f); $f_subscription_id = $data->getFieldByName('subscription_id'); $subscribed = $this->dbh->getColumn('mail_subscriptions2users', 'subscription_id', array('u_id' => $this->document->getUser()->getID())); foreach ($f_subscription_id as $i => $row) { $f->setRowData($i, in_array($row, $subscribed) ? '1' : '0'); } } } }
/** * @copydoc DBDataSet::prepare */ protected function prepare() { parent::prepare(); if ($this->document->getUser()->isAuthenticated() && ($captcha = $this->getDataDescription()->getFieldDescriptionByName('captcha'))) { $this->getDataDescription()->removeFieldDescription($captcha); } }
protected function prepare() { parent::prepare(); //u_id и u_is_active нам не нужны ни при каких раскладах if ($this->getDataDescription()->getFieldDescriptionByName('u_id')) { $this->getDataDescription()->removeFieldDescription($this->getDataDescription()->getFieldDescriptionByName('u_id')); } if ($this->getDataDescription()->getFieldDescriptionByName('u_is_active')) { $this->getDataDescription()->removeFieldDescription($this->getDataDescription()->getFieldDescriptionByName('u_is_active')); } //Тут таки нужно вернуться к параметру confirmationNeeded if ($this->getDataDescription()->getFieldDescriptionByName('u_password')) { $this->getDataDescription()->removeFieldDescription($this->getDataDescription()->getFieldDescriptionByName('u_password')); } if ($this->getDataDescription()->getFieldDescriptionByName('u_name')) { $this->getDataDescription()->getFieldDescriptionByName('u_name')->setType(FieldDescription::FIELD_TYPE_EMAIL); } }
/** * @copydoc DBDataSet::prepare */ protected function prepare() { parent::prepare(); if ($this->getType() == self::COMPONENT_TYPE_LIST) { $this->createFilter(); } }