本文整理汇总了PHP中xPDOObject::get方法的典型用法代码示例。如果您正苦于以下问题:PHP xPDOObject::get方法的具体用法?PHP xPDOObject::get怎么用?PHP xPDOObject::get使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类xPDOObject
的用法示例。
在下文中一共展示了xPDOObject::get方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: prepareRow
public function prepareRow(xPDOObject $object)
{
$objectArray = $object->toArray();
$objectArray['sender_name'] = $object->get('sender_username');
$objectArray['read'] = $object->get('read') ? true : false;
return $objectArray;
}
示例2: prepareRow
public function prepareRow(xPDOObject $object)
{
$core = array('Resource', 'Object', 'Administrator', 'Load Only', 'Load, List and View');
$policyArray = $object->toArray();
$permissions = array();
$cls = 'pedit';
if (!in_array($object->get('name'), $core)) {
$cls .= ' premove';
}
$policyArray['cls'] = $cls;
if (!empty($policyArray['total_permissions'])) {
$data = $object->get('data');
$ct = 0;
if (!empty($data)) {
foreach ($data as $k => $v) {
if (!empty($v)) {
$permissions[] = $k;
$ct++;
}
}
}
$policyArray['active_permissions'] = $ct;
$policyArray['active_of'] = $this->modx->lexicon('active_of', array('active' => $policyArray['active_permissions'], 'total' => $policyArray['total_permissions']));
$policyArray['permissions'] = $permissions;
}
unset($policyArray['data']);
return $policyArray;
}
示例3: prepareRow
public function prepareRow(xPDOObject $object)
{
$fields = array_map('trim', explode(',', $this->modx->getOption('ms2_order_product_fields', null, '')));
$fields = array_values(array_unique(array_merge($fields, array('id', 'product_id', 'product_pagetitle'))));
$data = array();
foreach ($fields as $v) {
$data[$v] = $object->get($v);
if ($v == 'product_price' || $v == 'product_old_price') {
$data[$v] = round($data[$v], 2);
} else {
if ($v == 'product_weight') {
$data[$v] = round($data[$v], 3);
}
}
}
$options = $object->get('options');
if (!empty($options) && is_array($options)) {
$tmp = array();
foreach ($options as $k => $v) {
$tmp[] = $this->modx->lexicon('ms2_' . $k) . ': ' . $v;
$data['option_' . $k] = $v;
}
$data['options'] = implode('; ', $tmp);
}
return $data;
}
示例4: prepareRow
public function prepareRow(xPDOObject $object)
{
$objectArray = $object->toArray();
$objectArray['name'] = $object->get('name') . ' - ' . $object->get('authority');
$objectArray['id'] = $object->get('authority');
return $objectArray;
}
示例5: prepareRow
/** {@inheritDoc} */
public function prepareRow(xPDOObject $object)
{
if ($this->getProperty('combo')) {
$array = array('id' => $object->get('id'), 'pagetitle' => $object->get('pagetitle'));
} else {
$array = $object->toArray();
}
return $array;
}
示例6: prepareRow
/** {@inheritDoc} */
public function prepareRow(xPDOObject $object)
{
if ($this->getProperty('combo')) {
$array = array('id' => $object->get('id'), 'name' => '(' . $object->id . ') ' . $object->get('templatename'));
} else {
$array = $object->toArray();
}
return $array;
}
示例7: prepareRow
/** {@inheritDoc} */
public function prepareRow(xPDOObject $object)
{
if ($this->getProperty('combo')) {
$array = array('name' => $this->modx->lexicon('mlmsystem_class_' . $object->get('class')), 'value' => $object->get('class'));
} else {
$array = $object->toArray();
}
return $array;
}
示例8: prepareRow
/**
* {@inheritdoc}
* @param xPDOObject $object
* @return array|mixed
*/
public function prepareRow(xPDOObject $object)
{
$tvArray = $object->get(array('id', 'name', 'description', 'tv_rank', 'category_name'));
$tvArray['access'] = (bool) $object->get('access');
$tvArray['perm'] = array();
if ($this->modx->hasPermission('edit_tv')) {
$tvArray['perm'][] = 'pedit';
}
return $tvArray;
}
示例9: prepareRow
public function prepareRow(xPDOObject $object)
{
$arr = $object->toArray();
$arr['pagetitle'] .= ' (' . $object->get('context_key') . ', ' . $object->get('id') . ')';
// figure out if resource is a site-start resource
$siteStart = $this->modx->getObject('modSystemSetting', array('key' => 'site_start', 'value' => $object->get('id')));
if (empty($siteStart)) {
$siteStart = $this->modx->getObject('modContextSetting', array('key' => 'site_start', 'value' => $object->get('id'), 'context_key' => $object->get('context_key')));
}
$arr['site_start'] = !empty($siteStart) && is_object($siteStart) ? true : false;
return $arr;
}
示例10: prepareRow
public function prepareRow(xPDOObject $object)
{
$objectArray = $object->toArray();
$isCoreRole = $object->get('id') == 1 || $object->get('id') == 2 || $object->get('name') == 'Super User' || $object->get('name') == 'Member';
$perm = array();
if (!$isCoreRole) {
$perm[] = 'edit';
if ($this->canRemove) {
$perm[] = 'remove';
}
}
$objectArray['perm'] = implode(' ', $perm);
return $objectArray;
}
示例11: prepareRow
public function prepareRow(xPDOObject $object)
{
$groupId = $object->get('group');
if ($groupId) {
$getGroup = $this->modx->getObject('modxMinifyGroup', $groupId);
if ($getGroup) {
$groupName = $getGroup->get('name');
$object->set('group_name', $groupName);
}
}
$lastmodified = filemtime($this->modx->getOption('base_path') . $object->get('filename'));
$object->set('last_modified', date('Y-m-d H:i:s', $lastmodified));
return parent::prepareRow($object);
}
示例12: prepareRow
public function prepareRow(xPDOObject $object)
{
$arr = $object->toArray();
$arr['failure_msg'] = '';
$arr['valid'] = true;
// find out if pattern URI exists
$criteria = array('uri' => $object->get('pattern'), 'published' => true, 'deleted' => false);
if (!empty($arr['context_key'])) {
$criteria['context_key'] = $object->get('context_key');
}
$resource = $this->modx->getObject('modResource', $criteria);
if (!empty($resource) && is_object($resource)) {
$arr['failure_msg'] .= '(!) ' . $this->modx->lexicon('redirector.pattern') . ' ' . $this->modx->lexicon('redirector.redirect_err_ae_uri', array('id' => $resource->get('id'), 'context' => $resource->get('context_key')));
$arr['valid'] = false;
}
// OR target not exists
$target = $this->getProperty('target');
if (strpos($target, '$') === false) {
// parse link & MODX tags
if (stripos($target, '[[') !== false) {
$this->modx->parser->processElementTags('', $target, true, true);
}
if (!empty($target)) {
// checking full links
if (strpos($target, '://') !== false) {
$headers = @get_headers($target);
if (empty($headers)) {
$this->addFieldError('target', $this->modx->lexicon('redirector.redirect_err_ne_target'));
}
} else {
$criteria = array('uri' => $target);
if (!empty($context)) {
$criteria['context_key'] = $context;
}
$resource = $this->modx->getObject('modResource', $criteria);
if (empty($resource) || !is_object($resource)) {
// check if could be a file?
$basePath = $this->modx->getOption('base_path');
if (!file_exists($basePath . $target)) {
$this->addFieldError('target', $this->modx->lexicon('redirector.redirect_err_ne_target'));
}
}
}
} else {
$this->addFieldError('target', $this->modx->lexicon('redirector.redirect_err_ne_target'));
}
}
return $arr;
}
示例13: prepareRow
/** {@inheritDoc} */
public function prepareRow(xPDOObject $object)
{
if ($this->getProperty('combo')) {
$title = $object->get('title');
if (empty($title)) {
$title = $object->get('name');
} else {
$title = $title . ' (' . $object->get('name') . ')';
}
$array = array('id' => $object->get('id'), 'title' => $object->id . ' - ' . $title);
} else {
$array = $object->toArray();
}
return $array;
}
示例14: prepareRow
/**
* Prepare the row for iteration
* @param xPDOObject $object
* @return array
*/
public function prepareRow(xPDOObject $object)
{
if (!$object->checkPolicy('view')) {
return array();
}
$resourceArray = $object->get(array('id', 'pagetitle', 'description', 'published', 'deleted', 'context_key'));
$resourceArray['menu'] = array();
$resourceArray['menu'][] = array('text' => $this->modx->lexicon('resource_view'), 'params' => array('a' => 'resource/data', 'id' => $object->get('id')));
if ($this->modx->hasPermission('edit_document')) {
$resourceArray['menu'][] = array('text' => $this->modx->lexicon('resource_edit'), 'params' => array('a' => 'resource/update', 'id' => $object->get('id')));
}
$resourceArray['menu'][] = '-';
$resourceArray['menu'][] = array('text' => $this->modx->lexicon('resource_preview'), 'handler' => 'this.preview');
return $resourceArray;
}
示例15: prepareRow
public function prepareRow(xPDOObject $object)
{
$objectArray = $object->toArray();
$constraint = $object->get('constraint');
if (!empty($constraint)) {
$objectArray['constraint_data'] = $object->get('constraint_class') . '.' . $object->get('constraint_field') . ' = ' . $constraint;
}
$objectArray['perm'] = array();
if ($this->canEdit) {
$objectArray['perm'][] = 'pedit';
}
if ($this->canRemove) {
$objectArray['perm'][] = 'premove';
}
return $objectArray;
}