Пример #1
0
 function __construct()
 {
     $this->setTableName('domstream');
     // set common fact table columns
     $parent_columns = parent::__construct();
     foreach ($parent_columns as $pcolumn) {
         $this->setProperty($pcolumn);
     }
     // move to abstract
     //$this->properties['id'] = new owa_dbColumn;
     //$this->properties['id']->setDataType(OWA_DTD_BIGINT);
     //$this->properties['id']->setPrimaryKey();
     // move to abstract
     //$visitor_id = new owa_dbColumn('visitor_id', OWA_DTD_BIGINT);
     //$visitor_id->setForeignKey('base.visitor');
     //$this->setProperty($visitor_id);
     // move to abstract
     //$session_id = new owa_dbColumn('session_id', OWA_DTD_BIGINT);
     //$session_id->setForeignKey('base.session');
     //$this->setProperty($session_id);
     $document_id = new owa_dbColumn('document_id', OWA_DTD_BIGINT);
     $document_id->setForeignKey('base.document');
     $this->setProperty($document_id);
     // move to abstract
     //$site_id = new owa_dbColumn('site_id', OWA_DTD_VARCHAR255);
     //$site_id->setForeignKey('base.site', 'site_id');
     //$this->setProperty($site_id);
     $domstream_guid = new owa_dbColumn('domstream_guid', OWA_DTD_BIGINT);
     $this->setProperty($domstream_guid);
     $this->properties['events'] = new owa_dbColumn();
     $this->properties['events']->setDataType(OWA_DTD_BLOB);
     $this->properties['duration'] = new owa_dbColumn();
     $this->properties['duration']->setDataType(OWA_DTD_INT);
     // move to abstract
     //$this->properties['timestamp'] = new owa_dbColumn;
     //$this->properties['timestamp']->setDataType(OWA_DTD_INT);
     // move to abstract
     //$this->properties['yyyymmdd'] = new owa_dbColumn;
     //$this->properties['yyyymmdd']->setDataType(OWA_DTD_INT);
     // needed?
     $this->properties['page_url'] = new owa_dbColumn();
     $this->properties['page_url']->setDataType(OWA_DTD_VARCHAR255);
 }
 function __construct()
 {
     $this->setTableName('action_fact');
     // set common fact table columns
     $parent_columns = parent::__construct();
     foreach ($parent_columns as $pcolumn) {
         $this->setProperty($pcolumn);
     }
     $document_id = new owa_dbColumn('document_id', OWA_DTD_BIGINT);
     $document_id->setForeignKey('base.document');
     $this->setProperty($document_id);
     $action_name = new owa_dbColumn('action_name', OWA_DTD_VARCHAR255);
     $this->setProperty($action_name);
     $action_label = new owa_dbColumn('action_label', OWA_DTD_VARCHAR255);
     $this->setProperty($action_label);
     $action_group = new owa_dbColumn('action_group', OWA_DTD_VARCHAR255);
     $this->setProperty($action_group);
     $numeric_value = new owa_dbColumn('numeric_value', OWA_DTD_INT);
     $this->setProperty($numeric_value);
 }
