예제 #1
0
 /**
  * @see ObjectModel::getFields()
  * @return array
  */
 public function getFields()
 {
     if (empty($this->language_code)) {
         $this->language_code = $this->iso_code;
     }
     return parent::getFields();
 }
예제 #2
0
 /**
  * @see ObjectModel::getFields()
  * @return array
  */
 public function getFields()
 {
     if (!$this->share_customer || !$this->share_stock) {
         $this->share_order = false;
     }
     return parent::getFields();
 }
예제 #3
0
 /**
  * @see ObjectModel::getFields()
  * @return array
  */
 public function getFields()
 {
     if (!$this->id_shop_group) {
         $this->id_shop_group = Context::getContext()->shop->id_shop_group;
     }
     $fields = parent::getFields();
     return $fields;
 }
예제 #4
0
 /**
  * @see ObjectModel::getFields()
  * @return array
  */
 public function getFields()
 {
     $fields = parent::getFields();
     if (!$fields['date_expiration']) {
         $fields['date_expiration'] = '0000-00-00 00:00:00';
     }
     return $fields;
 }
예제 #5
0
 /**
  * @see ObjectModel::getFields()
  * @return array
  */
 public function getFields()
 {
     if (empty($this->stats_date_from)) {
         $this->stats_date_from = date('Y-m-d 00:00:00');
     }
     if (empty($this->stats_date_to)) {
         $this->stats_date_to = date('Y-m-d 23:59:59');
     }
     return parent::getFields();
 }
 public function getFields()
 {
     $fields = parent::getFields();
     if ($this->id_shop) {
         $fields['id_shop'] = (int) $this->id_shop;
     } else {
         $fields['id_shop'] = Context::getContext()->shop->id;
     }
     return $fields;
 }
예제 #7
0
 public function getFields()
 {
     $fields = parent::getFields();
     if (version_compare(_PS_VERSION_, '1.5', '<')) {
         $fields['result'] = pSQL($this->result);
         $fields['capture_amount'] = pSQL($this->capture_amount);
         $fields['date_add'] = pSQL($this->date_add);
         $fields['date_upd'] = pSQL($this->date_upd);
         $fields['id_order'] = pSQL($this->id_order);
     }
     return $fields;
 }
예제 #8
0
 /**
  * @see ObjectModel::getFields()
  * @return array
  */
 public function getFields()
 {
     $this->physical_uri = trim($this->physical_uri, '/');
     if ($this->physical_uri) {
         $this->physical_uri = preg_replace('#/+#', '/', '/' . $this->physical_uri . '/');
     } else {
         $this->physical_uri = '/';
     }
     $this->virtual_uri = trim($this->virtual_uri, '/');
     if ($this->virtual_uri) {
         $this->virtual_uri = preg_replace('#/+#', '/', trim($this->virtual_uri, '/')) . '/';
     }
     return parent::getFields();
 }
예제 #9
0
 public function getFields()
 {
     $fields = parent::getFields();
     // @todo add null management in definitions
     if ($this->id_shop) {
         $fields['id_shop'] = (int) $this->id_shop;
     } else {
         $fields['id_shop'] = null;
     }
     if ($this->id_shop_group) {
         $fields['id_shop_group'] = (int) $this->id_shop_group;
     } else {
         $fields['id_shop_group'] = null;
     }
     return $fields;
 }
예제 #10
0
파일: Employee.php 프로젝트: jpodracky/dogs
 /**
  * @see ObjectModel::getFields()
  * @return array
  */
 public function getFields()
 {
     if (empty($this->stats_date_from) || $this->stats_date_from == '0000-00-00') {
         $this->stats_date_from = date('Y-m-d', strtotime('-1 month'));
     }
     if (empty($this->stats_compare_from) || $this->stats_compare_from == '0000-00-00') {
         $this->stats_compare_from = null;
     }
     if (empty($this->stats_date_to) || $this->stats_date_to == '0000-00-00') {
         $this->stats_date_to = date('Y-m-d');
     }
     if (empty($this->stats_compare_to) || $this->stats_compare_to == '0000-00-00') {
         $this->stats_compare_to = null;
     }
     return parent::getFields();
 }
예제 #11
0
 /**
  * @see ObjectModel::getFields()
  * @return array
  */
 public function getFields()
 {
     if (!$this->id_lang) {
         $this->id_lang = Configuration::get('PS_LANG_DEFAULT', null, null, $this->id_shop);
     }
     return parent::getFields();
 }
예제 #12
0
 public function getFields()
 {
     if (version_compare(_PS_VERSION_, '1.5', '<')) {
         parent::validateFields();
         $definition = $this->getDefinitionProperty();
         // child class name
         foreach ($definition['fields'] as $field_name => $field) {
             if ($field_name == $this->identifier && isset($this->{$field_name})) {
                 $fields[$field_name] = $this->{$field_name};
             } else {
                 switch ($field['type']) {
                     case 1:
                         $fields[$field_name] = (int) $this->{$field_name};
                         break;
                     case 2:
                         $fields[$field_name] = (bool) $this->{$field_name};
                         break;
                     case 3:
                     case 5:
                     case 6:
                         $fields[$field_name] = pSQL($this->{$field_name}, true);
                         break;
                     case 4:
                         $fields[$field_name] = (double) $this->{$field_name};
                         break;
                     case 7:
                         $fields[$field_name] = $this->{$field_name};
                         break;
                 }
             }
         }
         return $fields;
     } else {
         return parent::getFields();
     }
 }
예제 #13
0
 public function getFields()
 {
     if (version_compare(_PS_VERSION_, '1.5', '<')) {
         parent::validateFields();
         $caller_class_name = $this->getCallerClassName();
         // child class name
         $fields = array();
         if (property_exists($caller_class_name, 'definition')) {
             $class_variables = get_class_vars($caller_class_name);
             foreach ($class_variables['definition']['fields'] as $field_name => $field) {
                 if ($field_name == $this->identifier && isset($this->{$field_name})) {
                     $fields[$field_name] = $this->{$field_name};
                 } else {
                     switch ($field['type']) {
                         case 1:
                             $fields[$field_name] = (int) $this->{$field_name};
                             break;
                         case 2:
                             $fields[$field_name] = (bool) $this->{$field_name};
                             break;
                         case 3:
                         case 5:
                         case 6:
                             $fields[$field_name] = pSQL($this->{$field_name}, true);
                             break;
                         case 4:
                             $fields[$field_name] = (double) $this->{$field_name};
                             break;
                         case 7:
                             $fields[$field_name] = $this->{$field_name};
                             break;
                     }
                 }
             }
         }
         return $fields;
     } else {
         return parent::getFields();
     }
 }
예제 #14
0
 public function getFields()
 {
     if (version_compare(_PS_VERSION_, '1.5', '<')) {
         parent::validateFields();
         $definition = $this->getDefinitionProperty();
         // child class name
         $fields = array();
         foreach ($definition['fields'] as $field_name => $field) {
             if ($field_name == $this->identifier && isset($this->{$field_name})) {
                 $fields[$field_name] = $this->{$field_name};
             } else {
                 if (!is_array($this->{$field_name})) {
                     $fields[$field_name] = $this->cast($field['type'], $this->{$field_name});
                 }
             }
         }
         return $fields;
     } else {
         return parent::getFields();
     }
 }