• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP issetor函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中issetor函数的典型用法代码示例。如果您正苦于以下问题:PHP issetor函数的具体用法?PHP issetor怎么用?PHP issetor使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



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

示例1: process

 public function process()
 {
     switch ($this->_attributeParse()) {
         case 'base64':
             $image = new Ajde_Resource_Image($this->attributes['filename']);
             $image->setWidth($this->attributes['width']);
             $image->setHeight($this->attributes['height']);
             $image->setCrop($this->attributes['crop']);
             $controller = Ajde_Controller::fromRoute(new Ajde_Core_Route('_core/component:imageBase64'));
             $controller->setImage($image);
             $controller->setWidth(issetor($this->attributes['width'], null));
             $controller->setHeight(issetor($this->attributes['height'], null));
             $controller->setExtraClass(issetor($this->attributes['class'], ''));
             return $controller->invoke();
             break;
         case 'html':
             $image = new Ajde_Resource_Image($this->attributes['filename']);
             $image->setWidth($this->attributes['width']);
             $image->setHeight($this->attributes['height']);
             $image->setCrop($this->attributes['crop']);
             $controller = Ajde_Controller::fromRoute(new Ajde_Core_Route('_core/component:image'));
             $controller->setImage($image);
             $controller->setExtraClass(issetor($this->attributes['class'], ''));
             return $controller->invoke();
             break;
         case 'image':
             return false;
             break;
     }
     // TODO:
     throw new Ajde_Component_Exception('Missing required attributes for component call');
 }
开发者ID:nabble,项目名称:updatemybrowser-v1,代码行数:32,代码来源:Image.php


示例2: process

 public function process()
 {
     switch ($this->_attributeParse()) {
         case 'list':
             $options = issetor($this->attributes['options'], array());
             $crud = new AjdeCrud($this->attributes['model'], $options);
             $crud->setAction('list');
             return $crud;
             break;
         case 'edit':
             $options = issetor($this->attributes['options'], array());
             $id = issetor($this->attributes['id'], null);
             $crud = new AjdeCrud($this->attributes['model'], $options);
             $crud->setId($id);
             $crud->setAction('edit/layout');
             return $crud;
             break;
         case 'mainfilter':
             $controller = Controller::fromRoute(new Route('_core/crud:mainfilter'));
             $controller->setCrud($this->attributes['crud']);
             $controller->setRefresh(issetor($this->attributes['refresh'], false));
             return $controller->invoke();
     }
     // TODO:
     throw new Exception();
 }
开发者ID:nabble,项目名称:ajde-core,代码行数:26,代码来源:Crud.php


示例3: process

 public function process()
 {
     switch ($this->_attributeParse()) {
         case 'base64':
             $image = new AjdeResourceImage($this->attributes['filename']);
             $image->setWidth(issetor($this->attributes['width']));
             $image->setHeight(issetor($this->attributes['height']));
             $image->setCrop(String::toBoolean(issetor($this->attributes['crop'], true)));
             $controller = Controller::fromRoute(new Route('_core/component:imageBase64'));
             $controller->setImage($image);
             $controller->setWidth(issetor($this->attributes['width'], null));
             $controller->setHeight(issetor($this->attributes['height'], null));
             $controller->setExtraClass(issetor($this->attributes['class'], ''));
             return $controller->invoke();
             break;
         case 'html':
             return self::getImageTag($this->attributes['filename'], issetor($this->attributes['width']), issetor($this->attributes['height']), String::toBoolean(issetor($this->attributes['crop'], true)), issetor($this->attributes['class'], ''), issetor($this->attributes['lazy'], false), issetor($this->attributes['absoluteUrl'], false));
             break;
         case 'image':
             return false;
             break;
     }
     // TODO:
     throw new Exception('Missing required attributes for component call');
 }
开发者ID:nabble,项目名称:ajde-core,代码行数:25,代码来源:Image.php


示例4: updateRessources

