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


PHP unknown_type::getProperties方法代码示例

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


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

示例1: notify

 /**
  * Notify Event Handler
  *
  * @param 	unknown_type $event
  * @access 	public
  */
 function notify($event)
 {
     // Make entity
     $f = owa_coreAPI::entityFactory('base.feed_request');
     $f->load($event->get('guid'));
     if (!$f->wasPersisted()) {
         $f->setProperties($event->getProperties());
         // Set Primary Key
         $f->set('id', $event->get('guid'));
         // Make ua id
         $f->set('ua_id', owa_lib::setStringGuid($event->get('HTTP_USER_AGENT')));
         // Make OS id
         $f->set('os_id', owa_lib::setStringGuid($event->get('os')));
         // Make document id
         $f->set('document_id', owa_lib::setStringGuid($event->get('page_url')));
         // Generate Host id
         $f->set('host_id', owa_lib::setStringGuid($event->get('host')));
         $f->set('subscription_id', $event->get('feed_subscription_id'));
         // Persist to database
         $ret = $f->create();
         if ($ret) {
             $eq = owa_coreAPI::getEventDispatch();
             $nevent = $eq->makeEvent($event->getEventType() . '_persisted');
             $nevent->setProperties($event->getProperties());
             $eq->notify($nevent);
             return OWA_EHS_EVENT_HANDLED;
         } else {
             return OWA_EHS_EVENT_FAILED;
         }
     } else {
         owa_coreAPI::debug('Not persisting. Feed request already exists.');
         return OWA_EHS_EVENT_HANDLED;
     }
 }
开发者ID:nishantmendiratta,项目名称:Open-Web-Analytics,代码行数:40,代码来源:feedRequestHandlers.php

示例2: notify

 /**
  * Notify Event Handler
  *
  * @param 	unknown_type $event
  * @access 	public
  */
 function notify($event)
 {
     $v = owa_coreAPI::entityFactory('base.visitor');
     $v->load($event->get('visitor_id'));
     if (!$v->wasPersisted()) {
         $v->setProperties($event->getProperties());
         // Set Primary Key
         $v->set('id', $event->get('visitor_id'));
         $v->set('first_session_id', $event->get('session_id'));
         $v->set('first_session_year', $event->get('year'));
         $v->set('first_session_month', $event->get('month'));
         $v->set('first_session_day', $event->get('day'));
         $v->set('first_session_dayofyear', $event->get('dayofyear'));
         $v->set('first_session_timestamp', $event->get('timestamp'));
         $ret = $v->create();
         if ($ret) {
             return OWA_EHS_EVENT_HANDLED;
         } else {
             return OWA_EHS_EVENT_FAILED;
         }
     } else {
         owa_coreAPI::debug("Not persisting. Visitor already exists.");
         return OWA_EHS_EVENT_HANDLED;
     }
 }
开发者ID:nishantmendiratta,项目名称:Open-Web-Analytics,代码行数:31,代码来源:visitorHandlers.php

示例3: notify

 /**
  * Notify Event Handler
  *
  * @param 	unknown_type $event
  * @access 	public
  */
 function notify($event)
 {
     // create entity
     $d = owa_coreAPI::entityFactory('base.document');
     // get document id from event
     $id = $event->get('document_id');
     // if no document_id present attempt to make one from the page_url property
     if (!$id) {
         $page_url = $event->get('page_url');
         if ($page_url) {
             $id = $d->generateId($page_url);
         } else {
             owa_coreAPI::debug('Not persisting Document, no page_url or document_id event property found.');
             return OWA_EHS_EVENT_HANDLED;
         }
     }
     $d->load($id);
     if (!$d->wasPersisted()) {
         $d->setProperties($event->getProperties());
         $d->set('url', $event->get('page_url'));
         $d->set('uri', $event->get('page_uri'));
         $d->set('id', $id);
         $ret = $d->create();
         if ($ret) {
             return OWA_EHS_EVENT_HANDLED;
         } else {
             return OWA_EHS_EVENT_FAILED;
         }
     } else {
         owa_coreAPI::debug('Not logging Document, already exists');
         return OWA_EHS_EVENT_HANDLED;
     }
 }
开发者ID:nishantmendiratta,项目名称:Open-Web-Analytics,代码行数:39,代码来源:documentHandlers.php

示例4: notify

 /**
  * Notify Event Handler
  *
  * @param 	unknown_type $event
  * @access 	public
  */
 function notify($event)
 {
     // Make entity
     $f = owa_coreAPI::entityFactory('base.feed_request');
     $f->load($event->get('guid'));
     if (!$f->wasPersisted()) {
         // rekey Feed subscription id tracking code
         // @todo check the wordpress plugin to see if this is even needed
         if (!$event->get('feed_subscription_id')) {
             $event->set('feed_subscription_id', $event->get(owa_coreAPI::getSetting('base', 'feed_subscription_param')));
         }
         // needed??
         $event->set('feed_reader_guid', $event->setEnvGUID());
         // set feedreader flag to true, browser flag to false
         $event->set('is_feedreader', true);
         $event->set('is_browser', false);
         // set params on entity
         $f->setProperties($event->getProperties());
         // Set Primary Key
         $f->set('id', $event->get('guid'));
         // Make ua id
         $f->set('ua_id', owa_lib::setStringGuid($event->get('HTTP_USER_AGENT')));
         // Make OS id
         $f->set('os_id', owa_lib::setStringGuid($event->get('os')));
         // Make document id
         $f->set('document_id', owa_lib::setStringGuid($event->get('page_url')));
         // Generate Host id
         $f->set('host_id', owa_lib::setStringGuid($event->get('host')));
         $f->set('subscription_id', $event->get('feed_subscription_id'));
         // Persist to database
         $ret = $f->create();
         if ($ret) {
             $eq = owa_coreAPI::getEventDispatch();
             $nevent = $eq->makeEvent($event->getEventType() . '_logged');
             $nevent->setProperties($event->getProperties());
             $eq->notify($nevent);
             return OWA_EHS_EVENT_HANDLED;
         } else {
             return OWA_EHS_EVENT_FAILED;
         }
     } else {
         owa_coreAPI::debug('Not persisting. Feed request already exists.');
         return OWA_EHS_EVENT_HANDLED;
     }
 }
