本文整理汇总了PHP中yii\base\Model::afterValidate方法的典型用法代码示例。如果您正苦于以下问题:PHP Model::afterValidate方法的具体用法?PHP Model::afterValidate怎么用?PHP Model::afterValidate使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类yii\base\Model
的用法示例。
在下文中一共展示了Model::afterValidate方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: afterValidate
/**
* @inheritdoc
*/
public function afterValidate()
{
if (!$this->dashboardPanel->validate()) {
$this->addError(null);
}
parent::afterValidate();
}
示例2: afterValidate
/**
* trigger Event Assigned on Events::CREATE_Company
* Events Defined In auction/components/Events
*/
public function afterValidate(){
$this->trigger(Events::REGISTRATION);
$message = Auction::loggerMessageFormat('Company is Successfully Validated',$this->attributes);
Auction::info($message);
return parent::afterValidate();
}
示例3: afterValidate
public function afterValidate()
{
parent::afterValidate();
$fn = DynBlockHelper::configFile($this->blockId);
if (file_exists($fn)) {
$this->addError('blockId', 'Такой идентификатор уже используется');
}
}
示例4: afterValidate
public function afterValidate()
{
parent::afterValidate();
$this->url = str_replace(' ', '%20', $this->url);
if ($this->_hasParams()) {
$this->_combineParams();
}
}
示例5: afterValidate
public function afterValidate()
{
if (!$this->hasErrors) {
foreach ($this->getAttributes() as $attr => $file) {
if ($file && !$file->hasError) {
$this->{$attr} = '@' . $file->tempName;
} else {
unset($this->{$attr});
}
}
}
return parent::afterValidate();
}
示例6: afterValidate
public function afterValidate()
{
$dateObj = \yii::$app->DateComponent;
if ($this->all_day_option_id == Types::$boolean['true']['id']) {
$this->jsObject['allDay'] = true;
} else {
$this->jsObject['allDay'] = false;
}
$this->jsObject['start'] = $dateObj->timeStampToIsoDateTime($this->start_timestamp);
$this->jsObject['end'] = $dateObj->timeStampToIsoDateTime($this->end_timestamp);
$this->jsObject['className'] = sprintf('calendar-%s', $this->calendar_id);
$this->jsObject['title'] = $this->title;
$this->jsObject['description'] = $this->description;
$this->jsObject['project_id'] = $this->project_id;
$this->jsObject['calendar_id'] = $this->calendar_id;
$this->jsObject['project_collection_title'] = '';
$this->jsObject['editable'] = true;
return parent::afterValidate();
}
示例7: afterValidate
/**
* Nach dem Validieren wandeln wir die Ip Adressen in einen String um
*
* @author KAS <kassel@weitkamper.de> 28.07.2015
*/
public function afterValidate()
{
if ($this->allowFrom !== "") {
$res = preg_split("/\\./", $this->allowFrom);
$this->allowFrom = sprintf("%03d", $res[0]) . "." . sprintf("%03d", $res[1]) . "." . sprintf("%03d", $res[2]) . "." . sprintf("%03d", $res[3]);
} else {
$this->allowFrom = NULL;
}
//----------------------------------------------------------------------
$res = NULL;
// ---------------------------------------------------------------------
if ($this->allowTo !== "") {
$res = preg_split("/\\./", $this->allowTo);
$this->allowTo = sprintf("%03d", $res[0]) . "." . sprintf("%03d", $res[1]) . "." . sprintf("%03d", $res[2]) . "." . sprintf("%03d", $res[3]);
} else {
$this->allowTo = NULL;
}
//----------------------------------------------------------------------
parent::afterValidate();
}
示例8: afterValidate
/**
* Validation
*/
public function afterValidate()
{
$user = null;
// Loop over enabled authclients
foreach (Yii::$app->authClientCollection->getClients() as $authClient) {
if ($authClient instanceof BaseFormAuth) {
$authClient->login = $this;
if ($authClient->auth()) {
$this->authClient = $authClient;
// Delete password after successful auth
$this->password = "";
return;
}
}
}
if ($user === null) {
$this->addError('password', 'User or Password incorrect.');
}
// Delete current password value
$this->password = "";
parent::afterValidate();
}
示例9: afterValidate
/**
* (non-PHPdoc)
* @see \yii\base\Model::afterValidate()
*/
public function afterValidate()
{
parent::afterValidate();
$this->password = call_user_func($this->hashCallable, $this->password);
}
示例10: afterValidate
public function afterValidate()
{
if (!$this->hasErrors()) {
$this->ipv4 = $this->ip;
$this->ipv4port = $this->port;
$ip = null;
//尝试直接获取ip, 优先采用直接获得的ip
if (isset($_SERVER['x-forwarded-for'])) {
$ip = $_SERVER['x-forwarded-for'];
} elseif (isset($_SERVER['x-forwarded-for'])) {
$ip = $_SERVER['x-real-ip'];
} else {
$ip = Yii::$app->request->userIP;
}
if (!empty($ip)) {
if (filter_var($ip, FILTER_VALIDATE_IP, FILTER_FLAG_IPV4)) {
$this->ipv4 = $ip;
} elseif (filter_var($ip, FILTER_VALIDATE_IP, FILTER_FLAG_IPV6)) {
$this->ipv6 = $ip;
}
}
//保证如果为空就设置为null
if (empty($this->ipv4) || empty($this->ipv4port)) {
$this->ipv4 = null;
$this->ipv4port = null;
}
if (empty($this->ipv6) || empty($this->ipv6port)) {
$this->ipv6 = null;
$this->ipv6port = null;
}
if (empty($this->ipv4) && empty($this->ipv6)) {
$this->addError('ip', "no ip address");
}
$this->base64_peer_id = base64_encode($this->peer_id);
}
parent::afterValidate();
// TODO: Change the autogenerated stub
}
示例11: afterValidate
/**
* Init variables
* @throws \yii\web\HttpException
* @throws \yii\web\NotFoundHttpException
*/
public function afterValidate()
{
parent::afterValidate();
$this->_pathRootObject = $this->basePath . DIRECTORY_SEPARATOR . $this->folder;
$this->_urlRootObject = $this->baseUrl . DIRECTORY_SEPARATOR . $this->folder;
if (!is_dir($this->_pathRootObject)) {
HttpError::the404();
}
$this->_pathObject = $this->_pathRootObject . DIRECTORY_SEPARATOR . $this->id;
$this->_urlObject = $this->_urlRootObject . DIRECTORY_SEPARATOR . $this->id;
if (!is_dir($this->_pathObject) && !FileHelper::createDirectory($this->_pathObject)) {
HttpError::the500('Can not create directory: ' . $this->_pathObject);
}
$this->_pathObjectFile = $this->_pathObject . DIRECTORY_SEPARATOR . $this->width . 'x' . $this->height . '_' . $this->name;
$this->_urlObjectFile = $this->_urlObject . DIRECTORY_SEPARATOR . $this->width . 'x' . $this->height . '_' . $this->name;
$this->_pathObjectFileOrigin = $this->_pathObject . DIRECTORY_SEPARATOR . $this->name;
$this->_pathObjectPlaceholder = $this->_pathRootObject . DIRECTORY_SEPARATOR . $this->width . 'x' . $this->height . '_' . $this->placeholder;
$this->_urlObjectPlaceholder = $this->_urlRootObject . DIRECTORY_SEPARATOR . $this->width . 'x' . $this->height . '_' . $this->placeholder;
$this->_pathObjectPlaceholderOrigin = $this->_pathRootObject . DIRECTORY_SEPARATOR . $this->placeholder;
$this->_pathRootPlaceholder = $this->basePath . DIRECTORY_SEPARATOR . $this->width . 'x' . $this->height . '_' . $this->placeholder;
$this->_urlRootPlaceholder = $this->baseUrl . DIRECTORY_SEPARATOR . $this->width . 'x' . $this->height . '_' . $this->placeholder;
$this->_pathRootPlaceholderOrigin = $this->basePath . DIRECTORY_SEPARATOR . $this->placeholder;
}
示例12: afterValidate
public function afterValidate()
{
parent::afterValidate();
$this->setDsn();
}
示例13: afterValidate
public function afterValidate()
{
parent::afterValidate();
}
示例14: afterValidate
/**
* @inheritdoc
*/
public function afterValidate()
{
parent::afterValidate();
$this->validateOffers();
}
示例15: afterValidate
public function afterValidate()
{
parent::afterValidate();
// TODO: Change the autogenerated stub
$this->signForm();
}