Example #1
0
 public function __construct()
 {
     parent::__construct();
     $query = $this->_db->select()->from('INFORMATION_SCHEMA.TABLES', 'AUTO_INCREMENT')->where('TABLE_NAME = ?', $this->_oDataTableName)->where('TABLE_SCHEMA = ?', $this->_schema);
     $increment = $this->_db->fetchAll($query);
     $this->_currentId = $increment['0']['AUTO_INCREMENT'];
 }
Example #2
0
 function __construct($tablename = 'eng_work_schedules')
 {
     // Register non-persistent attributes
     // Contruct the object
     parent::__construct($tablename);
     // Set specific characteristics
     $this->idField = 'id';
     // See Factory - identifierField is used to generate next number
     $this->identifierField = array('job_no', 'description');
     $this->orderby = 'job_no';
     $this->setTitle('work_schedules');
     // Define relationships
     $this->BelongsTo('MFCentre', 'centre_id', 'centre');
     $this->BelongsTo('MFDowntimeCode', 'mf_downtime_code_id', 'downtime_code');
     $this->hasMany('EngineeringResource', 'resources', 'work_schedule_id');
     $this->hasMany('WorkScheduleNote', 'notes', 'work_schedule_id');
     //		$this->hasMany('WorkSchedulePart','parts', 'work_schedule_id');
     $this->hasMany('STTransaction', 'transactions', 'process_id');
     // Define field formats
     // Define field defaults
     $this->getField('status')->setDefault('N');
     // Define validation
     $this->validateUniquenessOf('job_no');
     // Define enumerated types
     $this->setEnum('status', array($this->_status_new => 'New', $this->_status_active => 'Active', $this->_status_complete => 'Complete', $this->_status_cancelled => 'Cancelled'));
     // Define link rules for sidebar related view
     // disallow adding new transactions
     $this->linkRules = array('transactions' => array('newtab' => array('new' => true), 'actions' => array('link'), 'rules' => array()));
 }
 public function __construct($record = null, $isSingleton = false, $model = null)
 {
     parent::__construct($record, $isSingleton, $model);
     if ($this->getIdentifier() === 0) {
         $this->Created = MySQLDatabase56::nowRfc2822();
     }
 }
 function __construct(sqlConnect $conx = NULL, $table_name = "")
 {
     parent::__construct($conx, $table_name);
     if (RADRIA_LOG_RUN_OFUZ) {
         $this->setLogRun(OFUZ_LOG_RUN_MESSAGE);
     }
 }
 /**
  * Class constructor
  * 
  * @param array $options
  *
  * @return void
  */
 public function __construct($options = null)
 {
     parent::__construct();
     $this->_oData = new $this->_dataClass();
     $this->_dataTableName = $this->_oData->info('name');
     $this->_updateParams = $options;
 }
Example #6
0
 public function __construct()
 {
     $this->_baseUrl = Zend_Controller_Front::getInstance()->getBaseUrl();
     parent::__construct();
     $query = $this->_db->select()->from('INFORMATION_SCHEMA.TABLES', 'AUTO_INCREMENT')->where($this->_db->quoteInto('TABLE_NAME = ?', 'Form_Element') . ' OR ' . $this->_db->quoteInto('TABLE_NAME = ?', 'Form_Question'))->where('TABLE_SCHEMA = ?', $this->_schema);
     $this->_increments = $this->_db->fetchAll($query);
 }
Example #7
0
 function __construct($tablename = 'so_despatchlines')
 {
     // Register non-persistent attributes
     // Contruct the object
     parent::__construct($tablename);
     // Set specific characteristics
     $this->idField = 'id';
     $this->orderby = array('despatch_number', 'orderline_id');
     $this->orderdir = 'DESC';
     // Define relationships
     $this->belongsTo('SOrder', 'order_id', 'order_number');
     $this->belongsTo('SOrderLine', 'orderline_id', 'order_line');
     $this->belongsTo('SLCustomer', 'slmaster_id', 'customer');
     $this->belongsTo('SOProductline', 'productline_id', 'description');
     $this->belongsTo('STuom', 'stuom_id', 'uom_name');
     $this->belongsTo('STItem', 'stitem_id', 'stitem');
     $this->hasOne('WHAction', 'despatch_action', 'despatch_from');
     $this->hasOne('SOrderLine', 'orderline_id', 'order_line_detail');
     // Define field formats
     // Define formatters
     // Define validation
     // Define enumerated types
     $this->setEnum('status', array('N' => 'New', 'D' => 'Despatched', 'X' => 'Cancelled'));
     // Define rules for related items links
     // Define system defaults
 }