Пример #3
0
 function __construct()
 {
     $this->setTableName('click');
     // set common fact table columns
     $parent_columns = parent::__construct();
     foreach ($parent_columns as $pcolumn) {
         $this->setProperty($pcolumn);
     }
     // move to abstract
     //$this->properties['id'] = new owa_dbColumn;
     //$this->properties['id']->setDataType(OWA_DTD_BIGINT);
     //$this->properties['id']->setPrimaryKey();
     // drop
     $this->properties['last_impression_id'] = new owa_dbColumn();
     $this->properties['last_impression_id']->setDataType(OWA_DTD_BIGINT);
     // move to abstract
     //$visitor_id = new owa_dbColumn('visitor_id', OWA_DTD_BIGINT);
     //$visitor_id->setForeignKey('base.visitor');
     //$this->setProperty($visitor_id);
     // move to abstract
     //$session_id = new owa_dbColumn('session_id', OWA_DTD_BIGINT);
     //$session_id->setForeignKey('base.session');
     //$this->setProperty($session_id);
     $document_id = new owa_dbColumn('document_id', OWA_DTD_BIGINT);
     $document_id->setForeignKey('base.document');
     $this->setProperty($document_id);
     $this->properties['target_id'] = new owa_dbColumn();
     $this->properties['target_id']->setDataType(OWA_DTD_BIGINT);
     $this->properties['target_url'] = new owa_dbColumn();
     $this->properties['target_url']->setDataType(OWA_DTD_VARCHAR255);
     // move to abstract
     //$this->properties['timestamp'] = new owa_dbColumn;
     //$this->properties['timestamp']->setDataType(OWA_DTD_INT);
     /*
     $this->properties['year'] = new owa_dbColumn;
     $this->properties['year']->setDataType(OWA_DTD_INT);
     $this->properties['month'] = new owa_dbColumn;
     $this->properties['month']->setDataType(OWA_DTD_INT);
     $this->properties['day'] = new owa_dbColumn;
     $this->properties['day']->setDataType(OWA_DTD_INT);
     $this->properties['dayofyear'] = new owa_dbColumn;
     $this->properties['dayofyear']->setDataType(OWA_DTD_INT);
     $this->properties['weekofyear'] = new owa_dbColumn;
     $this->properties['weekofyear']->setDataType(OWA_DTD_INT);
     */
     // drop these soon
     $this->properties['hour'] = new owa_dbColumn();
     $this->properties['hour']->setDataType(OWA_DTD_TINYINT2);
     $this->properties['minute'] = new owa_dbColumn();
     $this->properties['minute']->setDataType(OWA_DTD_TINYINT2);
     $this->properties['second'] = new owa_dbColumn();
     $this->properties['second']->setDataType(OWA_DTD_INT);
     $this->properties['msec'] = new owa_dbColumn();
     $this->properties['msec']->setDataType(OWA_DTD_VARCHAR255);
     $this->properties['click_x'] = new owa_dbColumn();
     $this->properties['click_x']->setDataType(OWA_DTD_INT);
     $this->properties['click_y'] = new owa_dbColumn();
     $this->properties['click_y']->setDataType(OWA_DTD_INT);
     $this->properties['page_width'] = new owa_dbColumn();
     $this->properties['page_width']->setDataType(OWA_DTD_INT);
     $this->properties['page_height'] = new owa_dbColumn();
     $this->properties['page_height']->setDataType(OWA_DTD_INT);
     $this->properties['position'] = new owa_dbColumn();
     $this->properties['position']->setDataType(OWA_DTD_INT);
     $this->properties['approx_position'] = new owa_dbColumn();
     $this->properties['approx_position']->setDataType(OWA_DTD_BIGINT);
     $this->properties['dom_element_x'] = new owa_dbColumn();
     $this->properties['dom_element_x']->setDataType(OWA_DTD_INT);
     $this->properties['dom_element_y'] = new owa_dbColumn();
     $this->properties['dom_element_y']->setDataType(OWA_DTD_INT);
     $this->properties['dom_element_name'] = new owa_dbColumn();
     $this->properties['dom_element_name']->setDataType(OWA_DTD_VARCHAR255);
     $this->properties['dom_element_id'] = new owa_dbColumn();
     $this->properties['dom_element_id']->setDataType(OWA_DTD_VARCHAR255);
     $this->properties['dom_element_value'] = new owa_dbColumn();
     $this->properties['dom_element_value']->setDataType(OWA_DTD_VARCHAR255);
     $this->properties['dom_element_tag'] = new owa_dbColumn();
     $this->properties['dom_element_tag']->setDataType(OWA_DTD_VARCHAR255);
     $this->properties['dom_element_text'] = new owa_dbColumn();
     $this->properties['dom_element_text']->setDataType(OWA_DTD_VARCHAR255);
     $this->properties['dom_element_class'] = new owa_dbColumn();
     $this->properties['dom_element_class']->setDataType(OWA_DTD_VARCHAR255);
     $this->properties['dom_element_parent_id'] = new owa_dbColumn();
     $this->properties['dom_element_parent_id']->setDataType(OWA_DTD_VARCHAR255);
     // drop
     $this->properties['tag_id'] = new owa_dbColumn();
     $this->properties['tag_id']->setDataType(OWA_DTD_BIGINT);
     //drop
     $this->properties['placement_id'] = new owa_dbColumn();
     $this->properties['placement_id']->setDataType(OWA_DTD_BIGINT);
     // move to abstract
     //$this->properties['campaign_id'] = new owa_dbColumn;
     //$this->properties['campaign_id']->setDataType(OWA_DTD_BIGINT);
     //drop
     $this->properties['ad_group_id'] = new owa_dbColumn();
     $this->properties['ad_group_id']->setDataType(OWA_DTD_BIGINT);
     // move to abstract
     //$this->properties['ad_id'] = new owa_dbColumn;
     //$this->properties['ad_id']->setDataType(OWA_DTD_BIGINT);
     // move to absctract
     //$site_id = new owa_dbColumn('site_id', OWA_DTD_VARCHAR255);
     //$site_id->setForeignKey('base.site', 'site_id');
     //$this->setProperty($site_id);
     // move to absctract
     //$ua_id = new owa_dbColumn('ua_id', OWA_DTD_BIGINT);
     //$ua_id->setForeignKey('base.ua');
     //$this->setProperty($ua_id);
     // move to abstract
     //$this->properties['ip_address'] = new owa_dbColumn;
     //$this->properties['ip_address']->setDataType(OWA_DTD_VARCHAR255);
     // drop
     $this->properties['host'] = new owa_dbColumn();
     $this->properties['host']->setDataType(OWA_DTD_VARCHAR255);
     // move to abstract
     //wrong data type
     //$host_id = new owa_dbColumn('host_id', OWA_DTD_VARCHAR255);
     //$host_id->setForeignKey('base.host');
     //$this->setProperty($host_id);
     // move to abstract
     //$yyyymmdd =  new owa_dbColumn;
     //$yyyymmdd->setName('yyyymmdd');
     //$yyyymmdd->setDataType(OWA_DTD_INT);
     //$yyyymmdd->setIndex();
     //$this->setProperty($yyyymmdd);
 }
 /**
  * Constructs an instance of the entity.
  **/
 function __construct()
 {
     $this->setTableName('eco_core');
     // Retrieve the common columns
     $parent_columns = parent::__construct();
     // Configure the column de-normalized columns
     foreach ($parent_columns as $pcolumn) {
         $this->setProperty($pcolumn);
     }
     // Configure email
     $email = new owa_dbColumn('user_email', OWA_DTD_VARCHAR255);
     $this->setProperty($email);
     // Configure the tracked columns.
     $applicationName = new owa_dbColumn('app_name', OWA_DTD_VARCHAR255);
     $this->setProperty($applicationName);
     $appVersion = new owa_dbColumn('app_version', OWA_DTD_VARCHAR255);
     $this->setProperty($appVersion);
     $contentId = new owa_dbColumn('content_identifier', OWA_DTD_VARCHAR255);
     $this->setProperty($contentId);
     $navigationState = new owa_dbColumn('navstate', OWA_DTD_VARCHAR255);
     $this->setProperty($navigationState);
     $objectName = new owa_dbColumn('object_name', OWA_DTD_VARCHAR255);
     $this->setProperty($objectName);
     $stateName = new owa_dbColumn('state_name', OWA_DTD_VARCHAR255);
     $this->setProperty($stateName);
     $offline = new owa_dbColumn('offline', OWA_DTD_BOOLEAN);
     $this->setProperty($offline);
     $fullscreen = new owa_dbColumn('fullscreen', OWA_DTD_BOOLEAN);
     $this->setProperty($fullscreen);
     $installState = new owa_dbColumn('installstate', OWA_DTD_TINYINT);
     $this->setProperty($installState);
     $timecode = new owa_dbColumn('timecode', OWA_DTD_INT);
     $this->setProperty($timecode);
     $zoomFactor = new owa_dbColumn('zoomfactor', OWA_DTD_VARCHAR10);
     $this->setProperty($zoomFactor);
     $clientHeight = new owa_dbColumn('client_height', OWA_DTD_INT);
     $this->setProperty($clientHeight);
     $clientWidth = new owa_dbColumn('client_width', OWA_DTD_INT);
     $this->setProperty($clientWidth);
     $runtimeVersion = new owa_dbColumn('runtime_version', OWA_DTD_VARCHAR255);
     $this->setProperty($runtimeVersion);
     $campaignId = new owa_dbColumn('jadcampaign_id', OWA_DTD_BIGINT);
     $this->setProperty($campaignId);
     $zoneId = new owa_dbColumn('jadzone_id', OWA_DTD_BIGINT);
     $this->setProperty($zoneId);
     $adId = new owa_dbColumn('jad_id', OWA_DTD_BIGINT);
     $this->setProperty($adId);
     $contentSection = new owa_dbColumn('content_section', OWA_DTD_VARCHAR255);
     $this->setProperty($contentSection);
     $platform = new owa_dbColumn('platform', OWA_DTD_VARCHAR255);
     $this->setProperty($platform);
     $originalTimestamp = new owa_dbColumn('original_timestamp', OWA_DTD_INT);
     $this->setProperty($originalTimestamp);
     $originalTs = new owa_dbColumn('original_datetime', OWA_DTD_VARCHAR255);
     $this->setProperty($originalTs);
     $region = new owa_dbColumn('region', OWA_DTD_VARCHAR10);
     $this->setProperty($region);
     $postalCode = new owa_dbColumn('postal_code', OWA_DTD_VARCHAR10);
     $this->setProperty($postalCode);
     $projectCost = new owa_dbColumn('cost', OWA_DTD_VARCHAR255);
     $this->setProperty($projectCost);
     $costType = new owa_dbColumn('cost_type', OWA_DTD_VARCHAR255);
     $this->setProperty($costType);
     $costSubtype = new owa_dbColumn('cost_subtype', OWA_DTD_VARCHAR255);
     $this->setProperty($costSubtype);
     $persistanceAction = new owa_dbColumn('storage', OWA_DTD_VARCHAR10);
     $this->setProperty($persistanceAction);
     owa_coreAPI::debug('Initialized entity: eco_core');
 }
 function __construct()
 {
     $this->setTableName('commerce_transaction_fact');
     // set common fact table columns
     $parent_columns = parent::__construct();
     foreach ($parent_columns as $pcolumn) {
         $this->setProperty($pcolumn);
     }
     // move to abstract
     //$id = new owa_dbColumn('id', OWA_DTD_BIGINT);
     //$id->setPrimaryKey();
     //$this->setProperty($id);
     // move to abstract
     //$visitor_id = new owa_dbColumn('visitor_id', OWA_DTD_BIGINT);
     //$visitor_id->setForeignKey('base.visitor');
     //$this->setProperty($visitor_id);
     // move to abstract
     //$session_id = new owa_dbColumn('session_id', OWA_DTD_BIGINT);
     //$session_id->setForeignKey('base.session');
     //$this->setProperty($session_id);
     $document_id = new owa_dbColumn('document_id', OWA_DTD_BIGINT);
     $document_id->setForeignKey('base.document');
     $this->setProperty($document_id);
     // move to abstract
     //$site_id = new owa_dbColumn('site_id', OWA_DTD_VARCHAR255);
     //$site_id->setForeignKey('base.site', 'site_id');
     //$this->setProperty($site_id);
     // move to abstract
     //$ua_id = new owa_dbColumn('ua_id', OWA_DTD_BIGINT);
     //$ua_id->setForeignKey('base.ua');
     //$this->setProperty($ua_id);
     // move to abstract
     //$host_id = new owa_dbColumn('host_id', OWA_DTD_BIGINT);
     //$host_id->setForeignKey('base.host');
     //$this->setProperty($host_id);
     // move to abstract
     //$os_id = new owa_dbColumn('os_id', OWA_DTD_BIGINT);
     //$os_id->setForeignKey('base.os');
     //$this->setProperty($os_id);
     // move to abstract
     //$location_id = new owa_dbColumn('location_id', OWA_DTD_BIGINT);
     //$location_id->setForeignKey('base.location_dim');
     //$this->setProperty($location_id);
     // move to abstract
     //$medium = new owa_dbColumn('medium',OWA_DTD_VARCHAR255);
     //$this->setProperty($medium);
     // move to abstract
     //$source_id = new owa_dbColumn('source_id', OWA_DTD_BIGINT);
     //$source_id->setForeignKey('base.source_dim');
     //$this->setProperty($source_id);
     // move to abstract
     //$ad_id = new owa_dbColumn('ad_id', OWA_DTD_BIGINT);
     //$ad_id->setForeignKey('base.ad_dim');
     //$this->setProperty($ad_id);
     // move to abstract
     //$campaign_id = new owa_dbColumn('campaign_id', OWA_DTD_BIGINT);
     //$campaign_id->setForeignKey('base.campaign_dim');
     //$this->setProperty($campaign_id);
     // move to abstract
     //$referring_search_term_id = new owa_dbColumn('referring_search_term_id', OWA_DTD_BIGINT);
     //$referring_search_term_id->setForeignKey('base.search_term_dim');
     //$this->setProperty($referring_search_term_id);
     // move to abstract
     //$referer_id = new owa_dbColumn('referer_id', OWA_DTD_BIGINT);
     //$referer_id->setForeignKey('base.referer');
     //$this->setProperty($referer_id);
     // move to abstract
     //$timestamp = new owa_dbColumn('timestamp', OWA_DTD_INT);
     //$this->setProperty($timestamp);
     // move to abstract
     //$yyyymmdd = new owa_dbColumn('yyyymmdd', OWA_DTD_INT);
     //$this->setProperty($yyyymmdd);
     $order_id = new owa_dbColumn('order_id', OWA_DTD_VARCHAR255);
     $order_id->setIndex();
     $this->setProperty($order_id);
     $order_source = new owa_dbColumn('order_source', OWA_DTD_VARCHAR255);
     $this->setProperty($order_source);
     $gateway = new owa_dbColumn('gateway', OWA_DTD_VARCHAR255);
     $this->setProperty($gateway);
     $total = new owa_dbColumn('total_revenue', OWA_DTD_BIGINT);
     $this->setProperty($total);
     $tax = new owa_dbColumn('tax_revenue', OWA_DTD_BIGINT);
     $this->setProperty($tax);
     $shipping = new owa_dbColumn('shipping_revenue', OWA_DTD_BIGINT);
     $this->setProperty($shipping);
     // move to abstract
     //$days_since_first_session = new owa_dbColumn('days_since_first_session', OWA_DTD_INT);
     //$this->setProperty($days_since_first_session);
     // move to abstract
     //$nps = new owa_dbColumn('num_prior_sessions', OWA_DTD_INT);
     //$this->setProperty($nps);
 }
