当前位置: 首页>>代码示例>>PHP>>正文


PHP modObjectCreateProcessor::beforeSave方法代码示例

本文整理汇总了PHP中modObjectCreateProcessor::beforeSave方法的典型用法代码示例。如果您正苦于以下问题:PHP modObjectCreateProcessor::beforeSave方法的具体用法?PHP modObjectCreateProcessor::beforeSave怎么用?PHP modObjectCreateProcessor::beforeSave使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在modObjectCreateProcessor的用法示例。


在下文中一共展示了modObjectCreateProcessor::beforeSave方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: beforeSave

 /** {@inheritDoc} */
 public function beforeSave()
 {
     $q = $this->modx->newQuery($this->classKey);
     $q->where(array('tab:=' => $this->getProperty('tab')));
     $this->object->fromArray(array('rank' => $this->modx->getCount('up2Fields', $q)));
     return parent::beforeSave();
 }
开发者ID:arimanr,项目名称:userprofile2,代码行数:8,代码来源:create.class.php

示例2: beforeSave

 public function beforeSave()
 {
     $formId = $this->getProperty('form_id');
     $label = $this->getProperty('label');
     $type = $this->getProperty('type');
     $default = $this->getProperty('default');
     if (empty($label)) {
         $this->addFieldError('label', $this->modx->lexicon('formz.field_err_ns'));
     } else {
         if ($this->doesAlreadyExist(array('label' => $label, 'form_id' => $formId))) {
             $this->addFieldError('label', $this->modx->lexicon('formz.field_err_ae'));
         }
     }
     switch ($type) {
         case 'select':
         case 'checkbox':
         case 'radio':
             $values = $this->getProperty('values');
             $this->validationType = false;
             break;
         default:
             // textbox
             $values = '';
             $this->validationType = true;
     }
     $settings = array('label' => $label);
     if (!empty($default)) {
         $settings['default'] = $default;
     }
     if (!empty($values)) {
         $settings['values'] = $values;
     }
     $this->object->set('settings', $this->modx->toJSON($settings));
     return parent::beforeSave();
 }
开发者ID:doksec,项目名称:formz,代码行数:35,代码来源:create.class.php

示例3: beforeSave

 public function beforeSave()
 {
     $name = $this->getProperty('tag');
     $group = $this->getProperty('group');
     $alias = $this->getProperty('alias');
     if (empty($name) || empty($group)) {
         if (empty($group)) {
             $this->addFieldError('group', $this->modx->lexicon('tagger.err.group_name_ns'));
         }
         if (empty($name)) {
             $this->addFieldError('tag', $this->modx->lexicon('tagger.err.tag_name_ns'));
         }
     } else {
         if ($this->doesAlreadyExist(array('tag' => $name, 'group' => $group))) {
             $this->addFieldError('tag', $this->modx->lexicon('tagger.err.tag_name_ae'));
         }
     }
     if (!empty($alias)) {
         $alias = $this->object->cleanAlias($alias);
         if ($this->doesAlreadyExist(array('alias' => $alias, 'group' => $group))) {
             $this->addFieldError('alias', $this->modx->lexicon('tagger.err.tag_alias_ae'));
         }
     }
     return parent::beforeSave();
 }
开发者ID:hansek,项目名称:Tagger,代码行数:25,代码来源:create.class.php

示例4: beforeSave

 /** {@inheritDoc} */
 public function beforeSave()
 {
     $data = $this->modx->currencyrate->calcData($this->object->toArray());
     $data['rank'] = $this->modx->getCount($this->classKey);
     $this->object->fromArray($data);
     return parent::beforeSave();
 }
开发者ID:xom9k,项目名称:currencyrate,代码行数:8,代码来源:create.class.php

示例5: beforeSave

 public function beforeSave()
 {
     if (!$this->object->get('name')) {
         return 'Please, type project name';
     }
     return parent::beforeSave();
 }
开发者ID:Tramp1357,项目名称:atlasorg,代码行数:7,代码来源:create.class.php

示例6: beforeSave

 /**
  * {@inheritDoc}
  * @return boolean
  */
 public function beforeSave()
 {
     $this->addProfile();
     $this->addUserGroups();
     $this->validator = new modUserValidation($this, $this->object, $this->profile);
     $this->validator->validate();
     return parent::beforeSave();
 }
开发者ID:rosstimson,项目名称:revolution,代码行数:12,代码来源:create.class.php