function updateRessources($db, $ressources, $startdate = null, $enddate = null, $GMT = "+1 hour")
{
    if ($startdate == null) {
        $startdate = date("Y-m-d");
    }
    if ($enddate == null) {
        $enddate = date("Y-m-d", strtotime("+30 days"));
    }
    $nb = array();
    foreach ($ressources as $ressource) {
        $ical = new ICal('https://planning.univ-rennes1.fr/jsp/custom/modules/plannings/anonymous_cal.jsp?resources=' . $ressource . '&projectId=1&calType=ical&firstDate=' . $startdate . '&lastDate=' . $enddate);
        $events = $ical->events();
        $insertNb = 0;
        purge_events($db, $ressource);
        if ($events) {
            foreach ($events as $event) {
                $export_d = date("Y/m/d H:i:s", strtotime($GMT, $ical->iCalDateToUnixTimestamp($event['DTSTAMP'])));
                $start_d = date("Y-m-d", strtotime($GMT, $ical->iCalDateToUnixTimestamp($event['DTSTART'])));
                $start_t = date("H:i:s", strtotime($GMT, $ical->iCalDateToUnixTimestamp($event['DTSTART'])));
                $end_d = date("Y-m-d", strtotime($GMT, $ical->iCalDateToUnixTimestamp($event['DTEND'])));
                $end_t = date("H:i:s", strtotime($GMT, $ical->iCalDateToUnixTimestamp($event['DTEND'])));
                $description = desc2json($event['DESCRIPTION']);
                $req = $db->prepare('insert into events (UID,ressource, StartDate, StartTime, EndDate, EndTime, Title, Location, Description,Export) VALUES (?,?,?,?,?,?,?,?,?,?)');
                $res = $req->execute(array(issetor($event['UID']), $ressource, $start_d, $start_t, $end_d, $end_t, $event['SUMMARY'], issetor($event['LOCATION']), $description, $export_d));
                $insertNb += $res;
            }
        }
        $nb[$ressource] = $insertNb;
    }
    $req = $db->prepare("UPDATE ressources r inner join events e on r.number = e.ressource set r.last_sync = e.Export");
    $req->execute();
    return $nb;
}
开发者ID:IMR18,项目名称:web,代码行数:33,代码来源:functions_ade.php


示例5: invoke

 public function invoke($action = null, $format = null)
 {
     $timerKey = Ajde::app()->addTimer((string) $this->_route);
     $action = issetor($action, $this->getAction());
     $format = issetor($format, $this->getFormat());
     $emptyFunction = $action;
     $defaultFunction = $action . "Default";
     $formatFunction = $action . ucfirst($format);
     if (method_exists($this, $formatFunction)) {
         $actionFunction = $formatFunction;
     } elseif (method_exists($this, $defaultFunction)) {
         $actionFunction = $defaultFunction;
     } elseif (method_exists($this, $emptyFunction)) {
         $actionFunction = $emptyFunction;
     } else {
         $exception = new Ajde_Exception(sprintf("Action %s for module %s not found", $this->getAction(), $this->getModule()), 90011);
         Ajde::routingError($exception);
     }
     $return = true;
     if (method_exists($this, 'beforeInvoke')) {
         $return = $this->beforeInvoke();
         if ($return !== true && $return !== false) {
             // TODO:
             throw new Ajde_Exception(sprintf("beforeInvoke() must return either TRUE or FALSE"));
         }
     }
     if ($return === true) {
         $return = $this->{$actionFunction}();
         if (method_exists($this, 'afterInvoke')) {
             $this->afterInvoke();
         }
     }
     Ajde::app()->endTimer($timerKey);
     return $return;
 }
开发者ID:nabble,项目名称:updatemybrowser-v1,代码行数:35,代码来源:Controller.php


