本文整理汇总了PHP中ObjectModel::getFields方法的典型用法代码示例。如果您正苦于以下问题:PHP ObjectModel::getFields方法的具体用法?PHP ObjectModel::getFields怎么用?PHP ObjectModel::getFields使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ObjectModel
的用法示例。
在下文中一共展示了ObjectModel::getFields方法的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getFields
/**
* @see ObjectModel::getFields()
* @return array
*/
public function getFields()
{
if (empty($this->language_code)) {
$this->language_code = $this->iso_code;
}
return parent::getFields();
}
示例2: getFields
/**
* @see ObjectModel::getFields()
* @return array
*/
public function getFields()
{
if (!$this->share_customer || !$this->share_stock) {
$this->share_order = false;
}
return parent::getFields();
}
示例3: getFields
/**
* @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: getFields
/**
* @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: getFields
/**
* @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();
}
示例6: 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: getFields
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: getFields
/**
* @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: getFields
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: getFields
/**
* @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: getFields
/**
* @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: getFields
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: getFields
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: getFields
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();
}
}