Example #8
0
 function __construct($tablename = 'project_categories')
 {
     parent::__construct($tablename);
     $this->idField = 'id';
     $this->identifierField = 'name';
     $this->validateUniquenessOf('id');
 }
Example #9
0
 function __construct($tablename = 'gl_account_centres')
 {
     // Register non-persistent attributes
     // Construct the object
     parent::__construct($tablename);
     // Set specific characteristics
     $this->identifierField = 'glaccount ||\'/\'|| glcentre';
     // Set ordering attributes
     // Define validation
     // Define relationships
     $this->belongsTo('GLAccount', 'glaccount_id', 'glaccount');
     $this->belongsTo('GLCentre', 'glcentre_id', 'glcentre');
     $this->hasMany('Currency', 'currencies', array('writeoff_glaccount_id', 'glcentre_id'), array('glaccount_id', 'glcentre_id'), FALSE);
     $this->hasMany('CBAccount', 'cb_accounts', array('glaccount_id', 'glcentre_id'), array('glaccount_id', 'glcentre_id'), FALSE);
     $this->hasMany('WHLocation', 'wh_locations', array('glaccount_id', 'glcentre_id'), array('glaccount_id', 'glcentre_id'), FALSE);
     $this->hasMany('PeriodicPayment', 'periodic_payments', 'glaccount_centre_id', NULL, FALSE);
     $this->hasMany('PInvoiceLine', 'pi_lines', 'glaccount_centre_id', NULL, FALSE);
     $this->hasMany('POrderLine', 'po_lines', 'glaccount_centre_id', NULL, FALSE);
     $this->hasMany('SInvoiceLine', 'si_lines', 'glaccount_centre_id', NULL, FALSE);
     $this->hasMany('SOrderLine', 'so_lines', 'glaccount_centre_id', NULL, FALSE);
     // Define field formats
     // Define enumerated types
     // Define system defaults
     // Define related item rules
 }
Example #10
0
 function __construct($tablename = 'project_notes')
 {
     parent::__construct($tablename);
     $this->idField = 'id';
     $this->belongsTo('Project', 'project_id', 'project');
     $this->belongsTo('ProjectNoteType', 'type_id', 'type');
 }
Example #11
0
 public function __construct($tablename = 'po_product_lines_header')
 {
     // Register non-persistent attributes
     // Contruct the object
     parent::__construct($tablename);
     // Set specific characteristics
     $this->idField = 'id';
     $this->identifierField = 'description';
     $this->orderby = 'description';
     $this->setTitle('PO Product');
     // Define relationships
     $this->belongsTo('STItem', 'stitem_id', 'stitem');
     $this->belongsTo('STuom', 'stuom_id', 'uom_name');
     $this->belongsTo('GLAccount', 'glaccount_id', 'gl_account');
     $this->belongsTo('GLCentre', 'glcentre_id', 'gl_centre');
     $this->belongsTo('TaxRate', 'tax_rate_id', 'tax_rate');
     $this->belongsTo('STProductgroup', 'prod_group_id', 'product_group');
     $this->hasOne('STItem', 'stitem_id', 'item_detail');
     $this->hasMany('POProductLine', 'lines', 'productline_header_id');
     // Define field formats
     // set formatters
     // Define validation
     $this->validateUniquenessOf('stitem_id', NULL, TRUE);
     $this->validateUniquenessOf('description');
     // Define enumerated types
     // set defaults
     // Set link rules for 'belongs to' to appear in related view controller sidebar
 }