示例6: validate

 public function validate($options = array())
 {
     $fieldsArray = $this->_model->getTable()->getFieldProperties();
     $fieldOptions = array();
     foreach ($fieldsArray as $fieldName => $fieldProperties) {
         $fieldOptions[$fieldName] = array_merge($fieldProperties, issetor($options[$fieldName], array()));
     }
     $valid = true;
     $errors = array();
     $this->_initValidators($fieldOptions);
     foreach ($this->_model->getValidators() as $fieldName => $fieldValidators) {
         foreach ($fieldValidators as $fieldValidator) {
             /* @var $validator Ajde_Model_ValidatorAbstract */
             $value = null;
             if ($this->_model->has($fieldName)) {
                 $value = $this->_model->get($fieldName);
             }
             $result = $fieldValidator->validate($fieldOptions[$fieldName], $value);
             if ($result['valid'] === false) {
                 if (!isset($errors[$fieldName])) {
                     $errors[$fieldName] = array();
                 }
                 $errors[$fieldName][] = $result['error'];
                 $valid = false;
             }
         }
     }
     $this->_errors = $errors;
     return $valid;
 }
开发者ID:nabble,项目名称:updatemybrowser-v1,代码行数:30,代码来源:Validator.php


示例7: _initValidators

 private function _initValidators($fieldOptions)
 {
     foreach ($fieldOptions as $fieldName => $fieldProperties) {
         switch (issetor($fieldProperties['type'])) {
             case Db::FIELD_TYPE_DATE:
                 $this->_model->addValidator($fieldName, new Date());
                 break;
             case 'sort':
             case Db::FIELD_TYPE_NUMERIC:
                 $this->_model->addValidator($fieldName, new Numeric());
                 break;
             case Db::FIELD_TYPE_TEXT:
                 $this->_model->addValidator($fieldName, new Text());
                 break;
             case Db::FIELD_TYPE_ENUM:
                 $this->_model->addValidator($fieldName, new Enum());
                 break;
             case Db::FIELD_TYPE_SPATIAL:
                 $this->_model->addValidator($fieldName, new Spatial());
                 break;
             default:
                 break;
         }
         if (issetor($fieldProperties['isRequired']) === true && issetor($fieldProperties['default']) == '') {
             $this->_model->addValidator($fieldName, new Required());
         }
         if (issetor($fieldProperties['isUnique']) === true) {
             $this->_model->addValidator($fieldName, new Unique());
         }
     }
 }
开发者ID:nabble,项目名称:ajde-core,代码行数:31,代码来源:Validator.php


示例8: execute

 /**
  * When execute is called record the time it takes and
  * then log the query.
  *
  * @param array $input_parameters
  *
  * @throws Ajde_Db_Exception
  * @throws Ajde_Exception
  *
  * @return PDO result set
  */
 public function execute($input_parameters = null)
 {
     $log = ['query' => ''];
     if (config('app.debug') === true) {
         //$cache = Ajde_Db_Cache::getInstance();
         if (count($input_parameters)) {
             $log = ['query' => vsprintf(str_replace('?', '%s', $this->queryString), $input_parameters)];
         } else {
             $log = ['query' => '[PS] ' . $this->queryString];
         }
         // add backtrace
         $i = 0;
         $source = [];
         foreach (array_reverse(debug_backtrace()) as $item) {
             try {
                 $line = issetor($item['line']);
                 $file = issetor($item['file']);
                 $source[] = sprintf('%s. <em>%s</em>%s<strong>%s</strong> (%s on line %s)', $i, !empty($item['class']) ? $item['class'] : '&lt;unknown class&gt;', !empty($item['type']) ? $item['type'] : '::', !empty($item['function']) ? $item['function'] : '&lt;unknown function&gt;', $file, $line);
             } catch (Exception $e) {
             }
             $i++;
         }
         $hash = md5(implode('', $source) . microtime());
         $log['query'] = '<a href="javascript:void(0)" onclick="$(\'#' . $hash . '\').slideToggle(\'fast\');" style="color: black;">' . $log['query'] . '</a>';
         $log['query'] .= '<div id="' . $hash . '" style="display: none;">' . implode('<br/>', $source) . '</div>';
     }
     // start timer
     $start = microtime(true);
     try {
         //if (!$cache->has($this->queryString . serialize($input_parameters))) {
         $result = parent::execute($input_parameters);
         //$cache->set($this->queryString . serialize($input_parameters), $result);
         //	$log['cache'] = false;
         //} else {
         //	$result = $cache->get($this->queryString . serialize($input_parameters));
         //	$log['cache'] = true;
         //}
     } catch (Exception $e) {
         if (substr_count(strtolower($e->getMessage()), 'integrity constraint violation')) {
             throw new Ajde_Db_IntegrityException($e->getMessage());
         } else {
             if (config('app.debug') === true) {
                 if (isset($this->queryString)) {
                     dump($this->queryString);
                 }
                 dump('Go to ' . config('app.rootUrl') . '?install=1 to install DB');
                 throw new Ajde_Db_Exception($e->getMessage());
             } else {
                 Ajde_Exception_Log::logException($e);
                 die('DB connection problem. <a href="?install=1">Install database?</a>');
             }
         }
     }
     $time = microtime(true) - $start;
     $log['time'] = round($time * 1000, 0);
     Ajde_Db_PDO::$log[] = $log;
     return $result;
 }
