本文整理汇总了PHP中DataObject::DataObject方法的典型用法代码示例。如果您正苦于以下问题:PHP DataObject::DataObject方法的具体用法?PHP DataObject::DataObject怎么用?PHP DataObject::DataObject使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DataObject
的用法示例。
在下文中一共展示了DataObject::DataObject方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: Group
/**
* Constructor
*
* @param object DB row
*/
function Group($db_row = NULL)
{
// Call parent constructor:
parent::DataObject('T_groups', 'grp_', 'grp_ID');
if ($db_row == NULL) {
// echo 'Creating blank group';
$this->set('name', T_('New group'));
$this->set('perm_blogs', 'user');
$this->set('perm_stats', 'none');
} else {
// echo 'Instanciating existing group';
$this->ID = $db_row->grp_ID;
$this->name = $db_row->grp_name;
$this->level = $db_row->grp_level;
$this->perm_blogs = $db_row->grp_perm_blogs;
$this->perm_bypass_antispam = $db_row->grp_perm_bypass_antispam;
$this->perm_xhtmlvalidation = $db_row->grp_perm_xhtmlvalidation;
$this->perm_xhtmlvalidation_xmlrpc = $db_row->grp_perm_xhtmlvalidation_xmlrpc;
$this->perm_xhtml_css_tweaks = $db_row->grp_perm_xhtml_css_tweaks;
$this->perm_xhtml_iframes = $db_row->grp_perm_xhtml_iframes;
$this->perm_xhtml_javascript = $db_row->grp_perm_xhtml_javascript;
$this->perm_xhtml_objects = $db_row->grp_perm_xhtml_objects;
$this->perm_stats = $db_row->grp_perm_stats;
}
}
示例2: Link
/**
* Constructor
*
* @param table Database row
*/
function Link($db_row = NULL)
{
// Call parent constructor:
parent::DataObject('T_links', 'link_', 'link_ID', 'datecreated', 'datemodified', 'creator_user_ID', 'lastedit_user_ID');
if ($db_row != NULL) {
$this->ID = $db_row->link_ID;
$this->ltype_ID = $db_row->link_ltype_ID;
// source of link:
if ($db_row->link_itm_ID != NULL) {
// Item
$this->LinkOwner =& get_link_owner('item', $db_row->link_itm_ID);
} elseif ($db_row->link_cmt_ID != NULL) {
// Comment
$this->LinkOwner =& get_link_owner('comment', $db_row->link_cmt_ID);
} else {
// User
$this->LinkOwner =& get_link_owner('user', $db_row->link_usr_ID);
}
$this->file_ID = $db_row->link_file_ID;
// TODO: dh> deprecated, check where it's used, and fix it.
$this->File =& $this->get_File();
$this->position = $db_row->link_position;
$this->order = $db_row->link_order;
} else {
// New object:
}
}
示例3: Group
/**
* Constructor
*
* @param object DB row
*/
function Group($db_row = NULL)
{
// Call parent constructor:
parent::DataObject('T_groups', 'grp_', 'grp_ID');
$this->delete_restrictions = array(array('table' => 'T_users', 'fk' => 'user_grp_ID', 'msg' => T_('%d users in this group')));
$this->delete_cascades = array();
if ($db_row == NULL) {
// echo 'Creating blank group';
$this->set('name', T_('New group'));
$this->set('perm_blogs', 'user');
$this->set('perm_stats', 'none');
} else {
// echo 'Instanciating existing group';
$this->ID = $db_row->grp_ID;
$this->name = $db_row->grp_name;
$this->perm_blogs = $db_row->grp_perm_blogs;
$this->perm_bypass_antispam = $db_row->grp_perm_bypass_antispam;
$this->perm_xhtmlvalidation = $db_row->grp_perm_xhtmlvalidation;
$this->perm_xhtmlvalidation_xmlrpc = $db_row->grp_perm_xhtmlvalidation_xmlrpc;
$this->perm_xhtml_css_tweaks = $db_row->grp_perm_xhtml_css_tweaks;
$this->perm_xhtml_iframes = $db_row->grp_perm_xhtml_iframes;
$this->perm_xhtml_javascript = $db_row->grp_perm_xhtml_javascript;
$this->perm_xhtml_objects = $db_row->grp_perm_xhtml_objects;
$this->perm_stats = $db_row->grp_perm_stats;
}
}
示例4: Meeting
function Meeting()
{
parent::DataObject();
$this->meetingAttendances = array();
$this->removedMeetingAttendances = array();
$this->meetingSectionDecisions = array();
$this->removedMeetingSectionDecisions = array();
}
示例5: Citation
/**
* Constructor.
* @param $rawCitation string an unparsed citation string
*/
function Citation($rawCitation = null)
{
// Switch on meta-data adapter support.
$this->setHasLoadableAdapters(true);
parent::DataObject();
$this->setRawCitation($rawCitation);
// this will set state to CITATION_RAW
}
示例6: ItemTag
/**
* Constructor
*
* @param object table Database row
*/
function ItemTag($db_row = NULL)
{
// Call parent constructor:
parent::DataObject('T_items__tag', 'tag_', 'tag_ID');
if ($db_row != NULL) {
$this->ID = $db_row->tag_ID;
$this->name = $db_row->tag_name;
}
}
示例7: ItemType
/**
* Constructor
*
*
* @param table Database row
*/
function ItemType($db_row = NULL)
{
// Call parent constructor:
parent::DataObject('T_items__type', 'ptyp_', 'ptyp_ID');
$this->delete_restrictions = array(array('table' => 'T_ityp_col', 'fk' => 'itco_ityp_ID', 'msg' => T_('%d related collections')), array('table' => 'T_items__item', 'fk' => 'post_ptyp_ID', 'msg' => T_('%d related items')));
if ($db_row != NULL) {
$this->ID = $db_row->ptyp_ID;
$this->name = $db_row->ptyp_name;
}
}
示例8: ItemStatus
/**
* Constructor
*
*
* @param table Database row
*/
function ItemStatus($db_row = NULL)
{
// Call parent constructor:
parent::DataObject('T_items__status', 'pst_', 'pst_ID');
// Allow inseting specific IDs
$this->allow_ID_insert = true;
if ($db_row != NULL) {
$this->ID = $db_row->pst_ID;
$this->name = $db_row->pst_name;
}
}
示例9: Organization
/**
* Constructor
*
* @param object DB row
*/
function Organization($db_row = NULL)
{
// Call parent constructor:
parent::DataObject('T_users__organization', 'org_', 'org_ID');
if ($db_row != NULL) {
// Loading an object from DB:
$this->ID = $db_row->org_ID;
$this->name = $db_row->org_name;
$this->url = $db_row->org_url;
}
}
示例10: Slug
/**
* Constructor
*
* @param object table Database row
*/
function Slug($db_row = NULL)
{
// Call parent constructor:
parent::DataObject('T_slug', 'slug_', 'slug_ID');
if ($db_row != NULL) {
$this->ID = $db_row->slug_ID;
$this->title = $db_row->slug_title;
$this->type = $db_row->slug_type;
$this->itm_ID = $db_row->slug_itm_ID;
}
}
示例11: Submission
/**
* Constructor.
*/
function Submission()
{
parent::DataObject();
$this->authors = array();
$this->removedAuthors = array();
$this->sources = array();
$this->removedSources = array();
$this->abstracts = array();
$this->removedAbstracts = array();
$this->proposalDetailsDAO =& DAORegistry::getDAO('ProposalDetailsDAO');
}
示例12: Domain
/**
* Constructor
*
* @param object table Database row
*/
function Domain($db_row = NULL)
{
// Call parent constructor:
parent::DataObject('T_basedomains', 'dom_', 'dom_ID');
if ($db_row != NULL) {
$this->ID = $db_row->dom_ID;
$this->name = $db_row->dom_name;
$this->status = $db_row->dom_status;
$this->type = $db_row->dom_type;
}
}
示例13: Citation
/**
* Constructor.
* @param $rawCitation string an unparsed citation string
*/
function Citation($rawCitation = null)
{
parent::DataObject();
// Add NLM meta-data adapter.
// FIXME: This will later be done via plugin/user-configurable settings,
// see comment in DataObject::DataObject().
$metadataAdapter = new NlmCitationSchemaCitationAdapter();
$this->addSupportedMetadataAdapter($metadataAdapter);
$this->setRawCitation($rawCitation);
// this will set state to CITATION_RAW
}
示例14: Mail
/**
* Constructor.
*/
function Mail()
{
parent::DataObject();
$this->privateParams = array();
if (Config::getVar('email', 'allow_envelope_sender')) {
$defaultEnvelopeSender = Config::getVar('email', 'default_envelope_sender');
if (!empty($defaultEnvelopeSender)) {
$this->setEnvelopeSender($defaultEnvelopeSender);
}
}
}
示例15: Currency
/**
* Constructor
*
* @param object database row
*/
function Currency($db_row = NULL)
{
// Call parent constructor:
parent::DataObject('T_regional__currency', 'curr_', 'curr_ID');
if ($db_row) {
$this->ID = $db_row->curr_ID;
$this->code = $db_row->curr_code;
$this->shortcut = $db_row->curr_shortcut;
$this->name = $db_row->curr_name;
$this->enabled = $db_row->curr_enabled;
}
}