Example #12
0
 function __construct($tablename = 'party')
 {
     parent::__construct($tablename);
     $this->idField = 'id';
     $this->hasMany('PartyContactMethod', 'contactmethods', 'party_id', null, TRUE);
     $this->hasMany('PartyAddress', 'addresses', 'party_id', null, TRUE);
     $cc = new ConstraintChain();
     $cc->add(new Constraint('main', '=', 'true'));
     $this->setAlias('main_address', 'PartyAddress', $cc, 'main_address', array('street1', 'street2', 'street3', 'town', 'county', 'postcode', 'country'), 'party_id');
     $cc = new ConstraintChain();
     $cc->add(new Constraint('main', '=', 'true'));
     $cc->add(new Constraint('type', '=', 'T'));
     $this->setAlias('phone', 'PartyContactMethod', $cc, 'contact', array(), 'party_id');
     $cc = new ConstraintChain();
     $cc->add(new Constraint('main', '=', 'true'));
     $cc->add(new Constraint('type', '=', 'M'));
     $this->setAlias('mobile', 'PartyContactMethod', $cc, 'contact', array(), 'party_id');
     $cc = new ConstraintChain();
     $cc->add(new Constraint('main', '=', 'true'));
     $cc->add(new Constraint('type', '=', 'F'));
     $this->setAlias('fax', 'PartyContactMethod', $cc, 'contact', array(), 'party_id');
     $cc = new ConstraintChain();
     $cc->add(new Constraint('main', '=', 'true'));
     $cc->add(new Constraint('type', '=', 'E'));
     $this->setAlias('email', 'PartyContactMethod', $cc, 'contact', array(), 'party_id');
 }
Example #13
0
 function __construct($tablename = 'uzlet_modules')
 {
     parent::__construct($tablename);
     $this->idField = 'id';
     $this->belongsTo('Uzlet', 'uzlet_id', 'uzlet');
     $this->hasOne('ModuleObject', 'module_id', 'module');
 }
Example #14
0
 function __construct($tablename = 'ticket_module_versions')
 {
     parent::__construct($tablename);
     $this->idField = 'id';
     $this->orderby = array('module', 'version');
     $this->belongsTo('Ticket', 'ticket_id');
 }
Example #15
0
 public function __construct($path = '')
 {
     $this->path = $path;
     parent::__construct('file');
     $this->idField = 'id';
     $this->getField('size')->setFormatter(new FilesizeFormatter());
 }
Example #16
0
 function __construct($tablename = 'curate')
 {
     parent::__construct($tablename);
     $this->idField = 'id';
     $this->validateUniquenessOf(array('date', 'rate'));
     $this->belongsTo('Currency', 'currency_id', 'currency');
 }
Example #17
0
 function __construct($tablename = 'ar_master')
 {
     // Register non-persistent attributes
     // Contruct the object
     parent::__construct($tablename);
     // Set specific characteristics
     $this->idField = 'id';
     $this->identifierField = 'code';
     $this->orderby = 'code';
     // Define validation
     $this->validateUniquenessOf('code');
     // Define relationships
     $this->belongsTo('ARAnalysis', 'aranalysis_id', 'aranalysis');
     $this->belongsTo('ARGroup', 'argroup_id', 'argroup');
     $this->belongsTo('ARLocation', 'arlocation_id', 'arlocation');
     $this->belongsTo('PLSupplier', 'plmaster_id', 'supplier');
     // Define field formats
     $params = DataObjectFactory::Factory('GLParams');
     $base_currency = $params->base_currency();
     $this->getField('residual_value')->setFormatter(new CurrencyFormatter($base_currency));
     $this->getField('purchase_price')->setFormatter(new CurrencyFormatter($base_currency));
     $this->getField('bfwd_value')->setFormatter(new CurrencyFormatter($base_currency));
     $this->getField('ty_depn')->setFormatter(new CurrencyFormatter($base_currency));
     $this->getField('td_depn')->setFormatter(new CurrencyFormatter($base_currency));
     $this->getField('wd_value')->setFormatter(new CurrencyFormatter($base_currency));
     // Define enumerated types
 }
Example #18
0
 function __construct($tablename = 'project_issue_lines')
 {
     parent::__construct($tablename);
     $this->idField = 'id';
     $this->belongsTo('User', 'completed_by', 'completedby');
     $this->hasOne('ProjectIssueHeader', 'header_id', 'header');
 }