Пример #6
0
 function __construct()
 {
     // table name
     $this->setTableName('session');
     $this->setSummaryLevel(1);
     // set common fact table columns
     $parent_columns = parent::__construct();
     // remove the session id from parent col list
     // as it's a duplicate to the id column for this entity.
     if (isset($parent_columns['session_id'])) {
         unset($parent_columns['session_id']);
     }
     foreach ($parent_columns as $pcolumn) {
         $this->setProperty($pcolumn);
     }
     // properties
     // move to abstract
     //$this->properties['id'] = new owa_dbColumn;
     //$this->properties['id']->setDataType(OWA_DTD_BIGINT);
     //$this->properties['id']->setPrimaryKey();
     // move to abstract
     //$visitor_id = new owa_dbColumn('visitor_id', OWA_DTD_BIGINT);
     //$visitor_id->setForeignKey('base.visitor');
     //$this->setProperty($visitor_id);
     // move to abstract
     //$ts =  new owa_dbColumn;
     //$ts->setName('timestamp');
     //$ts->setDataType(OWA_DTD_BIGINT);
     //$ts->setIndex();
     //$this->setProperty($ts);
     // move to abstract
     //$yyyymmdd =  new owa_dbColumn;
     //$yyyymmdd->setName('yyyymmdd');
     //$yyyymmdd->setDataType(OWA_DTD_INT);
     //$yyyymmdd->setIndex();
     //$this->setProperty($yyyymmdd);
     // move to abstract
     //$this->properties['user_name'] = new owa_dbColumn;
     //$this->properties['user_name']->setDataType(OWA_DTD_VARCHAR255);
     // drop
     $this->properties['user_email'] = new owa_dbColumn();
     $this->properties['user_email']->setDataType(OWA_DTD_VARCHAR255);
     // move to abstract
     /*
     $this->properties['year'] = new owa_dbColumn;
     $this->properties['year']->setDataType(OWA_DTD_INT);
     $this->properties['month'] = new owa_dbColumn;
     $this->properties['month']->setDataType(OWA_DTD_INT);
     $this->properties['day'] = new owa_dbColumn;
     $this->properties['day']->setDataType(OWA_DTD_TINYINT2);
     $this->properties['dayofweek'] = new owa_dbColumn;
     $this->properties['dayofweek']->setDataType(OWA_DTD_VARCHAR10);
     $this->properties['dayofyear'] = new owa_dbColumn;
     $this->properties['dayofyear']->setDataType(OWA_DTD_INT);
     $this->properties['weekofyear'] = new owa_dbColumn;
     $this->properties['weekofyear']->setDataType(OWA_DTD_INT);
     */
     // drop these soon
     $this->properties['hour'] = new owa_dbColumn();
     $this->properties['hour']->setDataType(OWA_DTD_TINYINT2);
     $this->properties['minute'] = new owa_dbColumn();
     $this->properties['minute']->setDataType(OWA_DTD_TINYINT2);
     // move to abstract
     $this->properties['last_req'] = new owa_dbColumn();
     $this->properties['last_req']->setDataType(OWA_DTD_BIGINT);
     $this->properties['num_pageviews'] = new owa_dbColumn();
     $this->properties['num_pageviews']->setDataType(OWA_DTD_INT);
     // drop
     $this->properties['num_comments'] = new owa_dbColumn();
     $this->properties['num_comments']->setDataType(OWA_DTD_INT);
     // move to abstract
     $this->properties['is_repeat_visitor'] = new owa_dbColumn();
     $this->properties['is_repeat_visitor']->setDataType(OWA_DTD_TINYINT);
     // how to denormalize into other fact tables?
     $is_bounce = new owa_dbColumn();
     $is_bounce->setName('is_bounce');
     $is_bounce->setDataType(OWA_DTD_TINYINT);
     $this->setProperty($is_bounce);
     // move to abstract
     $this->properties['is_new_visitor'] = new owa_dbColumn();
     $this->properties['is_new_visitor']->setDataType(OWA_DTD_TINYINT);
     // needed?
     $this->properties['prior_session_lastreq'] = new owa_dbColumn();
     $this->properties['prior_session_lastreq']->setDataType(OWA_DTD_BIGINT);
     // needed?
     $prior_session_id = new owa_dbColumn('prior_session_id', OWA_DTD_BIGINT);
     $this->setProperty($prior_session_id);
     // drop
     $this->properties['time_sinse_priorsession'] = new owa_dbColumn();
     $this->properties['time_sinse_priorsession']->setDataType(OWA_DTD_INT);
     // drop
     $this->properties['prior_session_year'] = new owa_dbColumn();
     $this->properties['prior_session_year']->setDataType(OWA_DTD_TINYINT4);
     // drop
     $this->properties['prior_session_month'] = new owa_dbColumn();
     $this->properties['prior_session_month']->setDataType(OWA_DTD_VARCHAR255);
     // drop
     $this->properties['prior_session_day'] = new owa_dbColumn();
     $this->properties['prior_session_day']->setDataType(OWA_DTD_TINYINT2);
     // drop
     $this->properties['prior_session_dayofweek'] = new owa_dbColumn();
     $this->properties['prior_session_dayofweek']->setDataType(OWA_DTD_INT);
     // drop
     $this->properties['prior_session_hour'] = new owa_dbColumn();
     $this->properties['prior_session_hour']->setDataType(OWA_DTD_TINYINT2);
     // drop
     $this->properties['prior_session_minute'] = new owa_dbColumn();
     $this->properties['prior_session_minute']->setDataType(OWA_DTD_TINYINT2);
     // move to abstract
     //$this->properties['days_since_prior_session'] = new owa_dbColumn;
     //$this->properties['days_since_prior_session']->setDataType(OWA_DTD_INT);
     // move to abstract
     //$this->properties['days_since_first_session'] = new owa_dbColumn;
     //$this->properties['days_since_first_session']->setDataType(OWA_DTD_INT);
     // drop
     $this->properties['os'] = new owa_dbColumn();
     $this->properties['os']->setDataType(OWA_DTD_VARCHAR255);
     // wrong data type
     // move to abstract
     // $os_id = new owa_dbColumn('os_id', OWA_DTD_VARCHAR255);
     // $os_id->setForeignKey('base.os');
     // $this->setProperty($os_id);
     // wrong data type
     // move to abstract
     //$ua_id = new owa_dbColumn('ua_id', OWA_DTD_VARCHAR255);
     //$ua_id->setForeignKey('base.ua');
     //$this->setProperty($ua_id);
     $first_page_id = new owa_dbColumn('first_page_id', OWA_DTD_BIGINT);
     $first_page_id->setForeignKey('base.document');
     $this->setProperty($first_page_id);
     $last_page_id = new owa_dbColumn('last_page_id', OWA_DTD_BIGINT);
     $last_page_id->setForeignKey('base.document');
     $this->setProperty($last_page_id);
     // move to abstract
     //$referer_id = new owa_dbColumn('referer_id', OWA_DTD_BIGINT);
     //$referer_id->setForeignKey('base.referer');
     //$this->setProperty($referer_id);
     // move to abstract
     //$referring_search_term_id = new owa_dbColumn('referring_search_term_id', OWA_DTD_BIGINT);
     //$referring_search_term_id->setForeignKey('base.search_term_dim');
     //$this->setProperty($referring_search_term_id);
     // move to abstract
     //$ip_address = new owa_dbColumn('ip_address', OWA_DTD_VARCHAR255);
     //$this->setProperty($ip_address);
     // drop
     $this->properties['host'] = new owa_dbColumn();
     $this->properties['host']->setDataType(OWA_DTD_VARCHAR255);
     // move to abstract
     // wrong data type
     //$host_id = new owa_dbColumn('host_id', OWA_DTD_VARCHAR255);
     //$host_id->setForeignKey('base.host');
     //$this->setProperty($host_id);
     //drop
     $this->properties['city'] = new owa_dbColumn();
     $this->properties['city']->setDataType(OWA_DTD_VARCHAR255);
     //drop
     $this->properties['country'] = new owa_dbColumn();
     $this->properties['country']->setDataType(OWA_DTD_VARCHAR255);
     // drop
     $this->properties['site'] = new owa_dbColumn();
     $this->properties['site']->setDataType(OWA_DTD_VARCHAR255);
     // move to abstract
     //$site_id = new owa_dbColumn('site_id', OWA_DTD_VARCHAR255);
     //$site_id->setForeignKey('base.site', 'site_id');
     //$this->setProperty($site_id);
     // move to abstract
     //$nps = new owa_dbColumn('num_prior_sessions', OWA_DTD_INT);
     //$this->setProperty($nps);
     //drop
     $this->properties['is_robot'] = new owa_dbColumn();
     $this->properties['is_robot']->setDataType(OWA_DTD_TINYINT);
     //drop
     $this->properties['is_browser'] = new owa_dbColumn();
     $this->properties['is_browser']->setDataType(OWA_DTD_TINYINT);
     //drop
     $this->properties['is_feedreader'] = new owa_dbColumn();
     $this->properties['is_feedreader']->setDataType(OWA_DTD_TINYINT);
     // move to abstract
     //$medium = new owa_dbColumn('medium',OWA_DTD_VARCHAR255);
     //$this->setProperty($medium);
     // move to abstract
     //$source_id = new owa_dbColumn('source_id', OWA_DTD_BIGINT);
     //$source_id->setForeignKey('base.source_dim');
     //$this->setProperty($source_id);
     // move to abstract
     //$ad_id = new owa_dbColumn('ad_id', OWA_DTD_BIGINT);
     //$ad_id->setForeignKey('base.ad_dim');
     //$this->setProperty($ad_id);
     // move to abstract
     //$campaign_id = new owa_dbColumn('campaign_id', OWA_DTD_BIGINT);
     //$campaign_id->setForeignKey('base.campaign_dim');
     //$this->setProperty($campaign_id);
     $this->properties['latest_attributions'] = new owa_dbColumn();
     $this->properties['latest_attributions']->setDataType(OWA_DTD_BLOB);
     // create goal related columns
     $gcount = owa_coreAPI::getSetting('base', 'numGoals');
     for ($num = 1; $num <= $gcount; $num++) {
         $col_name = 'goal_' . $num;
         $goal_col = new owa_dbColumn($col_name, OWA_DTD_TINYINT);
         $this->setProperty($goal_col);
         $col_name = 'goal_' . $num . '_start';
         $goal_col = new owa_dbColumn($col_name, OWA_DTD_TINYINT);
         $this->setProperty($goal_col);
         $col_name = 'goal_' . $num . '_value';
         $goal_col = new owa_dbColumn($col_name, OWA_DTD_BIGINT);
         $this->setProperty($goal_col);
     }
     $num_goals = new owa_dbColumn('num_goals', OWA_DTD_TINYINT);
     $this->setProperty($num_goals);
     $num_goal_starts = new owa_dbColumn('num_goal_starts', OWA_DTD_TINYINT);
     $this->setProperty($num_goal_starts);
     $goals_value = new owa_dbColumn('goals_value', OWA_DTD_BIGINT);
     $this->setProperty($goals_value);
     // move to abstract
     //location
     //$location_id = new owa_dbColumn('location_id', OWA_DTD_BIGINT);
     //$location_id->setForeignKey('base.location_dim');
     //$this->setProperty($location_id);
     // move to abstract
     // language
     //$language = new owa_dbColumn('language', OWA_DTD_VARCHAR255);
     //$this->setProperty($language);
     // transaction count
     $commerce_trans_count = new owa_dbColumn('commerce_trans_count', OWA_DTD_INT);
     $this->setProperty($commerce_trans_count);
     // revenue including tax and shipping
     $commerce_trans_revenue = new owa_dbColumn('commerce_trans_revenue', OWA_DTD_BIGINT);
     $this->setProperty($commerce_trans_revenue);
     // revenue excluding tax and shipping
     $commerce_items_revenue = new owa_dbColumn('commerce_items_revenue', OWA_DTD_BIGINT);
     $this->setProperty($commerce_items_revenue);
     // distinct number of items
     $commerce_items_count = new owa_dbColumn('commerce_items_count', OWA_DTD_INT);
     $this->setProperty($commerce_items_count);
     // total quantity of all items
     $commerce_items_quantity = new owa_dbColumn('commerce_items_quantity', OWA_DTD_INT);
     $this->setProperty($commerce_items_quantity);
     // shipping revenue
     $commerce_shipping_revenue = new owa_dbColumn('commerce_shipping_revenue', OWA_DTD_BIGINT);
     $this->setProperty($commerce_shipping_revenue);
     // tax revenue
     $commerce_tax_revenue = new owa_dbColumn('commerce_tax_revenue', OWA_DTD_BIGINT);
     $this->setProperty($commerce_tax_revenue);
 }
