• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP DataObjectFactory类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中DataObjectFactory的典型用法代码示例。如果您正苦于以下问题:PHP DataObjectFactory类的具体用法?PHP DataObjectFactory怎么用?PHP DataObjectFactory使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



在下文中一共展示了DataObjectFactory类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。

示例1: transactions

 public static function transactions($search_data = null, &$errors = array(), $defaults = null)
 {
     $search = new assetsSearch($defaults);
     $trans = DataObjectFactory::Factory('ARTransaction');
     // Search by Transaction Date
     $search->addSearchField('transaction_date', 'Transaction Date between', 'between', '', 'basic');
     // Search by Asset
     $search->addSearchField('armaster_id', 'Asset', 'select', 0, 'basic');
     $asset = DataObjectFactory::Factory('Asset');
     $options = array('0' => 'All');
     $assets = $asset->getAll();
     $options += $assets;
     $search->setOptions('armaster_id', $options);
     // Search by Transaction Type
     $search->addSearchField('transaction_type', 'Transaction Type', 'multi_select', array(''), 'advanced');
     $search->setOptions('transaction_type', $trans->getEnumOptions('transaction_type'));
     // Search by Group
     $search->addSearchField('to_group_id', 'Group', 'multi_select', array(0), 'advanced');
     $argroup = DataObjectFactory::Factory('ARGroup');
     $search->setOptions('to_group_id', $argroup->getAll());
     // Search by Location
     $search->addSearchField('to_location_id', 'Location', 'multi_select', array(0), 'advanced');
     $arlocation = DataObjectFactory::Factory('ARLocation');
     $search->setOptions('to_location_id', $arlocation->getAll());
     $search->setSearchData($search_data, $errors);
     return $search;
 }
开发者ID:uzerpllp,项目名称:uzerp,代码行数:27,代码来源:assetsSearch.php


示例2: setData

 function setData($bacs_reference, $payments, &$errors = array(), $data, $plpayment)
 {
     $this->bacs_reference = $bacs_reference;
     $this->payments = $payments;
     $this->plpayment = $plpayment;
     $account = DataObjectFactory::Factory('CBAccount');
     if (isset($data['cb_account_id'])) {
         $account->load($data['cb_account_id']);
     }
     $this->account = $account;
     $userPreferences = UserPreferences::instance(EGS_USERNAME);
     $defaultPrinter = $userPreferences->getPreferenceValue('default_printer', 'shared');
     $params = $data['print'];
     $print_params = array();
     $params['printer'] = empty($data['printer']) ? $defaultPrinter : $data['printer'];
     if (!$this->controller->setPrintParams($params, $print_params, $errors)) {
         $errors[] = 'Failed to set print parameters';
     }
     $year = date('y');
     $create_date = bcadd(date('z'), 1, 0);
     $this->create_date = $year . str_pad($create_date, 3, '0', STR_PAD_LEFT);
     $expiry_date = bcadd(date('z', strtotime($this->plpayment->payment_date)), 1, 0);
     $processing_date = bcadd(date('z', strtotime($this->getProcessDate($plpayment->payment_date))), 1, 0);
     $this->processing_date = $year . str_pad($processing_date, 3, '0', STR_PAD_LEFT);
     $this->expiry_date = $year . str_pad($expiry_date, 3, '0', STR_PAD_LEFT);
     if ($plpayment->override === 'f') {
         $this->validate(array('payment_date' => un_fix_date($plpayment->payment_date)), $errors);
         if ($this->processing_date <= $this->create_date) {
             $errors[] = 'Invalid Processing Date';
         }
     }
 }
开发者ID:uzerpllp,项目名称:uzerp,代码行数:32,代码来源:HSBC_BACS.php