Example #19
0
 public function __construct($code)
 {
     $code = CampaignDbTables::getRealCode($code);
     parent::__construct("cpn_{$code}_media");
     // 主キー列
     $field =& $this->addField(new DataField('teikei_media_id'));
     $field->setPrimaryKey();
     $field->setMainteField();
     // データ列
     $this->addField(new DataField('anken_id'));
     $this->addField(new DataField('media_id'));
     $this->addField(new DataField('media_url'));
     $this->addField(new DataField('media_url2'));
     $this->addField(new DataField('redirect_url'));
     $this->addField(new DataField('price'));
     $this->addField(new DataField('oroshi_price'));
     $this->addField(new DataField('extra_price'));
     $this->addField(new DataField('extra_oroshi'));
     $this->addField(new DataField('teikei_from'));
     $this->addField(new DataField('teikei_to'));
     $this->addField(new DataField('download_flag'));
     $this->addField(new DataField('free1_cd'));
     // メンテナンス列
     $field =& $this->addField(new DataField('upd_time'));
     $field->setMainteField();
     $field =& $this->addField(new DataField('upd_user_id'));
     $field->setMainteField();
     //		$field =& $this->addField(new DataField('del_flg'));
     //		$field->setMainteField();
 }
Example #20
0
 function __construct($tablename = 'calendar_event_attendees')
 {
     parent::__construct($tablename);
     $this->idField = 'id';
     $this->belongsTo('Event', 'calendar_event_id', 'calendar');
     $this->belongsTo('Person', 'person_id', 'person');
 }
Example #21
0
 public function __construct($tablename = 'expenses_lines')
 {
     // Register non-persistent attributes
     // Contruct the object
     parent::__construct($tablename);
     // Set specific characteristics
     // Define relationships
     $this->hasOne('Expense', 'expenses_header_id', 'expense_header');
     $this->belongsTo('Currency', 'currency_id', 'currency');
     $this->belongsTo('Currency', 'twin_currency_id', 'twin');
     $this->belongsTo('GLAccount', 'glaccount_id', 'glaccount');
     $this->belongsTo('GLCentre', 'glcentre_id', 'glcentre');
     $this->belongsTo('TaxRate', 'tax_rate_id', 'tax_rate');
     // Define field formats
     $params = DataObjectFactory::Factory('GLParams');
     $base_currency = $params->base_currency();
     $this->getField('base_net_value')->setFormatter(new CurrencyFormatter($base_currency));
     $this->getField('base_tax_value')->setFormatter(new CurrencyFormatter($base_currency));
     $this->getField('base_gross_value')->setFormatter(new CurrencyFormatter($base_currency));
     // Define field defaults
     $this->getField('net_value')->setDefault('0.00');
     $this->getField('tax_value')->setDefault('0.00');
     $this->getField('gross_value')->setDefault('0.00');
     // Define validation
     $this->validateUniquenessOf(array('expenses_header_id', 'line_number'));
     // Define enumerated types
 }
Example #22
0
 function __construct($tablename = 'cb_transactions')
 {
     // Register non-persistent attributes
     // Contruct the object
     parent::__construct($tablename);
     // Set specific characteristics
     $this->idField = 'id';
     $this->orderby = 'transaction_date';
     $this->orderdir = 'DESC';
     // Define relationships
     $this->belongsTo('CBAccount', 'cb_account_id', 'cb_account');
     $this->belongsTo('Company', 'company_id', 'company');
     $this->belongsTo('Person', 'person_id', 'person', null, 'surname || \', \' || firstname');
     $this->belongsTo('Currency', 'currency_id', 'currency');
     $this->belongsTo('Currency', 'twin_currency_id', 'twincurrency');
     $this->belongsTo('Currency', 'basecurrency_id', 'basecurrency');
     $this->belongsTo('PaymentType', 'payment_type_id', 'payment_type');
     $this->belongsTo('TaxRate', 'tax_rate_id', 'tax_rate');
     $this->hasOne('CBAccount', 'cb_account_id', 'cb_account_detail');
     // Define enumerated types
     $this->setEnum('source', array('C' => 'Cash Book', 'E' => 'Expenses', 'G' => 'General Ledger', 'P' => 'Purchase Ledger', 'S' => 'Sales Ledger'));
     $this->setEnum('status', array('N' => 'New', 'R' => 'Reconciled'));
     $this->setEnum('type', array('P' => 'Payment', 'R' => 'Receipt', 'RP' => 'Refund Payment', 'RR' => 'Refund Receipt', 'T' => 'Transfer'));
     // Define system defaults
     $this->getField('net_value')->setDefault('0.00');
     // Define validation
     $this->getField('gross_value')->addValidator(new ValueValidator('0', '<>'));
 }