开发者ID:nabble,项目名称:ajde,代码行数:69,代码来源:PDOStatement.php


示例9: getLinkTemplateFilename

 public static function getLinkTemplateFilename($type, $format = 'null')
 {
     if (Ajde::app()->getDocument()->hasLayout()) {
         $layout = Ajde::app()->getDocument()->getLayout();
     } else {
         $layout = new Ajde_Layout(Config::get("layout"));
     }
     $format = issetor($format, 'html');
     return LAYOUT_DIR . $layout->getName() . '/link/' . $type . '.' . $format . '.php';
 }
开发者ID:nabble,项目名称:updatemybrowser-v1,代码行数:10,代码来源:Resource.php


示例10: formUploadHtml

 public function formUploadHtml()
 {
     $options = $this->getOptions();
     $optionsId = md5(serialize($options));
     $session = new Ajde_Session('AC.Form');
     $session->set($optionsId, $options);
     $this->setAction('form/upload');
     $this->getView()->assign('name', $this->getName());
     $this->getView()->assign('optionsId', $optionsId);
     $this->getView()->assign('optionsMultiple', issetor($options['multiple'], false));
     $this->getView()->assign('inputId', $this->getInputId());
     $this->getView()->assign('extraClass', $this->getExtraClass());
     return $this->render();
 }
开发者ID:nabble,项目名称:updatemybrowser-v1,代码行数:14,代码来源:_coreComponentController.php


示例11: dump

 public static function dump($var, $collapse = false)
 {
     $i = 0;
     $line = null;
     foreach (debug_backtrace() as $item) {
         $source = sprintf("%s. dumped from <em>%s</em>%s<strong>%s</strong> (line %s)", count(self::$dump) + 1, !empty($item['class']) ? $item['class'] : '&lt;unknown class&gt; (in <span style=\'font-size: 0.8em;\'>' . $item['args'][0] . '</span>)', !empty($item['type']) ? $item['type'] : '::', !empty($item['function']) ? $item['function'] : '&lt;unknown function&gt;', $line);
         $line = issetor($item['line'], null);
         if ($i == 2) {
             break;
         }
         $i++;
     }
     self::$dump[$source] = array($var, $collapse);
 }
开发者ID:nabble,项目名称:updatemybrowser-v1,代码行数:14,代码来源:Dump.php