示例3: _new

 public function _new($followup = FALSE)
 {
     if (array_key_exists('followup', $this->_data)) {
         $followup = $this->_data['followup'];
     }
     $this->view->set('page_title', 'New CRM Activity');
     // New follow-up activity
     if ($followup) {
         $this->view->set('page_title', 'New CRM Follow-up Activity');
         unset($this->_data['id']);
         $activity = new Activity();
         $activity->load($followup);
         $this->_data['person_id'] = $activity->person_id;
         $this->_data['company_id'] = $activity->company_id;
         $this->_data['name'] = $activity->name;
         $this->_data['description'] = $activity->description;
         $this->_data['completed'] = '';
     }
     // Edit existing activity
     if (isset($this->_data['id'])) {
         $this->view->set('page_title', 'Edit CRM Activity');
     }
     // New activity from opportunity
     if (isset($this->_data['opportunity_id'])) {
         $this->view->set('page_title', 'New CRM Activity');
         $opportunity = DataObjectFactory::Factory('Opportunity');
         $opportunity->load($this->_data['opportunity_id']);
         $this->_data['person_id'] = $opportunity->person_id;
         $this->_data['company_id'] = $opportunity->company_id;
     }
     parent::_new();
 }
开发者ID:uzerpllp,项目名称:uzerp,代码行数:32,代码来源:ActivitysController.php


示例4: getComponentId

 static function getComponentId($_module_name, $_component_name)
 {
     $module = ModuleObject::getModule($_module_name);
     $modulecomponent = DataObjectFactory::Factory(__CLASS__);
     $modulecomponent->loadBy(array('name', 'module_id'), array($_component_name, $module->id));
     return $modulecomponent->id;
 }
开发者ID:uzerpllp,项目名称:uzerp,代码行数:7,代码来源:ModuleComponent.php


示例5: __construct

 public function __construct($module = null, $action = null)
 {
     parent::__construct($module, $action);
     $this->_templateobject = DataObjectFactory::Factory('Personaddress');
     $this->uses($this->_templateobject);
     $this->related['person'] = array('clickaction' => 'edit');
 }
开发者ID:uzerpllp,项目名称:uzerp,代码行数:7,代码来源:PersonaddresssController.php


示例6: workSchedules

 public static function workSchedules($search_data = null, &$errors, $defaults = null)
 {
     $search = new EngineeringSearch($defaults);
     // Search on Job Number
     $search->addSearchField('job_no', 'job_number', 'equal');
     // Search on Job Number
     $search->addSearchField('description', 'description', 'contains');
     // Search on Status
     $search->addSearchField('status', 'status', 'multi_select', array('A'));
     $project = DataObjectFactory::Factory('WorkSchedule');
     $options = array('' => 'All');
     $statuses = $project->getEnumOptions('status');
     $options += $statuses;
     $search->setOptions('status', $options);
     // Search on Work Centre
     $search->addSearchField('centre_id', 'centre', 'select', '', 'advanced');
     $centre = DataObjectFactory::Factory('MFCentre');
     $centres = $centre->getAll();
     $options = array('' => 'all');
     $options += $centres;
     $search->setOptions('centre_id', $options);
     // Search on Downtime Code
     $search->addSearchField('mf_downtime_code_id', 'Downtime Code', 'select', '', 'advanced');
     $downtimecode = DataObjectFactory::Factory('MFDowntimeCode');
     $downtimecodes = $downtimecode->getAll();
     $options = array('' => 'all');
     $options += $downtimecodes;
     $search->setOptions('mf_downtime_code_id', $options);
     $search->setSearchData($search_data, $errors, workSchedules);
     return $search;
 }
开发者ID:uzerpllp,项目名称:uzerp,代码行数:31,代码来源:EngineeringSearch.php