Example #23
0
 function __construct($tablename = 'ticket_severities')
 {
     parent::__construct($tablename);
     $this->idField = 'id';
     $this->orderby = 'index';
     $this->hasMany('Ticket', 'ticket_severity_id');
 }
Example #24
0
 function __construct($tablename = 'person_contact_methods')
 {
     parent::__construct($tablename);
     $this->idField = 'id';
     $this->identifierField = 'name';
     $this->belongsTo('Person', 'person_id', 'person');
 }
Example #25
0
 public function __construct()
 {
     parent::__construct();
     $this->priority = 0;
     $this->position = self::WIDGET_NO_POSITION;
     $this->activate = 0;
 }
Example #26
0
 function __construct($tablename = 'reports')
 {
     parent::__construct($tablename);
     $this->idField = 'id';
     $this->identifierField = 'tablename';
     $this->orderby = 'description';
 }
 /**
  * Constructor
  *
  * @param array $record
  * @param bool $isSingleton
  */
 function __construct($record = null, $isSingleton = false)
 {
     // Extract data from legacy Data field (backwards-compatibility)
     if ($record) {
         if ($record['ID'] > 0) {
             $record = (array) $record;
             // Extract data from Data
             if (!empty($record['Data'])) {
                 if ($data = unserialize($record['Data'])) {
                     $setData = true;
                     foreach (array_keys($data) as $fieldname) {
                         if (array_key_exists($fieldname, $record)) {
                             if ($record[$fieldname] != null) {
                                 // Object has been saved in the new version, do not set data
                                 $setData = false;
                                 break;
                             }
                         }
                     }
                     if ($setData) {
                         // Object has not been saved in the new version, set data
                         foreach ($data as $fieldname => $value) {
                             $record[$fieldname] = $value;
                         }
                     }
                 }
             }
         }
     }
     parent::__construct($record, $isSingleton);
 }
Example #28
0
 function __construct($tablename = 'po_product_lines')
 {
     // Register non-persistent attributes
     // Contruct the object
     parent::__construct($tablename);
     // Set specific characteristics
     $this->idField = 'id';
     $this->identifierField = 'description';
     $this->orderby = 'description';
     $this->setTitle('PO Product Line');
     // Define relationships
     $this->belongsTo('PLSupplier', 'plmaster_id', 'supplier');
     $this->belongsTo('Currency', 'currency_id', 'currency');
     $this->belongsTo('GLAccount', 'glaccount_id', 'glaccount');
     $this->belongsTo('GLCentre', 'glcentre_id', 'glcentre');
     $this->belongsTo('POProductlineHeader', 'productline_header_id', 'product');
     $this->hasOne('POProductlineHeader', 'productline_header_id', 'product_detail');
     // Define field formats
     // set formatters
     // set validators
     // Define enumerated types
     // set defaults
     $this->getField('price')->setFormatter(new PriceFormatter());
     $params = DataObjectFactory::Factory('GLParams');
     $this->getField('currency_id')->setDefault($params->base_currency());
     // Set link rules for 'belongs to' to appear in related view controller sidebar
 }
Example #29
0
 function __construct($tablename = 'tax_statuses')
 {
     parent::__construct($tablename);
     $this->idField = 'id';
     $this->identifierField = 'description';
     $this->validateUniquenessOf('description');
 }
Example #30
0
 /**
  * Constructor. Overwrites some basic attributes.
  *
  * @param array $record      Record to fill Object with
  * @param bool  $isSingleton Is this a singleton?
  * 
  * @return void
  *
  * @author Sebastian Diel <*****@*****.**>
  * @since 05.06.2012
  */
 public function __construct($record = null, $isSingleton = false)
 {
     parent::__construct($record, $isSingleton);
     if ($this->Image()->exists()) {
         $this->Image()->Title = $this->Title;
     }
 }