示例12: process

 public function process()
 {
     //		TODO: check for required attributes
     //		if (!array_key_exists('library', $this->attributes) || !array_key_exists('version', $this->attributes)) {
     //			throw new Ajde_Component_Exception();
     //		}
     if (array_key_exists('library', $this->attributes)) {
         $this->requireJsLibrary($this->attributes['library'], $this->attributes['version']);
     } elseif (array_key_exists('action', $this->attributes)) {
         $this->requireResource(Ajde_Resource_Local::TYPE_JAVASCRIPT, $this->attributes['action'], issetor($this->attributes['format'], null), issetor($this->attributes['base'], null), issetor($this->attributes['position'], null), issetor($this->attributes['arguments'], ''));
     } elseif (array_key_exists('filename', $this->attributes)) {
         $this->requirePublicResource(Ajde_Resource_Local::TYPE_JAVASCRIPT, $this->attributes['filename'], issetor($this->attributes['position'], null), issetor($this->attributes['arguments'], ''));
     } elseif (array_key_exists('url', $this->attributes)) {
         $this->requireRemoteResource(Ajde_Resource_Local::TYPE_JAVASCRIPT, $this->attributes['url'], issetor($this->attributes['position'], null), issetor($this->attributes['arguments'], ''));
     }
 }
开发者ID:nabble,项目名称:ajde,代码行数:16,代码来源:Js.php


示例13: process

 public function process()
 {
     switch ($this->_attributeParse()) {
         case 'local':
             $this->requireResource(Ajde_Resource_Local::TYPE_STYLESHEET, $this->attributes['action'], issetor($this->attributes['format'], null), issetor($this->attributes['base'], null), issetor($this->attributes['position'], null), issetor($this->attributes['arguments'], ''));
             break;
         case 'public':
             $this->requirePublicResource(Ajde_Resource_Local::TYPE_STYLESHEET, $this->attributes['filename'], issetor($this->attributes['position'], null), issetor($this->attributes['arguments'], ''));
             break;
         case 'font':
             $url = Ajde_Resource_GWebFont::getUrl($this->attributes['fontFamily'], issetor($this->attributes['fontWeight'], array(400)), issetor($this->attributes['fontSubset'], array('latin')));
             $resource = new Ajde_Resource_Remote(Ajde_Resource::TYPE_STYLESHEET, $url);
             $this->getParser()->getDocument()->addResource($resource, Ajde_Document_Format_Html::RESOURCE_POSITION_TOP);
             break;
     }
 }
开发者ID:nabble,项目名称:updatemybrowser-v1,代码行数:16,代码来源:Css.php


示例14: dump

 public static function dump($var, $expand = true)
 {
     $i = 0;
     $line = null;
     foreach (debug_backtrace() as $item) {
         try {
             $source = sprintf('%s. dumped from <em>%s</em>%s<strong>%s</strong> (line %s)', count(self::$dump) + 1, isset($item['class']) ? is_object($item['class']) ? get_class($item['class']) : $item['class'] : '&lt;unknown class&gt; (in <span style=\'font-size: 0.8em;\'>' . print_r($item['args'][0]) . '</span>)', !empty($item['type']) ? $item['type'] : '::', !empty($item['function']) ? $item['function'] : '&lt;unknown function&gt;', $line);
             $line = issetor($item['line'], null);
         } catch (Exception $e) {
         }
         if ($i == 2) {
             break;
         }
         $i++;
     }
     self::$dump[$source] = [$var, $expand];
 }
开发者ID:nabble,项目名称:ajde,代码行数:17,代码来源:Dump.php


示例15: getLinkTemplateFilename

 public static function getLinkTemplateFilename($type, $format = 'null')
 {
     if (Ajde::app()->getDocument()->hasLayout()) {
         $layout = Ajde::app()->getDocument()->getLayout();
     } else {
         $layout = new Ajde_Layout(config('layout.frontend'));
     }
     $format = issetor($format, 'html');
     $dirPrefixPatterns = [APP_DIR, CORE_DIR];
     foreach ($dirPrefixPatterns as $dirPrefixPattern) {
         $prefixedLayout = $dirPrefixPattern . LAYOUT_DIR;
         if (self::exist($prefixedLayout . $layout->getName() . '/link/' . $type . '.' . $format . '.php')) {
             return $prefixedLayout . $layout->getName() . '/link/' . $type . '.' . $format . '.php';
         }
     }
     return false;
 }
