本文整理汇总了PHP中CActiveRecord::afterValidate方法的典型用法代码示例。如果您正苦于以下问题:PHP CActiveRecord::afterValidate方法的具体用法?PHP CActiveRecord::afterValidate怎么用?PHP CActiveRecord::afterValidate使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CActiveRecord
的用法示例。
在下文中一共展示了CActiveRecord::afterValidate方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: afterValidate
protected function afterValidate()
{
if (!$this->getDateRegMatch()) {
$this->addError('datum', 'Datum muss das Format: TT.MM.JJJJ oder TT-TT.MM.JJJJ oder TT/TT.MM.JJJJ oder TT.MM.JJJJ-TT.MM.JJJJ haben.');
}
return parent::afterValidate();
}
示例2: afterValidate
protected function afterValidate()
{
if ($this->isNewRecord || $this->newPassword) {
$this->password = $this->encrypt($this->password);
}
return parent::afterValidate();
}
示例3: afterValidate
protected function afterValidate()
{
$highlighter = new CTextHighlighter();
$highlighter->language = $this->language;
$this->html = $highlighter->highlight($this->code);
return parent::afterValidate();
}
示例4: afterValidate
protected function afterValidate()
{
parent::afterValidate();
if (!$this->hasErrors()) {
$this->password = $this->hashPassword($this->password);
}
}
示例5: afterValidate
public function afterValidate()
{
$this->onBeforeSave = function ($event) {
$finfo = finfo_open(FILEINFO_MIME_TYPE);
$event->sender->mime_type = finfo_file($finfo, 'files/_user/bloc_document/' . $event->sender->file);
finfo_close($finfo);
};
return parent::afterValidate();
}
示例6: afterValidate
protected function afterValidate()
{
foreach (array_keys(Yii::app()->params["ac_areas_chap"]) as $ac) {
if ($this->{$ac} == "") {
$this->{$ac} = null;
}
}
// Если нам указали особые права доступа, проверяем, есть ли уже такие в переводе?
if ($this->ac_read . $this->ac_gen . $this->ac_rate . $this->ac_comment . $this->ac_tr != "") {
$r = Yii::app()->db->createCommand("SELECT 1 FROM chapters WHERE book_id = :book_id AND id != :id AND (ac_read || ac_gen || ac_rate || ac_comment || ac_tr != '')")->query(array("book_id" => $this->book_id, "id" => $this->id));
if ($r->rowCount > 0) {
$this->addError("ac_read", "В переводе только одна глава может иметь особые права доступа.");
}
}
parent::afterValidate();
}
示例7: afterValidate
protected function afterValidate()
{
// Аватар
if ($this->scenario == "info" && $this->rm_img) {
$this->img->delete();
}
if ($this->scenario == "info" && $this->new_img) {
$new_img = new UploadedImage("book");
if (!$new_img->upload($this->new_img, 200, 500)) {
$this->addError("new_img", "Не удалось загрузить картинку, попробуйте другую.");
return;
}
if ($this->img instanceof UploadedImage) {
$this->img->delete();
}
$this->img = $new_img;
}
parent::afterValidate();
}
示例8: afterValidate
protected function afterValidate()
{
if ($this->hasErrors()) {
$this->instrumento_juridico = InstrumentoJuridico::load(json_decode($this->instrumento_juridico));
$this->convenio = Convenio::load(json_decode($this->convenio));
}
parent::afterValidate();
}
示例9: afterValidate
protected function afterValidate()
{
if ($this->scenario == 'buy') {
return true;
}
if (!$this->access) {
$this->addError('access', 'Выберите флаги доступа');
}
if ($this->isNewRecord && $this->flags === 'a' && !$this->password) {
$this->addError('password', 'Для админки по нику нужно обязательно указывать пароль');
}
if ($this->flags === 'd' && !filter_var($this->steamid, FILTER_VALIDATE_IP, array('flags' => FILTER_FLAG_IPV4))) {
$this->addError('steamid', 'Неверно введен IP');
}
if ($this->flags === 'c' && !Prefs::validate_value($this->steamid, 'steamid')) {
$this->addError('steamid', 'Неверно введен SteamID');
}
if ($this->password && !preg_match('#^([a-z0-9]+)$#i', $this->password)) {
$this->addError('password', 'Пароль может содержать только буквы латинского алфавита и цифры');
}
if (!$this->isNewRecord && $this->days < $this->change && $this->addtake === '1') {
$this->addError('', 'Ошибка! Нельзя забрать дней больше, чем у него уже есть');
}
if (empty($this->servers)) {
$this->addError('servers', 'Выберите хотябы один сервер');
}
if ($this->hasErrors()) {
return $this->getErrors();
}
return parent::afterValidate();
}
示例10: afterValidate
public function afterValidate()
{
parent::afterValidate();
if (isset($this->cert_image) && $this->cert_image != null) {
}
}
示例11: afterValidate
public function afterValidate()
{
parent::afterValidate();
$this->dbDate();
}
示例12: afterValidate
protected function afterValidate()
{
parent::afterValidate();
//$this->password = $this->encrypt($this->password,Yii::app()->params->hashkey);
$this->ip = $_SERVER['REMOTE_ADDR'];
}
示例13: afterValidate
/**
* apply a hash on the password before we store it in the database
*/
protected function afterValidate()
{
parent::afterValidate();
//ensure we don't have any other errors
if (!$this->hasErrors()) {
$this->password = $this->hashPassword($this->password);
}
}
开发者ID:dimahongkong,项目名称:Searching-Exploring-with-Speech-Augmented-Map-Information-SESAMI,代码行数:11,代码来源:Account.php
示例14: afterValidate
protected function afterValidate()
{
parent::afterValidate();
//lakukan enkripsi pada password yang di input
}
示例15: afterValidate
protected function afterValidate()
{
parent::afterValidate();
$this->pwd_hash = $this->hash($this->password);
}