开发者ID:ashutoshdev,项目名称:Open-Web-Analytics,代码行数:51,代码来源:feedRequestHandlers.php

示例5: getCMSFields

 /**
  * Create an iterable list of properties to display to end users
  * 
  * @see sapphire/core/model/DataObject#getCMSFields($params)
  */
 public function getCMSFields()
 {
     $fields = new FieldSet(new TabSet("Root", new Tab('Details', new LiteralField("ExternalContentItem_Alert", _t('ExternalContent.REMOTE_ITEM', 'This is a remote content item and therefore cannot be edited')), new LiteralField("ExternalContentItem_LINK", _t('ExternalContent.LINK', '<a target="_blank" href="' . $this->cmisObject->getUrl() . '">View this item</a>')))));
     if ($this->cmisObject) {
         $props = $this->cmisObject->getProperties();
         foreach ($props as $name => $value) {
             $fields->addFieldToTab('Root.Details', new ReadonlyField($name, _t('SeaMistContentItem.' . $name, $name), $value));
         }
     }
     return $fields;
 }
开发者ID:nyeholt,项目名称:silverstripe-cmis-connector,代码行数:16,代码来源:SeaMistContentItem.php

示例6: notify

 /**
  * Notify Event Handler
  *
  * @param 	unknown_type $event
  * @access 	public
  */
 function notify($event)
 {
     $ua = owa_coreAPI::entityFactory('base.ua');
     $ua->getByColumn('id', owa_lib::setStringGuid($event->get('HTTP_USER_AGENT')));
     if (!$ua->get('id')) {
         $ua->setProperties($event->getProperties());
         $ua->set('ua', $event->get('HTTP_USER_AGENT'));
         $ua->set('id', owa_lib::setStringGuid($event->get('HTTP_USER_AGENT')));
         $ret = $ua->create();
         if ($ret) {
             return OWA_EHS_EVENT_HANDLED;
         } else {
             return OWA_EHS_EVENT_FAILED;
         }
     } else {
         owa_coreAPI::debug('not logging, user agent already exists.');
         return OWA_EHS_EVENT_HANDLED;
     }
 }
开发者ID:nishantmendiratta,项目名称:Open-Web-Analytics,代码行数:25,代码来源:userAgentHandlers.php

示例7: notify

 /**
  * Notify Event Handler
  *
  * @param 	unknown_type $event
  * @access 	public
  */
 function notify($event)
 {
     if (!$event->get('host_id')) {
         owa_coreAPI::debug('Nothing to handle. Host id missing from event.');
         return OWA_EHS_EVENT_HANDLED;
     }
     $h = owa_coreAPI::entityFactory('base.host');
     $h->getByPk('id', $event->get('host_id'));
     $id = $h->get('id');
     if (!$id) {
         $h->setProperties($event->getProperties());
         $h->set('id', $event->get('host_id'));
         $ret = $h->create();
         if ($ret) {
             return OWA_EHS_EVENT_HANDLED;
         } else {
             return OWA_EHS_EVENT_FAILED;
         }
     } else {
         owa_coreAPI::debug('Not Persisting. Host already exists.');
         return OWA_EHS_EVENT_HANDLED;
     }
 }
开发者ID:nishantmendiratta,项目名称:Open-Web-Analytics,代码行数:29,代码来源:hostHandlers.php

示例8: notify

 /**
  * Notify Event Handler
  *
  * @param 	unknown_type $event
  * @access 	public
  */
 function notify($event)
 {
     if ($event->get('HTTP_USER_AGENT')) {
         $ua = owa_coreAPI::entityFactory('base.ua');
         $ua->getByColumn('id', owa_lib::setStringGuid($event->get('HTTP_USER_AGENT')));
         if (!$ua->get('id')) {
             $ua->setProperties($event->getProperties());
             $ua->set('ua', $event->get('HTTP_USER_AGENT'));
             $ua->set('id', owa_lib::setStringGuid($event->get('HTTP_USER_AGENT')));
             $ret = $ua->create();
             if ($ret) {
                 return OWA_EHS_EVENT_HANDLED;
             } else {
                 return OWA_EHS_EVENT_FAILED;
             }
         } else {
             $old = $ua->get('browser_type');
             $new = $event->get('browser_type');
             if ($new != $old && $new != 'Default Browser') {
                 $ua->set('browser_type', $new);
                 $ua->set('browser', $event->get('browser'));
                 $ret = $ua->save();
                 if ($ret) {
                     owa_coreAPI::debug('Updating user agent with new browser type: ' . $new);
                     return OWA_EHS_EVENT_HANDLED;
                 } else {
                     return OWA_EHS_EVENT_FAILED;
                 }
             }
             owa_coreAPI::debug('not logging, user agent already exists.');
             return OWA_EHS_EVENT_HANDLED;
         }
     } else {
         owa_coreAPI::debug('not logging, no user agent present.');
         return OWA_EHS_EVENT_HANDLED;
     }
 }
开发者ID:ashutoshdev,项目名称:Open-Web-Analytics,代码行数:43,代码来源:userAgentHandlers.php


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