示例7: beforeSave

 public function beforeSave()
 {
     if ($this->doesAlreadyExist(array('principal' => $this->getProperty('principal'), 'principal_class' => 'modUserGroup', 'target' => $this->getProperty('target'), 'policy' => $this->getProperty('policy'), 'context_key' => $this->getProperty('context_key')))) {
         $this->addFieldError('target', $this->modx->lexicon('access_source_err_ae'));
     }
     $this->object->set('principal_class', 'modUserGroup');
     return parent::beforeSave();
 }
开发者ID:ChrstnMgcn,项目名称:revolution,代码行数:8,代码来源:create.class.php

示例8: beforeSave

 public function beforeSave()
 {
     $menuIndex = $this->modx->getCount($this->classKey, array('parent' => $this->getProperty('parent')));
     $this->object->set('menuindex', $menuIndex);
     $this->object->set('action', $this->getProperty('action_id'));
     $this->object->set('text', $this->getProperty('text'));
     return parent::beforeSave();
 }
开发者ID:ChrstnMgcn,项目名称:revolution,代码行数:8,代码来源:create.class.php

示例9: beforeSave

 public function beforeSave()
 {
     $name = $this->getProperty('persons_name');
     if (empty($name)) {
         $this->addFieldError('persons_name', $this->modx->lexicon('Specify'));
     }
     return parent::beforeSave();
 }
开发者ID:Vitaliz,项目名称:simpleCRM,代码行数:8,代码来源:create.class.php

示例10: beforeSave

 public function beforeSave()
 {
     /* User and Server info */
     $data = array('ip_address' => $_SERVER['REMOTE_ADDR'], 'server_name' => $_SERVER['SERVER_NAME'], 'server_address' => $_SERVER['SERVER_ADDR'], 'user_agent' => $_SERVER['HTTP_USER_AGENT'], 'request_time' => $_SERVER['REQUEST_TIME']);
     // set data and time created
     $this->object->set('senton', date('Y-m-d H:i:s', time()));
     $this->object->set('data', serialize($data));
     return parent::beforeSave();
 }
开发者ID:doksec,项目名称:formz,代码行数:9,代码来源:create.class.php

示例11: beforeSave

 public function beforeSave()
 {
     $this->object->set('constraint_class', 'modResource');
     $actionId = $this->getProperty('action_id', null);
     if ($actionId !== null) {
         $this->object->set('action', $actionId);
     }
     return parent::beforeSave();
 }
开发者ID:rosstimson,项目名称:revolution,代码行数:9,代码来源:create.class.php

示例12: beforeSave

 public function beforeSave()
 {
     $name = $this->getProperty('name');
     if (empty($name)) {
         $this->addFieldError('name', $this->modx->lexicon('namespace_err_ns_name'));
     }
     $this->object->set('name', $name);
     $this->object->set('path', trim($this->object->get('path')));
     return parent::beforeSave();
 }
开发者ID:rosstimson,项目名称:revolution,代码行数:10,代码来源:create.class.php

示例13: beforeSave

 public function beforeSave()
 {
     $uloginid = $this->getProperty('uloginid');
     if ($this->doesAlreadyExist(array('uloginid' => $uloginid))) {
         $this->addFieldError('uloginid', $this->modx->lexicon('ulogin.widget_err_ae'));
         //        } elseif (empty($uloginid)) {
         //            $this->addFieldError('uloginid',$this->modx->lexicon('ulogin.widget_err_ns_uloginid'));
     }
     return parent::beforeSave();
 }
开发者ID:bendasvadim,项目名称:ulogin-ModX,代码行数:10,代码来源:create.class.php

示例14: beforeSave

 /**
  * {@inheritDoc}
  * @return boolean
  */
 public function beforeSave()
 {
     $this->addProfile();
     $sudo = $this->getProperty('sudo', null);
     if ($sudo !== null) {
         $this->object->setSudo(!empty($sudo));
     }
     $this->validator = new modUserValidation($this, $this->object, $this->profile);
     $this->validator->validate();
     return parent::beforeSave();
 }
开发者ID:rossng,项目名称:revolution,代码行数:15,代码来源:create.class.php

示例15: beforeSave

 public function beforeSave()
 {
     $c = array('target' => $this->object->get('target'), 'principal_class' => $this->object->get('principal_class'), 'principal' => $this->object->get('principal'), 'authority' => $this->object->get('authority'), 'policy' => $this->object->get('policy'));
     if ($this->getProperty('context_key')) {
         $c['context_key'] = $this->getProperty('context_key');
     }
     if ($this->doesAlreadyExist($c)) {
         return $this->modx->lexicon($this->objectType . '_err_ae');
     }
     return parent::beforeSave();
 }
开发者ID:ChrstnMgcn,项目名称:revolution,代码行数:11,代码来源:addacl.class.php


注:本文中的modObjectCreateProcessor::beforeSave方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。