示例7: getvalue

 function getvalue()
 {
     $model = $this->get_model();
     if ($this->idField == $this->fieldname) {
         $cc = new ConstraintChain();
         if (substr($this->value, -1) == ')') {
             $cc->add(new Constraint($model->idField, 'IN', $this->value));
         } else {
             $cc->add(new Constraint($model->idField, '=', $this->value));
         }
         $values = $model->getAll($cc);
         if (count($values) > 0) {
             return implode(',', $values);
         }
     } elseif (isset($model->belongsToField[$this->fieldname])) {
         if ($this->value === "'NULL'") {
             return 'NULL';
         }
         $fk = DataObjectFactory::Factory($model->belongsTo[$model->belongsToField[$this->fieldname]]['model']);
         $fk->load($this->value);
         return $fk->getIdentifierValue();
     } elseif ($model->isEnum($this->fieldname)) {
         return $model->getEnum($this->fieldname, $this->value);
     }
     return $this->value;
 }
开发者ID:uzerpllp,项目名称:uzerp,代码行数:26,代码来源:SystemObjectPolicy.php


示例8: view_allocations

 public function view_allocations()
 {
     $flash = Flash::Instance();
     $collection = new SLTransactionCollection($this->_templateobject);
     $this->_templateobject->setAdditional('payment_value', 'numeric');
     $allocation = DataObjectFactory::Factory('SLAllocation');
     $allocationcollection = new SLAllocationCollection($allocation);
     $collection->_tablename = $allocationcollection->_tablename;
     $sh = $this->setSearchHandler($collection);
     $fields = array("our_reference||'-'||transaction_type as id", 'customer', 'slmaster_id', 'transaction_date', 'transaction_type', 'our_reference', 'ext_reference', 'currency', 'gross_value', 'allocation_date');
     $sh->setGroupBy($fields);
     $fields[] = 'sum(payment_value) as payment_value';
     $sh->setFields($fields);
     if (isset($this->_data['trans_id'])) {
         $allocation->identifierField = 'allocation_id';
         $cc = new ConstraintChain();
         $cc->add(new Constraint('transaction_id', '=', $this->_data['trans_id']));
         $alloc_ids = $allocation->getAll($cc);
         if (count($alloc_ids) > 0) {
             $sh->addConstraint(new Constraint('allocation_id', 'in', '(' . implode(',', $alloc_ids) . ')'));
         } else {
             $flash->addError('Error loading allocation');
             sendBack();
         }
     }
     parent::index($collection, $sh);
     $this->view->set('collection', $collection);
     $this->view->set('invoice_module', 'sales_invoicing');
     $this->view->set('invoice_controller', 'sinvoices');
     $this->view->set('clickaction', 'view');
     $this->view->set('clickcontroller', 'slcustomers');
     $this->view->set('linkvaluefield', 'slmaster_id');
 }
开发者ID:uzerpllp,项目名称:uzerp,代码行数:33,代码来源:SltransactionsController.php


示例9: useDefault

 public static function useDefault($search_data = null, &$errors = array(), $defaults = null)
 {
     $search = new sltransactionsSearch($defaults);
     $sltrans = DataObjectFactory::Factory('SLTransaction');
     // Search by Customer
     $search->addSearchField('slmaster_id', 'Customer', 'select', 0, 'advanced');
     $customer = DataObjectFactory::Factory('SLCustomer');
     $options = array('0' => 'All');
     $customers = $customer->getAll(null, false, true);
     $options += $customers;
     $search->setOptions('slmaster_id', $options);
     // Search by Person
     $search->addSearchField('person', 'person', 'contains', '', 'advanced');
     // Search by Invoice Number
     $search->addSearchField('our_reference', 'our_reference', 'equal', '', 'advanced');
     // Search by Sales Order Number
     $search->addSearchField('transaction_date', 'transaction_date_between', 'between', '', 'advanced');
     // Search by Customer Reference
     $search->addSearchField('ext_reference', 'customer reference', 'equal', '', 'advanced');
     // Search by Invoice Date
     $search->addSearchField('due_date', 'due_date_between', 'between', '', 'advanced');
     // Search by Transaction Type
     $search->addSearchField('transaction_type', 'transaction_type', 'select', '', 'advanced');
     $options = array_merge(array('' => 'All'), $sltrans->getEnumOptions('transaction_type'));
     $search->setOptions('transaction_type', $options);
     // Search by Status
     $search->addSearchField('status', 'status', 'select', '', 'advanced');
     $options = array_merge(array('' => 'All'), $sltrans->getEnumOptions('status'));
     $search->setOptions('status', $options);
     $search->setSearchData($search_data, $errors);
     return $search;
 }