开发者ID:nabble,项目名称:ajde,代码行数:17,代码来源:Resource.php


示例16: process

 public function process()
 {
     switch ($this->_attributeParse()) {
         case 'render':
             $image = new Image($this->attributes['filename']);
             $image->setWidth($this->attributes['width']);
             $image->setHeight($this->attributes['height']);
             $image->setCrop(String::toBoolean($this->attributes['crop']));
             $controller = Controller::fromRoute(new Route('_core/component:imageBase64'));
             $controller->setImage($image);
             $controller->setWidth(issetor($this->attributes['width'], null));
             $controller->setHeight(issetor($this->attributes['height'], null));
             $controller->setExtraClass(issetor($this->attributes['class'], ''));
             return $controller->invoke();
             break;
     }
     // TODO:
     throw new Exception('Missing required attributes for component call');
 }
开发者ID:nabble,项目名称:ajde-core,代码行数:19,代码来源:Embed.php


示例17: process

 public function process()
 {
     switch ($this->_attributeParse()) {
         case 'form':
             $controller = Ajde_Controller::fromRoute(new Ajde_Core_Route('_core/component:form'));
             $controller->setFormAction($this->attributes['route']);
             $controller->setFormId(issetor($this->attributes['id'], spl_object_hash($this)));
             $controller->setExtraClass(issetor($this->attributes['class'], ''));
             $controller->setInnerXml($this->innerXml);
             return $controller->invoke();
             break;
         case 'ajax':
             $controller = Ajde_Controller::fromRoute(new Ajde_Core_Route('_core/component:formAjax'));
             $formAction = new Ajde_Core_Route($this->attributes['route']);
             $formAction->setFormat(issetor($this->attributes['format'], 'json'));
             $controller->setFormAction($formAction->__toString());
             $controller->setFormFormat(issetor($this->attributes['format'], 'json'));
             $controller->setFormId(issetor($this->attributes['id'], spl_object_hash($this)));
             $controller->setExtraClass(issetor($this->attributes['class'], ''));
             $controller->setInnerXml($this->innerXml);
             return $controller->invoke();
             break;
         case 'upload':
             $controller = Ajde_Controller::fromRoute(new Ajde_Core_Route('_core/component:formUpload'));
             if (!isset($this->attributes['options']) || !isset($this->attributes['options']['saveDir']) || !isset($this->attributes['options']['extensions'])) {
                 // TODO:
                 throw new Ajde_Component_Exception('Options saveDir and extensions must be set for AC.Form.Upload');
             }
             $controller->setName($this->attributes['name']);
             $controller->setOptions($this->attributes['options']);
             $controller->setInputId(issetor($this->attributes['id'], spl_object_hash($this)));
             $controller->setExtraClass(issetor($this->attributes['class'], ''));
             return $controller->invoke();
             break;
         case 'embed':
             $controller = Ajde_Controller::fromRoute(new Ajde_Core_Route('form/view.html'));
             $controller->setId($this->attributes['id']);
             return $controller->invoke();
             break;
     }
     // TODO:
     throw new Ajde_Component_Exception();
 }
开发者ID:nabble,项目名称:ajde,代码行数:43,代码来源:Form.php


示例18: process

 public function process()
 {
     switch ($this->_attributeParse()) {
         case 'list':
             $options = issetor($this->attributes['options'], array());
             $crud = new Ajde_Crud($this->attributes['model'], $options);
             $crud->setAction('list');
             return $crud;
             break;
         case 'edit':
             $options = issetor($this->attributes['options'], array());
             $id = issetor($this->attributes['id'], null);
             $crud = new Ajde_Crud($this->attributes['model'], $options);
             $crud->setId($id);
             $crud->setAction('edit');
             return $crud;
             break;
     }
     // TODO:
     throw new Ajde_Component_Exception();
 }
开发者ID:nabble,项目名称:updatemybrowser-v1,代码行数:21,代码来源:Crud.php