Пример #7
0
 function __construct()
 {
     $this->setTableName('request');
     $this->setSummaryLevel(0);
     // set common fact table columns
     $parent_columns = parent::__construct();
     foreach ($parent_columns as $pcolumn) {
         $this->setProperty($pcolumn);
     }
     // properties
     // move to abstract
     //$this->properties['id'] = new owa_dbColumn;
     //$this->properties['id']->setDataType(OWA_DTD_BIGINT);
     //$this->properties['id']->setPrimaryKey();
     // move to abstract
     //$visitor_id = new owa_dbColumn('visitor_id', OWA_DTD_BIGINT);
     //$visitor_id->setForeignKey('base.visitor');
     //$this->setProperty($visitor_id);
     // move to abstract
     //$session_id = new owa_dbColumn('session_id', OWA_DTD_BIGINT);
     //$session_id->setForeignKey('base.session');
     //$this->setProperty($session_id);
     // needed?
     $inbound_visitor_id = new owa_dbColumn('inbound_visitor_id', OWA_DTD_BIGINT);
     $inbound_visitor_id->setForeignKey('base.visitor');
     $this->setProperty($inbound_visitor_id);
     // needed?
     $inbound_session_id = new owa_dbColumn('inbound_session_id', OWA_DTD_BIGINT);
     //$inbound_session_id->setForeignKey('base.session');
     $this->setProperty($inbound_session_id);
     // needed anymore?
     $this->properties['feed_subscription_id'] = new owa_dbColumn();
     $this->properties['feed_subscription_id']->setDataType(OWA_DTD_BIGINT);
     // move to abstract
     //$this->properties['user_name'] = new owa_dbColumn;
     //$this->properties['user_name']->setDataType(OWA_DTD_VARCHAR255);
     //drop
     $this->properties['user_email'] = new owa_dbColumn();
     $this->properties['user_email']->setDataType(OWA_DTD_VARCHAR255);
     // move to abstract
     //$ts =  new owa_dbColumn;
     //$ts->setName('timestamp');
     //$ts->setDataType(OWA_DTD_BIGINT);
     //$ts->setIndex();
     //$this->setProperty($ts);
     // move to abstract
     //$yyyymmdd =  new owa_dbColumn;
     //$yyyymmdd->setName('yyyymmdd');
     //$yyyymmdd->setDataType(OWA_DTD_INT);
     //$yyyymmdd->setIndex();
     //$this->setProperty($yyyymmdd);
     //$this->properties['last_req'] = new owa_dbColumn;
     //$this->properties['last_req']->setDataType(OWA_DTD_BIGINT);
     /*
     $this->properties['year'] = new owa_dbColumn;
     $this->properties['year']->setDataType(OWA_DTD_INT);
     $this->properties['month'] = new owa_dbColumn;
     $this->properties['month']->setDataType(OWA_DTD_INT);
     $this->properties['day'] = new owa_dbColumn;
     $this->properties['day']->setDataType(OWA_DTD_TINYINT2);
     $this->properties['dayofweek'] = new owa_dbColumn;
     $this->properties['dayofweek']->setDataType(OWA_DTD_VARCHAR10);
     $this->properties['dayofyear'] = new owa_dbColumn;
     $this->properties['dayofyear']->setDataType(OWA_DTD_INT);
     $this->properties['weekofyear'] = new owa_dbColumn;
     $this->properties['weekofyear']->setDataType(OWA_DTD_INT);
     */
     // drop these at some point
     $this->properties['hour'] = new owa_dbColumn();
     $this->properties['hour']->setDataType(OWA_DTD_TINYINT2);
     $this->properties['minute'] = new owa_dbColumn();
     $this->properties['minute']->setDataType(OWA_DTD_TINYINT2);
     $this->properties['second'] = new owa_dbColumn();
     $this->properties['second']->setDataType(OWA_DTD_TINYINT2);
     $this->properties['msec'] = new owa_dbColumn();
     $this->properties['msec']->setDataType(OWA_DTD_INT);
     // wrong data type
     // move to abstract
     //$referer_id = new owa_dbColumn('referer_id', OWA_DTD_VARCHAR255);
     //$referer_id->setForeignKey('base.referer');
     //$this->setProperty($referer_id);
     // wrong data type
     $document_id = new owa_dbColumn('document_id', OWA_DTD_VARCHAR255);
     $document_id->setForeignKey('base.document');
     $this->setProperty($document_id);
     // move to abstract
     //$site_id = new owa_dbColumn('site_id', OWA_DTD_VARCHAR255);
     //$site_id->setForeignKey('base.site', 'site_id');
     //$this->setProperty($site_id);
     // drop
     $this->properties['site'] = new owa_dbColumn();
     $this->properties['site']->setDataType(OWA_DTD_VARCHAR255);
     // move to abstract
     //$this->properties['ip_address'] = new owa_dbColumn;
     //$this->properties['ip_address']->setDataType(OWA_DTD_VARCHAR255);
     // move to abstract
     // wrong data type -- migrate
     //$host_id = new owa_dbColumn('host_id', OWA_DTD_VARCHAR255);
     //$host_id->setForeignKey('base.host');
     //$this->setProperty($host_id);
     // move to abstract
     // wrong data type
     //$os_id = new owa_dbColumn('os_id', OWA_DTD_VARCHAR255);
     //$os_id->setForeignKey('base.os');
     //$this->setProperty($os_id);
     //drop
     $this->properties['os'] = new owa_dbColumn();
     $this->properties['os']->setDataType(OWA_DTD_VARCHAR255);
     // move to abstract
     // wrong data type
     //$ua_id = new owa_dbColumn('ua_id', OWA_DTD_VARCHAR255);
     //$ua_id->setForeignKey('base.ua');
     //$this->setProperty($ua_id);
     //prior page
     $prior_document_id = new owa_dbColumn('prior_document_id', OWA_DTD_BIGINT);
     $prior_document_id->setForeignKey('base.document');
     $this->setProperty($prior_document_id);
     // move to abstract
     //$nps = new owa_dbColumn('num_prior_sessions', OWA_DTD_INT);
     //$this->setProperty($nps);
     // move to abstract
     //$this->properties['is_new_visitor'] = new owa_dbColumn;
     //$this->properties['is_new_visitor']->setDataType(OWA_DTD_TINYINT);
     // move to abstract
     //$this->properties['is_repeat_visitor'] = new owa_dbColumn;
     //$this->properties['is_repeat_visitor']->setDataType(OWA_DTD_TINYINT);
     // drop
     $this->properties['is_comment'] = new owa_dbColumn();
     $this->properties['is_comment']->setDataType(OWA_DTD_TINYINT);
     $this->properties['is_entry_page'] = new owa_dbColumn();
     $this->properties['is_entry_page']->setDataType(OWA_DTD_TINYINT);
     $this->properties['is_browser'] = new owa_dbColumn();
     $this->properties['is_browser']->setDataType(OWA_DTD_TINYINT);
     $this->properties['is_robot'] = new owa_dbColumn();
     $this->properties['is_robot']->setDataType(OWA_DTD_TINYINT);
     $this->properties['is_feedreader'] = new owa_dbColumn();
     $this->properties['is_feedreader']->setDataType(OWA_DTD_TINYINT);
     //move to abstract
     //$location_id = new owa_dbColumn('location_id', OWA_DTD_BIGINT);
     //$location_id->setForeignKey('base.location_dim');
     //$this->setProperty($location_id);
     //move to abstract
     //$language = new owa_dbColumn('language', OWA_DTD_VARCHAR255);
     //$this->setProperty($language);
 }
 function __construct()
 {
     $this->setTableName('commerce_line_item_fact');
     // set common fact table columns
     $parent_columns = parent::__construct();
     foreach ($parent_columns as $pcolumn) {
         $this->setProperty($pcolumn);
     }
     // move to abstract
     //$id = new owa_dbColumn('id', OWA_DTD_BIGINT);
     //$id->setPrimaryKey();
     //$this->setProperty($id);
     // move to abstract
     //$visitor_id = new owa_dbColumn('visitor_id', OWA_DTD_BIGINT);
     //$visitor_id->setForeignKey('base.visitor');
     //$this->setProperty($visitor_id);
     // move to abstract
     //$session_id = new owa_dbColumn('session_id', OWA_DTD_BIGINT);
     //$session_id->setForeignKey('base.session');
     //$this->setProperty($session_id);
     $document_id = new owa_dbColumn('document_id', OWA_DTD_BIGINT);
     $document_id->setForeignKey('base.document');
     $this->setProperty($document_id);
     // move to abstract
     //$site_id = new owa_dbColumn('site_id', OWA_DTD_VARCHAR255);
     //$site_id->setForeignKey('base.site', 'site_id');
     //$this->setProperty($site_id);
     // move to abstract
     //$ua_id = new owa_dbColumn('ua_id', OWA_DTD_BIGINT);
     //$ua_id->setForeignKey('base.ua');
     //$this->setProperty($ua_id);
     // move to abstract
     //$host_id = new owa_dbColumn('host_id', OWA_DTD_BIGINT);
     //$host_id->setForeignKey('base.host');
     //$this->setProperty($host_id);
     // move to abstract
     //$os_id = new owa_dbColumn('os_id', OWA_DTD_BIGINT);
     //$os_id->setForeignKey('base.os');
     //$this->setProperty($os_id);
     // move to abstract
     //$location_id = new owa_dbColumn('location_id', OWA_DTD_BIGINT);
     //$location_id->setForeignKey('base.location_dim');
     //$this->setProperty($location_id);
     // move to abstract
     //$medium = new owa_dbColumn('medium',OWA_DTD_VARCHAR255);
     //$this->setProperty($medium);
     // move to abstract
     //$source_id = new owa_dbColumn('source_id', OWA_DTD_BIGINT);
     //$source_id->setForeignKey('base.source_dim');
     //$this->setProperty($source_id);
     // move to abstract
     //$ad_id = new owa_dbColumn('ad_id', OWA_DTD_BIGINT);
     //$ad_id->setForeignKey('base.ad_dim');
     //$this->setProperty($ad_id);
     // move to abstract
     //$campaign_id = new owa_dbColumn('campaign_id', OWA_DTD_BIGINT);
     //$campaign_id->setForeignKey('base.campaign_dim');
     //$this->setProperty($campaign_id);
     // move to abstract
     //$referring_search_term_id = new owa_dbColumn('referring_search_term_id', OWA_DTD_BIGINT);
     //$referring_search_term_id->setForeignKey('base.search_term_dim');
     //$this->setProperty($referring_search_term_id);
     // move to abstract
     //$timestamp = new owa_dbColumn('timestamp', OWA_DTD_INT);
     //$this->setProperty($timestamp);
     // move to abstract
     //$yyyymmdd = new owa_dbColumn('yyyymmdd', OWA_DTD_INT);
     //$this->setProperty($yyyymmdd);
     $order_id = new owa_dbColumn('order_id', OWA_DTD_VARCHAR255);
     $order_id->setIndex();
     $this->setProperty($order_id);
     $sku = new owa_dbColumn('sku', OWA_DTD_VARCHAR255);
     $this->setProperty($sku);
     $product_name = new owa_dbColumn('product_name', OWA_DTD_VARCHAR255);
     $this->setProperty($product_name);
     $category = new owa_dbColumn('category', OWA_DTD_VARCHAR255);
     $this->setProperty($category);
     $unit_price = new owa_dbColumn('unit_price', OWA_DTD_BIGINT);
     $this->setProperty($unit_price);
     $quantity = new owa_dbColumn('quantity', OWA_DTD_INT);
     $this->setProperty($quantity);
     $item_revenue = new owa_dbColumn('item_revenue', OWA_DTD_BIGINT);
     $this->setProperty($item_revenue);
 }