开发者ID:uzerpllp,项目名称:uzerp,代码行数:32,代码来源:sltransactionsSearch.php


示例10: getCentres

 public function getCentres()
 {
     $mf_centre = DataObjectFactory::Factory('MFCentre');
     $cc = new ConstraintChain();
     $cc->add(new Constraint('production_recording', 'is', 'true'));
     return $mf_centre->getAll($cc);
 }
开发者ID:uzerpllp,项目名称:uzerp,代码行数:7,代码来源:ProductionRecordingController.php


示例11: populate

 function populate()
 {
     $employee = DataObjectFactory::Factory('Employee');
     $user = getCurrentUser();
     if (!is_null($user->person_id)) {
         $employee->loadBy('person_id', $user->person_id);
     }
     if ($employee->isLoaded()) {
         $authorisor_model = $employee->holiday_model();
         $employee->authorisationPolicy($authorisor_model);
         $authorisees = $employee->getAuthorisees($authorisor_model);
     } else {
         $authorisees = array();
     }
     $holiday = DataObjectFactory::Factory('HolidayRequest');
     $holidays = new HolidayrequestCollection($holiday);
     if (count($authorisees) > 0) {
         $holidays->setParams();
         $sh = new SearchHandler($holidays, false);
         $sh->setFields(array('id', 'employee', 'employee_id', 'start_date', 'end_date', 'num_days'));
         $sh->addConstraint(new Constraint('status', '=', $holiday->newRequest()));
         $sh->addConstraint(new Constraint('employee_id', 'in', '(' . implode(',', $authorisees) . ')'));
         $this->setSearchLimit($sh);
         $sh->setOrderby(array('employee', 'start_date'));
         $holidays->load($sh);
         $holidays->clickcontroller = 'holidayrequests';
         $holidays->editclickaction = 'view';
     }
     $this->contents = $holidays;
 }
开发者ID:uzerpllp,项目名称:uzerp,代码行数:30,代码来源:HolidaysWaitingAuthUZlet.php


示例12: useDefault

 public static function useDefault($search_data = null, &$errors = array(), $defaults = null)
 {
     $search = new pinvoicesSearch($defaults);
     $invoice = DataObjectFactory::Factory('PInvoice');
     // Search by Customer
     $search->addSearchField('plmaster_id', 'Supplier', 'select', 0, 'advanced');
     $supplier = DataObjectFactory::Factory('PLSupplier');
     $options = array('0' => 'All');
     $suppliers = $supplier->getAll(null, false, true, '', '');
     $options += $suppliers;
     $search->setOptions('plmaster_id', $options);
     // Search by Invoice Number
     $search->addSearchField('invoice_number', 'invoice_number', 'equal', '', 'advanced');
     // Search by Invoice Number
     $search->addSearchField('ext_reference', 'supplier_reference begins', 'begins', '', 'advanced');
     // Search by Purchase Order Number
     $search->addSearchField('purchase_order_number', 'PO Number', 'equal', '', 'advanced');
     // Search by Invoice Date
     $search->addSearchField('invoice_date', 'invoice_date_between', 'between', '', 'basic');
     // Search by Transaction Type
     $search->addSearchField('transaction_type', 'transaction_type', 'select', '', 'advanced');
     $options = array_merge(array('' => 'All'), $invoice->getEnumOptions('transaction_type'));
     $search->setOptions('transaction_type', $options);
     // Search by Status
     $search->addSearchField('status', 'status', 'select', '', 'advanced');
     $options = array_merge(array('' => 'All'), $invoice->getEnumOptions('status'));
     $search->setOptions('status', $options);
     $search->setSearchData($search_data, $errors);
     return $search;
 }
开发者ID:uzerpllp,项目名称:uzerp,代码行数:30,代码来源:pinvoicesSearch.php


示例13: getObjectPolicyValue

 function getObjectPolicyValue()
 {
     $policy_detail = DataObjectFactory::Factory('SystemObjectPolicy');
     $policy_detail->load($this->object_policies_id);
     $policy_value = $policy_detail->getComponentTitle() . ' ' . prettify($policy_detail->get_field()) . ' ' . $policy_detail->getFormatted('operator') . ' ' . $policy_detail->getvalue();
     return $policy_value;
 }
开发者ID:uzerpllp,项目名称:uzerp,代码行数:7,代码来源:SystemPolicyControlList.php


示例14: useDefault

 public static function useDefault(&$search_data = null, &$errors = array(), $defaults = null)
 {
     $search = new sttransactionsSearch($defaults);
     // Search by Stock Item
     $search->addSearchField('stitem_id', 'Stock Item', 'select', '', 'basic');
     $stitem = DataObjectFactory::Factory('STItem');
     $options = array('' => 'All');
     $stitems = $stitem->getAll();
     $options += $stitems;
     $search->setOptions('stitem_id', $options);
     // Search by Status
     $search->addSearchField('status', 'Status', 'select', '', 'advanced');
     $transaction = DataObjectFactory::Factory('STTransaction');
     $options = array('' => 'All');
     $statuses = $transaction->getEnumOptions('status');
     $options += $statuses;
     $search->setOptions('status', $options);
     // Search by Location
     $search->addSearchField('whlocation_id', 'Location', 'select', '', 'advanced');
     $whlocation = new WHLocationCollection();
     $options = array('' => 'All');
     $whlocations = $whlocation->getLocationList();
     $options += $whlocations;
     $search->setOptions('whlocation_id', $options);
     // Search by Process
     $search->addSearchField('process_name', 'Process', 'select', '', 'advanced');
     $options = array('' => 'All');
     $statuses = $transaction->getEnumOptions('process_name');
     $options += $statuses;
     $search->setOptions('process_name', $options);
     // Search by Date
     $search->addSearchField('created', 'Date between', 'between', '', 'advanced');
     $search->setSearchData($search_data, $errors);
     return $search;
 }
开发者ID:uzerpllp,项目名称:uzerp,代码行数:35,代码来源:sttransactionsSearch.php


示例15: useDefault

 public static function useDefault($search_data = null, &$errors = array(), $defaults = null)
 {
     $search = new poauthlimitsSearch($defaults);
     // Search by Person
     $search->addSearchField('username', 'Person', 'select', '');
     $people = DataObjectFactory::Factory('Usercompanyaccess');
     $people->idField = 'username';
     $people->identifierField = 'username';
     $people->orderby = 'username';
     $options = array('0' => 'All');
     $cc = new ConstraintChain();
     $cc->add(new Constraint('usercompanyid', '=', EGS_COMPANY_ID));
     $peoplelist = $people->getAll($cc);
     $options += $peoplelist;
     $search->setOptions('username', $options);
     // Search by GL Centre
     $search->addSearchField('glcentre_id', 'GL Centre', 'select', 0);
     $options = array('0' => 'All');
     $centres = DataObjectFactory::Factory('GLCentre');
     $centrelist = $centres->getAll();
     $options += $centrelist;
     $search->setOptions('glcentre_id', $options);
     $search->setSearchData($search_data, $errors);
     return $search;
 }
开发者ID:uzerpllp,项目名称:uzerp,代码行数:25,代码来源:poauthlimitsSearch.php


示例16: populate

 function populate()
 {
     $employee = DataObjectFactory::Factory('Employee');
     $user = getCurrentUser();
     if (!is_null($user->person_id)) {
         $employee->loadBy('person_id', $user->person_id);
     }
     if ($employee->isLoaded()) {
         $authorisor_model = $employee->expense_model();
         $employee->authorisationPolicy($authorisor_model);
         $authorisees = $employee->getAuthorisees($authorisor_model);
     } else {
         $authorisees = array();
     }
     $expense = DataObjectFactory::Factory('Expense');
     $expenses = new ExpenseCollection($expense);
     if (count($authorisees) > 0) {
         $expenses->setParams();
         $sh = new SearchHandler($expenses, false);
         $sh->setFields(array('id', 'expense_number', 'employee', 'employee_id', 'description', 'gross_value'));
         $sh->addConstraint(new Constraint('status', '=', $expense->statusAwaitingAuthorisation()));
         $sh->addConstraint(new Constraint('employee_id', 'in', '(' . implode(',', $authorisees) . ')'));
         $this->setSearchLimit($sh);
         $sh->setOrderby(array('expense_number'));
         $expenses->load($sh);
         $expenses->clickcontroller = 'expenses';
         $expenses->editclickaction = 'view';
     }
     $this->contents = $expenses;
     $this->vars['module'] = 'hr';
     $this->vars['controller'] = 'expenses';
 }
开发者ID:uzerpllp,项目名称:uzerp,代码行数:32,代码来源:ExpensesWaitingAuthUZlet.php


示例17: index

 public function index()
 {
     // Cater for no module to edit.
     if (empty($this->_data['for_module'])) {
         $this->_data['for_module'] = 'shared';
     }
     $sidebarList['shared'] = array('tag' => 'Shared', 'link' => array('module' => 'dashboard', 'controller' => 'preferences', 'action' => 'index', 'for_module' => 'shared'));
     $accessObject =& AccessObject::Instance(EGS_USERNAME);
     $module = DataObjectFactory::Factory('ModuleObject');
     $modules = $module->getAll();
     $sidebar = new SidebarController($this->view);
     foreach ($modules as $module) {
         if (!class_exists(ucfirst($module) . 'Preferences')) {
             continue;
         }
         if ($accessObject->hasPermission($module, 'preferences')) {
             $sidebarList[$module] = array('tag' => ucfirst($module) . ' Preferences', 'link' => array('module' => 'dashboard', 'controller' => 'preferences', 'action' => 'index', 'for_module' => $module));
         }
     }
     if (empty($sidebarList)) {
         $flash = Flash::Instance();
         $flash->addError('There are no preferences you can edit');
         sendTo('index', 'index', array('dashboard'));
     } else {
         $sidebar->addList('Modules', $sidebarList);
     }
     $this->view->register('sidebar', $sidebar);
     $this->view->set('sidebar', $sidebar);
     $module = $this->getPreferenceClass($this->_data['for_module']);
     $this->view->set('templateCode', $module->generateTemplate());
     $this->view->set('page_title', $this->getPageName($this->_data['for_module'], 'Preferences for'));
 }
开发者ID:uzerpllp,项目名称:uzerp,代码行数:32,代码来源:PreferencesController.php


示例18: _new

 public function _new()
 {
     parent::_new();
     $mfshiftwaste = $this->_uses[$this->modeltype];
     if ($mfshiftwaste->isLoaded()) {
         $this->_data['mf_shift_outputs_id'] = $mfshiftwaste->mf_shift_outputs_id;
         $this->_data['mf_centre_waste_type_id'] = $mfshiftwaste->mf_centre_waste_type_id;
     }
     if (isset($this->_data['mf_shift_outputs_id'])) {
         $mfshiftoutput = DataObjectFactory::Factory('MFShiftOutput');
         $mfshiftoutput->load($this->_data['mf_shift_outputs_id']);
         if ($mfshiftoutput->isLoaded()) {
             $mfshift = $mfshiftoutput->shift_detail;
             if ($mfshift->isLoaded()) {
                 $waste_types = $mfshift->getWasteTypes();
                 $this->view->set('waste_types', $waste_types);
             }
         }
     }
     if (isset($_POST[$this->modeltype]['mf_centre_waste_type_id'])) {
         $waste_type_id = $_POST[$this->modeltype]['mf_centre_waste_type_id'];
     } elseif (isset($this->_data['mf_centre_waste_type_id'])) {
         $waste_type_id = $this->_data['mf_centre_waste_type_id'];
     } else {
         $waste_type_id = key($waste_types);
     }
     $this->view->set('uom', $this->getWasteUom($waste_type_id));
 }
开发者ID:uzerpllp,项目名称:uzerp,代码行数:28,代码来源:MfshiftwastesController.php


示例19: useDefault

 public static function useDefault($search_data = null, &$errors, $defaults = null)
 {
     $search = new expenseSearch($defaults);
     // Employee Name
     $search->addSearchField('employee', 'name_contains', 'contains', '', 'basic');
     // Status
     $search->addSearchField('status', 'status', 'multi_select', array('A', 'O', 'W'), 'basic');
     $expense = DataObjectFactory::Factory('Expense');
     $options = array('' => 'all');
     $options += $expense->getEnumOptions('status');
     $search->setOptions('status', $options);
     // Reference
     $search->addSearchField('our_reference', 'Reference', 'contains', '', 'advanced');
     // Description
     $search->addSearchField('description', 'Description', 'contains', '', 'advanced');
     // Project
     $search->addSearchField('project_id', 'Project', 'select', '', 'advanced');
     $project = DataObjectFactory::Factory('Project');
     $projects = $project->getAll(null, TRUE, TRUE);
     $options = array('' => 'all');
     $options += $projects;
     $search->setOptions('project_id', $options);
     // Task
     $search->addSearchField('task_id', 'Task', 'select', '', 'advanced');
     $task = DataObjectFactory::Factory('Task');
     $tasks = $task->getAll(null, TRUE, TRUE);
     $options = array('' => 'all');
     $options += $tasks;
     $search->setOptions('task_id', $options);
     $search->setSearchData($search_data, $errors);
     return $search;
 }
开发者ID:uzerpllp,项目名称:uzerp,代码行数:32,代码来源:expenseSearch.php


示例20: save

 public function save()
 {
     $flash = Flash::Instance();
     $errors = array();
     $partyaddress = $this->_uses[$this->modeltype];
     if (!empty($this->_data[$this->modeltype][$partyaddress->idField])) {
         // This is an update to an existing party address/address
         // so check if the address is used by other parties
         // - update it if address is only used by this party
         // - insert it if the current address is used by other parties and it does not already exist
         // - otherwise, no need to do anything here (but see below)
         if ($partyaddress->load($this->_data[$this->modeltype][$partyaddress->idField])) {
             $partyaddress->checkAddress($this->_data);
         } else {
             $errors[] = 'Error loading current Address details ' . $db->errorMsg();
         }
     }
     if (isset($this->_data['Address'])) {
         // Check if this address exists; if it does, point the PartyAddress to it
         // and remove the input address as it does not need inserting/updating
         $address = DataObjectFactory::Factory('Address');
         $address->check_exists($this->_data['Address']);
         if ($address->isLoaded()) {
             unset($this->_data['Address']);
             $this->_data[$this->modeltype]['address_id'] = $address->{$address->idField};
         }
     }
     if (count($errors) == 0 && parent::save($this->modeltype)) {
         sendTo($_SESSION['refererPage']['controller'], $_SESSION['refererPage']['action'], $_SESSION['refererPage']['modules'], isset($_SESSION['refererPage']['other']) ? $_SESSION['refererPage']['other'] : null);
     } else {
         $flash->addErrors($errors);
         $this->refresh();
     }
 }
开发者ID:uzerpllp,项目名称:uzerp,代码行数:34,代码来源:PartyaddresssController.php



注:本文中的DataObjectFactory类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP DataObjectGridCellProvider类代码示例发布时间:2022-05-23
下一篇:
PHP DataObjectCollection类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap