本文整理汇总了PHP中modObjectUpdateProcessor::initialize方法的典型用法代码示例。如果您正苦于以下问题:PHP modObjectUpdateProcessor::initialize方法的具体用法?PHP modObjectUpdateProcessor::initialize怎么用?PHP modObjectUpdateProcessor::initialize使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类modObjectUpdateProcessor
的用法示例。
在下文中一共展示了modObjectUpdateProcessor::initialize方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: initialize
/** {@inheritDoc} */
public function initialize()
{
if (!$this->modx->hasPermission($this->permission)) {
return $this->modx->lexicon('access_denied');
}
$this->userprofile2 = $this->modx->userprofile2;
$this->userprofile2->initialize($this->modx->context->key);
$this->config = $this->userprofile2->config;
// get data
$data = $this->getProperty('data');
if (empty($data)) {
return $this->success();
}
$data = $this->modx->fromJSON($data);
if (!($this->type = $data['type'])) {
echo $this->userprofile2->error('up2_type_profile_err');
exit;
}
// get properties
if (isset($data['form_key'])) {
$formKey = $data['form_key'];
}
if (!empty($formKey) && isset($_SESSION['up2form'][$formKey])) {
$this->config = array_merge($this->config, $_SESSION['up2form'][$formKey]);
}
$this->ctx = $this->config['ctx'];
return parent::initialize();
}
示例2: initialize
/** {@inheritDoc} */
public function initialize()
{
if (!$this->modx->hasPermission($this->permission)) {
return $this->modx->lexicon('access_denied');
}
return parent::initialize();
}
示例3: initialize
public function initialize()
{
if (!$this->getProperty('username')) {
return 'Не указан пользователь';
}
return parent::initialize();
}
示例4: initialize
/** {@inheritDoc} */
public function initialize()
{
/** @var mlmsystem $mlmsystem */
$this->MlmSystem = $this->modx->getService('mlmsystem');
$this->MlmSystem->initialize($this->getProperty('context', $this->modx->context->key));
return parent::initialize();
}
示例5: initialize
public function initialize()
{
$user_code = $this->getProperty('user_code');
//check if code not empty
if (empty($user_code) or $user_code == '') {
return $this->modx->lexicon('ep_sms_code_is_empty');
}
$query = $this->modx->newQuery('epValidateNum');
/*get row with select all from max row with max createdon */
$query->select('id as id,createdon as createdon,code as code,validate as validate,phone as phone');
$query->limit(1);
$query->sortby('createdon', 'desc');
$query->where(array('user_id:=' => $this->modx->user->id));
//get data array
if ($query->prepare() && $query->stmt->execute()) {
$this->data = $query->stmt->fetch(PDO::FETCH_ASSOC);
}
//check for current code validate status for this user
if ($this->data['validate'] == 1) {
return $this->modx->lexicon('ep_sms_validate_already_done');
}
//if code is correct - set update time and validate status
if ($this->data['code'] == $user_code) {
$this->setProperties(array('validate' => 1, 'updatedon' => date('Y-m-d H:i:s'), 'id' => $this->data['id']));
} else {
return $this->modx->lexicon('ep_sms_check_code_wrong');
}
return parent::initialize();
}
示例6: initialize
public function initialize()
{
// Sanitize post data
$this->unsetProperty('comments_count');
//$this->unsetProperty('createdon');
$this->unsetProperty('editedon');
if (!($thread_id = (int) $this->getProperty('thread_id'))) {
/*
Если не была получена ветка, то пытаемся ее создать
*/
if (!($response = $this->modx->runProcessor('society/web/threads/get', array("target_id" => $this->getProperty("target_id"), "target_class" => $this->getProperty("target_class", "modResource")), array("processors_path" => dirname(dirname(dirname(dirname(__FILE__)))) . '/')))) {
$error = "Ошибка выполнения запроса";
$this->modx->log(xPDO::LOG_LEVEL_ERROR, "[- " . __CLASS__ . " -] {$error}");
$this->modx->log(xPDO::LOG_LEVEL_ERROR, "[- " . __CLASS__ . " -] " . print_r($this->getProperties(), true));
return $error;
}
// else
if ($response->isError() or !($thread_data = $response->getObject())) {
if (!($error = $response->getMessage())) {
$error = "Не были получены данные ветви диалога";
}
$this->modx->log(xPDO::LOG_LEVEL_ERROR, "[- " . __CLASS__ . " -] {$error}");
$this->modx->log(xPDO::LOG_LEVEL_ERROR, "[- " . __CLASS__ . " -] " . print_r($response->getResponse(), true));
$this->modx->log(xPDO::LOG_LEVEL_ERROR, "[- " . __CLASS__ . " -] " . print_r($this->getProperties(), true));
return $error;
}
//else
$thread_id = $thread_data['id'];
}
$this->setProperty('id', $thread_id);
return parent::initialize();
}
示例7: initialize
public function initialize()
{
if (!(int) $this->getProperty('id')) {
return "Не был получен id документа";
}
return parent::initialize();
}
示例8: initialize
public function initialize()
{
if (!($id = (int) $this->getProperty('order_id'))) {
return 'Не был получен ID заявки';
}
$this->setProperty('id', $id);
return parent::initialize();
}
示例9: initialize
/**
* {@inheritDoc}
* @return boolean
*/
public function initialize()
{
$name = $this->getProperty('name');
if (empty($name)) {
$this->addFieldError('name', $this->modx->lexicon('virtunewsletter.category_err_ns_name'));
}
return parent::initialize();
}
示例10: initialize
public function initialize()
{
$data = $this->getProperty('data');
if ($data = $this->modx->fromJSON($data)) {
$this->properties = $data;
}
return parent::initialize();
}
示例11: initialize
public function initialize()
{
if (!($order_id = (int) $this->getProperty('order_id'))) {
return 'Не был указан ID заказа';
}
// else
$this->setProperty('id', $order_id);
return parent::initialize();
}
示例12: initialize
public function initialize()
{
if (!($user_id = (int) $this->getProperty('user_id'))) {
return "Не был получен ID пользователя";
}
// else
$this->setProperty('id', $user_id);
return parent::initialize();
}
示例13: initialize
/** {@inheritDoc} */
public function initialize()
{
if (!$this->modx->hasPermission($this->permission)) {
return $this->modx->lexicon('access_denied');
}
if ($Event = $this->modx->getObject('vpEvent', $this->getProperty('id'))) {
$this->nameEvent = $Event->get('name');
}
return parent::initialize();
}
示例14: initialize
public function initialize()
{
$editedById = $this->getProperty('id');
$this->modx->log(modX::LOG_LEVEL_DEBUG, 'id is: ' . $editedById);
$this->setProperty('editedby', $editedById);
$this->setProperty('editedby_name', $this->getUserName($editedById));
$this->modx->log(modX::LOG_LEVEL_DEBUG, 'fullname is: ' . $this->getProperty('editedby_name'));
$this->setEditTime();
return parent::initialize();
}
示例15: initialize
/** {@inheritDoc} */
public function initialize()
{
if (!$this->modx->hasPermission($this->permission)) {
return $this->modx->lexicon('access_denied');
}
/** @var mlmsystem $mlmsystem */
$this->MlmSystem = $this->modx->getService('mlmsystem');
$this->MlmSystem->initialize($this->getProperty('context', $this->modx->context->key));
return parent::initialize();
}