本文整理汇总了PHP中EEM_Base::__construct方法的典型用法代码示例。如果您正苦于以下问题:PHP EEM_Base::__construct方法的具体用法?PHP EEM_Base::__construct怎么用?PHP EEM_Base::__construct使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类EEM_Base
的用法示例。
在下文中一共展示了EEM_Base::__construct方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __construct
protected function __construct($timezone = NULL)
{
$this->singular_item = __('Term Taxonomy', 'event_espresso');
$this->plural_item = __('Term Taxonomy', 'event_espresso');
$this->_tables = array('Term_Taxonomy' => new EE_Primary_Table('term_taxonomy', 'term_taxonomy_id'));
$this->_fields = array('Term_Taxonomy' => array('term_taxonomy_id' => new EE_Primary_Key_Int_Field('term_taxonomy_id', __('Term-Taxonomy ID', 'event_espresso')), 'term_id' => new EE_Foreign_Key_Int_Field('term_id', __("Term Id", "event_espresso"), false, 0, 'Term'), 'taxonomy' => new EE_Plain_Text_Field('taxonomy', __('Taxonomy Name', 'event_espresso'), false, 'category'), 'description' => new EE_Post_Content_Field('description', __("Description of Term", "event_espresso"), false, ''), 'parent' => new EE_Integer_Field('parent', __("Parent Term ID", "event_espresso"), false, 0), 'term_count' => new EE_Integer_Field('count', __("Count of Objects attached", 'event_espresso'), false, 0)));
$this->_model_relations = array('Term_Relationship' => new EE_Has_Many_Relation(), 'Term' => new EE_Belongs_To_Relation());
$cpt_models = array_keys(EE_Registry::instance()->cpt_models());
foreach ($cpt_models as $model_name) {
$this->_model_relations[$model_name] = new EE_HABTM_Relation('Term_Relationship');
}
$this->_indexes = array('term_id_taxonomy' => new EE_Unique_Index(array('term_id', 'taxonomy')));
$path_to_tax_model = '';
$this->_cap_restriction_generators[EEM_Base::caps_read] = new EE_Restriction_Generator_Public();
$this->_cap_restriction_generators[EEM_Base::caps_read_admin] = new EE_Restriction_Generator_Taxonomy_Protected($path_to_tax_model);
$this->_cap_restriction_generators[EEM_Base::caps_edit] = false;
$this->_cap_restriction_generators[EEM_Base::caps_delete] = false;
//add cap restrictions for editing relating to the "ee_edit_*"
$this->_cap_restrictions[EEM_Base::caps_edit]['ee_edit_event_category'] = new EE_Default_Where_Conditions(array($path_to_tax_model . 'taxonomy*ee_edit_event_category' => array('!=', 'espresso_event_categories')));
$this->_cap_restrictions[EEM_Base::caps_edit]['ee_edit_venue_category'] = new EE_Default_Where_Conditions(array($path_to_tax_model . 'taxonomy*ee_edit_venue_category' => array('!=', 'espresso_venue_categories')));
$this->_cap_restrictions[EEM_Base::caps_edit]['ee_edit_event_type'] = new EE_Default_Where_Conditions(array($path_to_tax_model . 'taxonomy*ee_edit_event_type' => array('!=', 'espresso_event_type')));
//add cap restrictions for deleting relating to the "ee_deleting_*"
$this->_cap_restrictions[EEM_Base::caps_delete]['ee_delete_event_category'] = new EE_Default_Where_Conditions(array($path_to_tax_model . 'taxonomy*ee_delete_event_category' => array('!=', 'espresso_event_categories')));
$this->_cap_restrictions[EEM_Base::caps_delete]['ee_delete_venue_category'] = new EE_Default_Where_Conditions(array($path_to_tax_model . 'taxonomy*ee_delete_venue_category' => array('!=', 'espresso_venue_categories')));
$this->_cap_restrictions[EEM_Base::caps_delete]['ee_delete_event_type'] = new EE_Default_Where_Conditions(array($path_to_tax_model . 'taxonomy*ee_delete_event_type' => array('!=', 'espresso_event_type')));
parent::__construct($timezone);
}
示例2: __construct
protected function __construct($timezone = null)
{
$this->_tables = array('New_Addon_Thing' => new EE_Primary_Table('esp_new_addon_thing', 'NEW_ID'));
$this->_fields = array('New_Addon_Thing' => array('NEW_ID' => new EE_Primary_Key_Int_Field('NEW_ID', __("New Addon Thing ID", 'event_espresso')), 'NEW_name' => new EE_Plain_Text_Field('NEW_name', __('Name', 'event_espresso'), false), 'NEW_wp_user' => new EE_WP_User_Field('NEW_wp_user', __('Things Creator', 'event_espresso'), false)));
$this->_model_relations = array('Attendee' => new EE_Has_Many_Relation(), 'WP_User' => new EE_Belongs_To_Relation());
parent::__construct($timezone);
}
示例3: __construct
public function __construct($timezone = NULL)
{
$this->_tables = array('Person_Post' => new EE_Primary_Table('esp_people_to_post', 'PTP_ID'));
$this->_fields = array('Person_Post' => array('PTP_ID' => new EE_Primary_Key_Int_Field('PTP_ID', __('Person to Event Link ID', 'event_espresso')), 'PER_ID' => new EE_Foreign_Key_Int_Field('PER_ID', __('Person Primary ID', 'event_espresso'), false, 0, 'Person'), 'OBJ_ID' => new EE_Foreign_Key_Int_Field('OBJ_ID', __('Event ID', 'event_espresso'), false, 0, array('Event')), 'OBJ_type' => new EE_Any_Foreign_Model_Name_Field('OBJ_type', __('Model Person Related to', 'event_espresso'), false, 'Event', array('Event')), 'PER_OBJ_order' => new EE_Integer_Field('P2P_Order', __('Person to Event Order', 'event_Espresso'), false, 0), 'PT_ID' => new EE_Foreign_Key_Int_Field('PT_ID', __('People Type ID', 'event_espresso'), false, 0, 'Term_Taxonomy')));
$this->_model_relations = array('Person' => new EE_Belongs_To_Relation(), 'Event' => new EE_Belongs_To_Any_Relation(), 'Term_Taxonomy' => new EE_Belongs_to_Relation());
parent::__construct();
}
示例4: __construct
protected function __construct($timezone = NULL)
{
$this->singular_item = __('Term Relationship', 'event_espresso');
$this->plural_item = __('Term Relationships', 'event_espresso');
$this->_tables = array('Term_Relationship' => new EE_Primary_Table('term_relationships'));
$models_this_can_attach_to = array_keys(EE_Registry::instance()->cpt_models());
$this->_fields = array('Term_Relationship' => array('object_id' => new EE_Foreign_Key_Int_Field('object_id', __('Object(Post) ID', 'event_espresso'), false, 0, $models_this_can_attach_to), 'term_taxonomy_id' => new EE_Foreign_Key_Int_Field('term_taxonomy_id', __('Term (in context of a taxonomy) ID', 'event_espresso'), false, 0, 'Term_Taxonomy'), 'term_order' => new EE_Integer_Field('term_order', __('Term Order', 'event_espresso'), false, 0)));
$this->_model_relations = array('Term_Taxonomy' => new EE_Belongs_To_Relation());
foreach ($models_this_can_attach_to as $model_name) {
$this->_model_relations[$model_name] = new EE_Belongs_To_Relation();
}
$this->_indexes = array('PRIMARY' => new EE_Primary_Key_Index(array('object_id', 'term_taxonomy_id')));
$path_to_event_model = 'Event.';
$this->_cap_restriction_generators[EEM_Base::caps_read] = new EE_Restriction_Generator_Event_Related_Public($path_to_event_model);
$this->_cap_restriction_generators[EEM_Base::caps_read_admin] = new EE_Restriction_Generator_Event_Related_Protected($path_to_event_model);
$this->_cap_restriction_generators[EEM_Base::caps_edit] = new EE_Restriction_Generator_Event_Related_Protected($path_to_event_model);
$this->_cap_restriction_generators[EEM_Base::caps_delete] = new EE_Restriction_Generator_Event_Related_Protected($path_to_event_model, EEM_Base::caps_edit);
$path_to_tax_model = 'Term_Taxonomy.';
//add cap restrictions for editing term relations to the "ee_assign_*"
//and for deleting term relations too
$cap_contexts_affected = array(EEM_Base::caps_edit, EEM_Base::caps_delete);
foreach ($cap_contexts_affected as $cap_context_affected) {
$this->_cap_restrictions[$cap_context_affected]['ee_assign_event_category'] = new EE_Default_Where_Conditions(array($path_to_tax_model . 'taxonomy*ee_assign_event_category' => array('!=', 'espresso_event_categories')));
$this->_cap_restrictions[$cap_context_affected]['ee_assign_venue_category'] = new EE_Default_Where_Conditions(array($path_to_tax_model . 'taxonomy*ee_assign_venue_category' => array('!=', 'espresso_venue_categories')));
$this->_cap_restrictions[$cap_context_affected]['ee_assign_event_type'] = new EE_Default_Where_Conditions(array($path_to_tax_model . 'taxonomy*ee_assign_event_type' => array('!=', 'espresso_event_type')));
}
parent::__construct($timezone);
}
示例5: __construct
/**
* @param null $timezone
*/
protected function __construct($timezone = NULL)
{
if (!$this->_default_where_conditions_strategy instanceof EE_Default_Where_Conditions) {
$this->_default_where_conditions_strategy = new EE_Soft_Delete_Where_Conditions();
}
parent::__construct($timezone);
}
示例6: __construct
/**
* @param null $timezone
*/
protected function __construct($timezone = NULL)
{
require_once EE_MODELS . 'strategies/EE_Soft_Delete_Where_Conditions.strategy.php';
if (!$this->_default_where_conditions_strategy) {
$this->_default_where_conditions_strategy = new EE_Soft_Delete_Where_Conditions();
}
parent::__construct($timezone);
}
示例7: __construct
protected function __construct()
{
$this->singular_item = __('Event to Question Group Link', 'event_espresso');
$this->plural_item = __('Event to Question Group Links', 'event_espresso');
$this->_tables = array('Event_Question_Group' => new EE_Primary_Table('esp_event_question_group', 'EQG_ID'));
$this->_fields = array('Event_Question_Group' => array('EQG_ID' => new EE_Primary_Key_Int_Field('EQG_ID', __('Event to Question Group Link ID', 'event_espresso')), 'EVT_ID' => new EE_Foreign_Key_Int_Field('EVT_ID', __('Event ID', 'event_espresso'), false, 0, 'Event'), 'QSG_ID' => new EE_Foreign_Key_Int_Field('QSG_ID', __('Question Group Id', 'event_espresso'), false, 0, 'Question_Group'), 'EQG_primary' => new EE_Boolean_Field('EQG_primary', __('Flag indicating question is only for primary attendees', 'event_espresso'), false, false)));
$this->_model_relations = array('Event' => new EE_Belongs_To_Relation(), 'Question_Group' => new EE_Belongs_To_Relation());
parent::__construct();
}
示例8: __construct
protected function __construct()
{
$this->singular_item = __('Question Group to Question Link', 'event_espresso');
$this->plural_item = __('Question Group to Question Links', 'event_espresso');
$this->_tables = array('Question_Group_Question' => new EE_Primary_Table('esp_question_group_question', 'QGQ_ID'));
$this->_fields = array('Question_Group_Question' => array('QGQ_ID' => new EE_Primary_Key_Int_Field('QGQ_ID', __('Question Group to Question Link ID', 'event_espresso')), 'QSG_ID' => new EE_Foreign_Key_Int_Field('QSG_ID', __('Question Group ID', 'event_espresso'), false, 0, 'Question_Group'), 'QST_ID' => new EE_Foreign_Key_Int_Field('QST_ID', __('Question Id', 'event_espresso'), false, 0, 'Question'), 'QGQ_order' => new EE_Integer_Field('QGQ_order', __('Question Group Question Order', 'event_espresso'), false, 0)));
$this->_model_relations = array('Question_Group' => new EE_Belongs_To_Relation(), 'Question' => new EE_Belongs_To_Relation());
parent::__construct();
}
示例9: __construct
/**
* @return EEM_Status
*/
protected function __construct()
{
$this->singular_item = __('Status', 'event_espresso');
$this->plural_item = __('Stati', 'event_espresso');
$this->_tables = array('Status' => new EE_Primary_Table('esp_status', 'STS_ID'));
$this->_fields = array('Status' => array('STS_ID' => new EE_Primary_Key_String_Field('STS_ID', __('Status ID', 'event_espresso')), 'STS_code' => new EE_Plain_Text_Field('STS_code', __('Status Code', 'event_espresso'), false, ''), 'STS_type' => new EE_Enum_Text_Field('STS_type', __("Type", "event_espresso"), false, 'event', array('event' => __("Event", "event_espresso"), 'registration' => __("Registration", "event_espresso"), 'transaction' => __("Transaction", "event_espresso"), 'payment' => __("Payment", "event_espresso"), 'email' => __("Email", "event_espresso"))), 'STS_can_edit' => new EE_Boolean_Field('STS_can_edit', __('Editable?', 'event_espresso'), false), 'STS_desc' => new EE_Simple_HTML_Field('STS_desc', __("Description", "event_espresso"), false, ''), 'STS_open' => new EE_Boolean_Field('STS_open', __("Open?", "event_espresso"), false, false)));
$this->_model_relations = array('Registration' => new EE_Has_Many_Relation(), 'Transaction' => new EE_Has_Many_Relation(), 'Payment' => new EE_Has_Many_Relation());
parent::__construct();
}
示例10: __construct
/**
* private constructor to prevent direct creation
* @Constructor
* @access protected
* @param string $timezone string representing the timezone we want to set for returned Date Time Strings (and any incoming timezone data that gets saved). Note this just sends the timezone info to the date time model field objects. Default is NULL (and will be assumed using the set timezone in the 'timezone_string' wp option)
* @return void
*/
protected function __construct($timezone)
{
$this->singular_item = __('Payment', 'event_espresso');
$this->plural_item = __('Payments', 'event_espresso');
$this->_tables = array('Payment' => new EE_Primary_Table('esp_payment', 'PAY_ID'));
$this->_fields = array('Payment' => array('PAY_ID' => new EE_Primary_Key_Int_Field('PAY_ID', __('Payment ID', 'event_espresso')), 'TXN_ID' => new EE_Foreign_Key_Int_Field('TXN_ID', __('Transaction ID', 'event_espresso'), false, 0, 'Transaction'), 'STS_ID' => new EE_Foreign_Key_String_Field('STS_ID', __('STatus ID', 'event_espresso'), false, EEM_Payment::status_id_cancelled, 'Status'), 'PAY_timestamp' => new EE_Datetime_Field('PAY_timestamp', __('Timestamp of when payment was attemped', 'event_espresso'), false, current_time('timestamp'), $timezone), 'PAY_method' => new EE_All_Caps_Text_Field('PAY_method', __('User-friendly description of payment', 'event_espresso'), false, 'CART'), 'PAY_amount' => new EE_Money_Field('PAY_amount', __('Amount Payment should be for', 'event_espresso'), false, 0), 'PAY_gateway' => new EE_Plain_Text_Field('PAY_gateway', __('Gateway name used for payment', 'event_espresso'), false, __('Unspecified', 'event_espresso')), 'PAY_gateway_response' => new EE_Plain_Text_Field('PAY_gateway_response', __('Response from Gateway about the payment', 'event_espresso'), false, ''), 'PAY_txn_id_chq_nmbr' => new EE_Plain_Text_Field('PAY_txn_id_chq_nmbr', __('Gateway Transaction ID or Cheque Number', 'event_espresso'), true, ''), 'PAY_po_number' => new EE_Plain_Text_Field('PAY_po_number', __('Purchase or Sales Number', 'event_espresso'), true, ''), 'PAY_extra_accntng' => new EE_Simple_HTML_Field('PAY_extra_accntng', __('Extra Account Info', 'event_espresso'), true, ''), 'PAY_via_admin' => new EE_Boolean_Field('PAY_via_admin', __('Whether payment made via admin', 'event_espresso'), false, false), 'PAY_details' => new EE_Serialized_Text_Field('PAY_details', __('Full Gateway response about payment', 'event_espresso'), true, '')));
$this->_model_relations = array('Transaction' => new EE_Belongs_To_Relation(), 'Status' => new EE_Belongs_To_Relation());
parent::__construct($timezone);
}
示例11: __construct
protected function __construct()
{
$this->singular_item = __('State/Province', 'event_espresso');
$this->plural_item = __('States/Provinces', 'event_espresso');
$this->_tables = array('State' => new EE_Primary_Table('esp_state', 'STA_ID'));
$this->_fields = array('State' => array('STA_ID' => new EE_Primary_Key_Int_Field('STA_ID', __('State ID', 'event_espresso')), 'CNT_ISO' => new EE_Foreign_Key_String_Field('CNT_ISO', __('Country ISO Code', 'event_espresso'), false, NULL, 'Country'), 'STA_abbrev' => new EE_Plain_Text_Field('STA_abbrev', __('State Abbreviation', 'event_espresso'), false, ''), 'STA_name' => new EE_Plain_Text_Field('STA_name', __('State Name', 'event_espresso'), false, ''), 'STA_active' => new EE_Boolean_Field('STA_active', __("State Active Flag", "event_espresso"), false, false)));
$this->_model_relations = array('Attendee' => new EE_Has_Many_Relation(), 'Country' => new EE_Belongs_To_Relation(), 'Venue' => new EE_Has_Many_Relation());
parent::__construct();
}
示例12: __construct
protected function __construct()
{
$this->singular_item = __('Event to Question Group Link', 'event_espresso');
$this->plural_item = __('Event to Question Group Links', 'event_espresso');
$this->_tables = array('Event_Venue' => new EE_Primary_Table('esp_event_venue', 'EVV_ID'));
$this->_fields = array('Event_Venue' => array('EVV_ID' => new EE_Primary_Key_Int_Field('EVV_ID', __('Event to Venue Link ID', 'event_espresso')), 'EVT_ID' => new EE_Foreign_Key_Int_Field('EVT_ID', __('Event ID', 'event_espresso'), false, 0, 'Event'), 'VNU_ID' => new EE_Foreign_Key_Int_Field('VNU_ID', __('Venue ID', 'event_espresso'), false, 0, 'Venue'), 'EVV_primary' => new EE_Boolean_Field('EVV_primary', __("Flag indicating venue is primary one for event", "event_espresso"), false, true)));
$this->_model_relations = array('Event' => new EE_Belongs_To_Relation(), 'Venue' => new EE_Belongs_To_Relation());
parent::__construct();
}
示例13: __construct
/**
* private constructor to prevent direct creation
* @Constructor
* @access private
* @param string $timezone string representing the timezone we want to set for returned Date Time Strings (and any incoming timezone data that gets saved). Note this just sends the timezone info to the date time model field objects. Default is NULL (and will be assumed using the set timezone in the 'timezone_string' wp option)
* @return void
*/
protected function __construct($timezone)
{
$this->singular_item = __('Ticket Template', 'event_espresso');
$this->plural_item = __('Ticket Templates', 'event_espresso');
$this->_tables = array('Ticket_Template' => new EE_Primary_Table('esp_ticket_template', 'TTM_ID'));
$this->_fields = array('Ticket_Template' => array('TTM_ID' => new EE_Primary_Key_Int_Field('TTM_ID', __('Ticket Template ID', 'event_espresso')), 'TTM_name' => new EE_Plain_Text_Field('TTM_name', __('The name of the ticket template', 'event_espresso'), false, ''), 'TTM_description' => new EE_Plain_Text_Field('TTM_description', __('The description for the ticket template', 'event_espresso'), true, ''), 'TTM_file' => new EE_Plain_Text_Field('TTM_file', __('The file name for the actual template file saved on disk', 'event_espresso'), true, '')));
$this->_model_relations = array('Ticket' => new EE_Has_Many_Relation());
parent::__construct($timezone);
}
示例14: __construct
/**
* private constructor to prevent direct creation
* @Constructor
* @access private
* @param string $timezone string representing the timezone we want to set for returned Date Time Strings (and any incoming timezone data that gets saved). Note this just sends the timezone info to the date time model field objects. Default is NULL (and will be assumed using the set timezone in the 'timezone_string' wp option)
* @return void
*/
protected function __construct($timezone)
{
$this->singular_item = __('Datetime Ticket', 'event_espresso');
$this->plural_item = __('Datetime Tickets', 'event_espresso');
$this->_tables = array('Datetime_Ticket' => new EE_Primary_Table('esp_datetime_ticket', 'DTK_ID'));
$this->_fields = array('Datetime_Ticket' => array('DTK_ID' => new EE_Primary_Key_Int_Field('DTK_ID', __('Datetime Ticket ID', 'event_espresso')), 'DTT_ID' => new EE_Foreign_Key_Int_Field('DTT_ID', __('The ID to the Datetime', 'event_espresso'), false, 0, 'Datetime'), 'TKT_ID' => new EE_Foreign_Key_Int_Field('TKT_ID', __('The ID to the Ticket', 'event_espresso'), false, 0, 'Ticket')));
$this->_model_relations = array('Ticket' => new EE_Belongs_To_Relation(), 'Datetime' => new EE_Belongs_To_Relation());
parent::__construct($timezone);
}
示例15: __construct
protected function __construct()
{
$this->singular_item = __('Country', 'event_espresso');
$this->plural_item = __('Countries', 'event_espresso');
$this->_tables = array('Country' => new EE_Primary_Table('esp_country', 'CNT_ISO'));
$this->_fields = array('Country' => array('CNT_active' => new EE_Boolean_Field('CNT_active', __('Country Appears in Dropdown Select Lists', 'event_espresso'), false, true), 'CNT_ISO' => new EE_Primary_Key_String_Field('CNT_ISO', __('Country ISO Code', 'event_espresso')), 'CNT_ISO3' => new EE_All_Caps_Text_Field('CNT_ISO3', __('Country ISO3 Code', 'event_espresso'), false, ''), 'RGN_ID' => new EE_All_Caps_Text_Field('RGN_ID', __('Region ID', 'event_espresso'), false, 0), 'CNT_name' => new EE_Plain_Text_Field('CNT_name', __('Country Name', 'event_espresso'), false, ''), 'CNT_cur_code' => new EE_All_Caps_Text_Field('CNT_cur_code', __('Country Currency Code', 'event_espresso'), false), 'CNT_cur_single' => new EE_Plain_Text_Field('CNT_cur_single', __('Currency Name Singular', 'event_espresso'), false), 'CNT_cur_plural' => new EE_Plain_Text_Field('CNT_cur_plural', __('Currency Name Plural', 'event_espresso'), false), 'CNT_cur_sign' => new EE_Plain_Text_Field('CNT_cur_sign', __('Currency Sign', 'event_espresso'), false), 'CNT_cur_sign_b4' => new EE_Boolean_Field('CNT_cur_sign_b4', __('Currency Sign Before Number', 'event_espresso'), false, true), 'CNT_cur_dec_plc' => new EE_Integer_Field('CNT_cur_dec_plc', __('Currency Decimal Places', 'event_espresso'), false, 2), 'CNT_cur_dec_mrk' => new EE_Plain_Text_Field('CNT_cur_dec_mrk', __('Currency Decimal Mark', 'event_espresso'), false, '.'), 'CNT_cur_thsnds' => new EE_Plain_Text_Field('CNT_cur_thsnds', __('Currency Thousands Seperator', 'event_espresso'), false, ','), 'CNT_tel_code' => new EE_Plain_Text_Field('CNT_tel_code', __('Country Telephone Code', 'event_espresso'), false, ''), 'CNT_is_EU' => new EE_Boolean_Field('CNT_is_EU', __('Country is Member of EU', 'event_espresso'), false, false)));
$this->_model_relations = array('Attendee' => new EE_Has_Many_Relation(), 'State' => new EE_Has_Many_Relation(), 'Venue' => new EE_Has_Many_Relation());
parent::__construct();
}