function __construct($id, $name, $person, $telephone, $email, $address, $bal) { $this->person = $person; $type = new PartyType('Supplier'); $this->balance = new Money(floatval($bal), Currency::Get('KES')); parent::__construct($type, $id, $name, $telephone, $email, $address); }
function __construct($id, $name, $telephone, $idno, $email, $address, $bal, $details) { $type = new PartyType('Client'); $this->idno = $idno; $this->balance = new Money(floatval($bal), Currency::Get('KES')); $this->details = $details; parent::__construct($type, $id, $name, $telephone, $email, $address); }
function __construct($id, $name, $telephone, $email, $address, $gender, $department, $position, $salary, $bal) { $type = new PartyType('Employee'); $this->balance = new Money(floatval($bal), Currency::Get('KES')); $this->salary = new Money(floatval($salary), Currency::Get('KES')); $this->gender = $gender; $this->department = $department; $this->position = $position; parent::__construct($type, $id, $name, $telephone, $email, $address); }
function __construct($tablename = 'company') { // Register non-persistent attributes // Construct the object parent::__construct($tablename); $this->idField = 'id'; // Set specific characteristics $this->subClass = true; $this->fkField = 'party_id'; $this->orderby = 'name'; $this->identifier = 'name'; $this->identifierField = 'name'; // Define validation $this->validateUniquenessOf('accountnumber'); $this->validateUniquenessOf('name'); // Define relationships $this->hasMany('PartyContactMethod', 'contactmethods', 'party_id', 'party_id'); $this->hasMany('PartyAddress', 'addresses', 'party_id', 'party_id'); $this->hasMany('PartyAddress', 'mainaddress', 'party_id', 'party_id'); $this->belongsTo('User', 'assigned', 'assigned_to'); $this->belongsTo('Company', 'parent_id', 'company_parent'); $this->belongsTo('CompanyClassification', 'classification_id', 'company_classification'); $this->belongsTo('CompanyIndustry', 'industry_id', 'company_industry'); $this->belongsTo('CompanyRating', 'rating_id', 'company_rating'); $this->belongsTo('CompanySource', 'source_id', 'company_source'); $this->belongsTo('CompanyStatus', 'status_id', 'company_status'); $this->belongsTo('CompanyType', 'type_id', 'company_type'); $this->addValidator(new DistinctValidator(array('id', 'parent_id'), 'Account cannot be it\'s own parent')); $this->actsAsTree('parent_id'); $this->setParent(); $this->hasOne('Party', 'party_id', 'party'); $this->hasMany('Person', 'people'); $this->hasMany('Opportunity', 'opportunities'); $this->hasMany('Project', 'projects'); $this->hasMany('Activity', 'activities'); $this->hasMany('CompanyInCategories', 'categories'); // Define field formats $this->getField('website')->setFormatter(new URLFormatter()); $this->getField('website')->type = 'html'; $system_prefs = SystemPreferences::instance(); $autoGenerate = $system_prefs->getPreferenceValue('auto-account-numbering', 'contacts'); if (!(empty($autoGenerate) && $autoGenerate === 'on')) { //$this->getField('accountnumber')->not_null=false; $this->_autohandlers['accountnumber'] = new AccountNumberHandler(); } else { $this->getField('accountnumber')->setnotnull(); } }
function __construct($tablename = 'person') { // Register non-persistent attributes // Contruct the object parent::__construct($tablename); // Set specific characteristics $this->idField = 'id'; $this->subClass = true; $this->fkField = 'party_id'; $this->orderby = array('surname', 'firstname'); $this->identifier = 'surname'; $this->identifierField = 'firstname || \' \' || surname'; $this->identifierFieldJoin = ', '; // Define relationships $this->hasMany('PartyContactMethod', 'contactmethods', 'party_id', 'party_id', null, TRUE); $this->hasMany('PartyAddress', 'addresses', 'party_id', 'party_id', null, TRUE); $this->hasMany('PartyAddress', 'mainaddress', 'party_id', 'party_id'); $this->belongsTo('Company', 'company_id', 'company'); $this->belongsTo('User', 'alteredby', 'last_altered_by'); $this->belongsTo('User', 'assigned_to', 'person_assigned_to'); $this->hasOne('Party', 'party_id', 'party'); $this->hasOne('Company', 'company_id', 'companydetail'); $this->actsAsTree('reports_to'); $this->belongsTo('Person', 'reports_to', 'person_reports_to', null, 'surname || \', \' || firstname'); $this->belongsTo('Language', 'lang', 'language'); $this->setConcatenation('fullname', array('title', 'firstname', 'middlename', 'surname', 'suffix')); $this->setConcatenation('titlename', array('title', 'firstname', 'surname')); $this->hasMany('Opportunity', 'opportunities'); $this->hasMany('Project', 'projects'); $this->hasMany('Activity', 'activities'); // Define field formats $this->getField('jobtitle')->tag = prettify('job_title'); // Define validation // Define default values // Define enumerated types }
function __construct($id, $name, $telephone, $email, $address, $city, $country, $website, $contactId) { $type = new PartyType('Vendor'); parent::__construct($type, $id, $name, $telephone, $email, $address, $city, $country); $this->website = $website; //$this->contactPerson = Party::Get($contactId);//PartyType('Account Manager'); }
function __construct($id, $name, $telephone, $email, $address, $shipaddress) { $type = new PartyType('Customer'); parent::__construct($type, $name, $telephone, $email, $address); $this->shippingaddress = $shipaddress; }