示例19: save

 public function save()
 {
     // check all changed fields
     $modelName = get_class($this);
     $shadowModel = new $modelName();
     /* @var $shadowModel Ajde_Model */
     $shadowModel->loadByPK($this->getPK());
     if ($shadowModel->_hasMeta) {
         $shadowModel->populateMeta();
     }
     // old values
     $oldValues = $shadowModel->values();
     foreach ($oldValues as &$oldValue) {
         @($oldValue = (string) $oldValue);
     }
     // populate meta of current model, but don't override
     if ($this->_hasMeta) {
         $this->populateMeta(false, false);
     }
     // new values
     $newValues = $this->values();
     foreach ($newValues as $k => &$newValue) {
         if ($k == 'meta_4') {
             //                die('hier');
         }
         @($newValue = (string) $newValue);
     }
     // ignore fields
     foreach ($this->_ignoreFieldInRevision as $ignoreField) {
         unset($oldValues[$ignoreField]);
         unset($newValues[$ignoreField]);
     }
     // ignore fields
     foreach ($this->_ignoreFieldInRevisionIfEmpty as $ignoreField) {
         if (!isset($newValues[$ignoreField]) || empty($newValues[$ignoreField])) {
             unset($oldValues[$ignoreField]);
             unset($newValues[$ignoreField]);
         }
     }
     if ($diffs = array_diff_assoc($oldValues, $newValues)) {
         foreach ($diffs as $diffField => $diffValue) {
             $revision = new RevisionModel();
             $revision->model = $this->getModelName();
             $revision->foreignkey = $this->getPK();
             $revision->user = UserModel::getLoggedIn();
             $revision->field = $diffField;
             $revision->old = issetor($oldValues[$diffField]);
             $revision->new = issetor($newValues[$diffField]);
             $revision->insert();
         }
     }
     return parent::save();
 }
开发者ID:nabble,项目名称:ajde-core,代码行数:53,代码来源:Revision.php


示例20: update

 function update($p)
 {
     $permSet = array();
     if (!empty($p['pm'])) {
         foreach ($p['pm'] as $k => $v) {
             $permSet[$k] = $v == 'on' ? true : cInt($v);
         }
     }
     $this->id = isPostor('id');
     $this->acr = cInt(isPostor('acr', 0));
     $this->acw = cInt(isPostor('acw', 0));
     if (!isset($permSet['esv.def']) && !isset($permSet['ews.def'])) {
         $permSet['esv.def'] = true;
     }
     if ($this->id == 1) {
         $this->acr = 99;
         $this->acw = 99;
         $adm = array('esv.def' => issetor($permSet['esv.def'], false), 'ews.def' => issetor($permSet['ews.def'], false));
         $permSet = $adm;
     }
     $this->name = trim(isPostor('name'));
     $this->desc = isPostor('desc');
     $this->props["pm"] = $permSet;
     if (empty($this->name)) {
         gzClient::begin()->eAlert("Error:!Name is not empty...")->send();
     }
     $data = array('userg_name' => $this->name, 'userg_description' => $this->desc, 'userg_acr' => $this->acr, 'userg_acw' => $this->acw, 'rec_update' => NOW, 'userg_props' => json_encode($this->props));
     if (empty($this->id)) {
         $data['rec_update'] = NOW;
         $data['rec_create'] = NOW;
         g::DB()->aInsert($data, 'sg_user_group');
     } else {
         g::DB()->aUpdate($data, 'sg_user_group', 'userg_id', $this->id);
         g::cacheSet('UGROUP' . $this->id, $this);
     }
     //gzData::uGroupInfo(true);
     gzClient::begin()->redirect("cpanel.usergroup")->endSend();
 }
开发者ID:phone1246,项目名称:mikrotik,代码行数:38,代码来源:gzUser.php



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP isteacher函数代码示例发布时间:2022-05-15
下一篇:
PHP isset_request_var函数代码示例发布时间:2022-05-15
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap