Пример #1
0
 /**
  * Insert an Invoice
  * 
  * ToDo: missing check foreign keys
  * 
  * @see lib/Zend/Db/Table/Zend_Db_Table_Abstract::insert()
  */
 public function insert($data)
 {
     $SI_PREFERENCES = new SimpleInvoices_Db_Table_Preferences();
     $pref_group = $SI_PREFERENCES->getPreferenceById($_POST['preference_id']);
     $auth_session = Zend_Registry::get('auth_session');
     $data['domain_id'] = $auth_session->domain_id;
     $data['index_id'] = SimpleInvoices_Db_Table_Index::NEXT('invoice', $pref_group['index_group']);
     $result = parent::insert($data);
     $this->_last_inserted_id = $this->getAdapter()->lastInsertId($this->_name, 'id');
     // Increment Index if inserted
     if ($result) {
         SimpleInvoices_Db_Table_Index::INCREMENT('invoice', $pref_group['index_group']);
     }
     return $result;
 }
Пример #2
0
 /**
  * Insert a new customer
  * 
  * @param mixed $data
  * @return array
  */
 public function insert($data)
 {
     // Set the domain ID
     $auth_session = Zend_Registry::get('auth_session');
     $data['domain_id'] = $auth_session->domain_id;
     // IF Credit Card Number is present it must be cyphered
     if (array_key_exists('credit_card_number', $data)) {
         if (!empty($data['credit_card_number'])) {
             $config = Zend_Registry::get('config');
             $enc = new encryption();
             $key = $config->encryption->default->key;
             $data['credit_card_number'] = $enc->encrypt($key, $data['credit_card_number']);
         }
     }
     return parent::insert($data);
 }
Пример #3
0
 /**
  * Insert a new biller
  * 
  * @param mixed $data
  * @return array
  */
 public function insert($data)
 {
     // Set the domain ID
     $auth_session = Zend_Registry::get('auth_session');
     $data['domain_id'] = $auth_session->domain_id;
     return parent::insert($data);
 }
Пример #4
0
 /**
  * Replaces insertProduct and insertProductComplete
  * 
  * @param mixed $data
  * @return array
  */
 public function insert($data)
 {
     // Set the domain ID
     $auth_session = Zend_Registry::get('auth_session');
     $data['domain_id'] = $auth_session->domain_id;
     // ToDo: Is this really needed?
     if (!isset($data['enabled'])) {
         $data['enabled'] = 1;
     }
     if (!isset($data['visible'])) {
         $data['visible'] = 1;
     }
     return parent::insert($data);
 }