本文整理汇总了PHP中ObjectModel类的典型用法代码示例。如果您正苦于以下问题:PHP ObjectModel类的具体用法?PHP ObjectModel怎么用?PHP ObjectModel使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了ObjectModel类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getFields
/**
* @see ObjectModel::getFields()
* @return array
*/
public function getFields()
{
if (!$this->share_customer || !$this->share_stock) {
$this->share_order = false;
}
return parent::getFields();
}
示例2: getFieldsLang
/**
* @see ObjectModel::getFieldsLang()
* @return bool|array Multilingual fields
*/
public function getFieldsLang()
{
if (!is_array($this->value)) {
return true;
}
return parent::getFieldsLang();
}
示例3: getByOrderReference
/**
* Get the detailed payment of an order
* @param int $order_reference
* @return array
* @since 1.5.0.13
*/
public static function getByOrderReference($order_reference)
{
return ObjectModel::hydrateCollection('OrderPayment', Db::getInstance()->executeS('
SELECT *
FROM `' . _DB_PREFIX_ . 'order_payment`
WHERE `order_reference` = \'' . pSQL($order_reference) . '\''));
}
示例4: getTranslationsFieldsChild
/**
* Check then return multilingual fields for database interaction
*
* @return array Multilingual fields
*/
public function getTranslationsFieldsChild()
{
parent::validateFieldsLang();
$fieldsArray = array('title', 'url');
$fields = array();
$languages = Language::getLanguages(false);
$defaultLanguage = (int) Configuration::get('PS_LANG_DEFAULT');
foreach ($languages as $language) {
$fields[$language['id_lang']]['id_lang'] = (int) $language['id_lang'];
$fields[$language['id_lang']][self::$definition['primary']] = (int) $this->id;
foreach ($fieldsArray as $field) {
if (!Validate::isTableOrIdentifier($field)) {
die(Tools::displayError());
}
if (isset($this->{$field}[$language['id_lang']]) and !empty($this->{$field}[$language['id_lang']])) {
$fields[$language['id_lang']][$field] = pSQL($this->{$field}[$language['id_lang']], true);
} elseif (in_array($field, $this->fieldsRequiredLang)) {
$fields[$language['id_lang']][$field] = pSQL($this->{$field}[$defaultLanguage], true);
} else {
$fields[$language['id_lang']][$field] = '';
}
}
}
return $fields;
}
示例5: getFields
public function getFields()
{
${"GLOBALS"}["fqnuqhk"] = "fields";
$qubfmzdfpdc = "fields";
${"GLOBALS"}["blespfjwjdc"] = "fields";
parent::validateFields(false);
${"GLOBALS"}["godcvsyi"] = "fields";
$dgtnok = "fields";
${${"GLOBALS"}["njdxasfu"]}["id_seller"] = intval($this->id_seller);
$xxtfhei = "fields";
${"GLOBALS"}["mkfldzuj"] = "fields";
${${"GLOBALS"}["fqnuqhk"]}["id_product"] = intval($this->id_product);
$ubhbmgxsg = "fields";
${${"GLOBALS"}["njdxasfu"]}["id_order"] = intval($this->id_order);
${$xxtfhei}["id_customer"] = intval($this->id_customer);
${$qubfmzdfpdc}["id_lang"] = pSQL($this->id_lang);
${${"GLOBALS"}["njdxasfu"]}["ip_address"] = pSQL($this->ip_address);
${${"GLOBALS"}["blespfjwjdc"]}["from_email"] = pSQL($this->from_email);
${${"GLOBALS"}["njdxasfu"]}["from_name"] = pSQL($this->from_name);
$dpwypmchkj = "fields";
${$ubhbmgxsg}["subject"] = pSQL($this->subject);
${${"GLOBALS"}["njdxasfu"]}["message"] = pSQL($this->message);
${${"GLOBALS"}["njdxasfu"]}["is_customer_message"] = intval($this->is_customer_message);
${${"GLOBALS"}["njdxasfu"]}["active"] = intval($this->active);
${$dgtnok}["date_add"] = pSQL($this->date_add);
${${"GLOBALS"}["godcvsyi"]}["attpsname1"] = pSQL($this->attpsname1);
${${"GLOBALS"}["njdxasfu"]}["attpsname2"] = pSQL($this->attpsname2);
${$dpwypmchkj}["attpsname3"] = pSQL($this->attpsname3);
${${"GLOBALS"}["njdxasfu"]}["attshname1"] = pSQL($this->attshname1);
${${"GLOBALS"}["njdxasfu"]}["attshname2"] = pSQL($this->attshname2);
${${"GLOBALS"}["mkfldzuj"]}["attshname3"] = pSQL($this->attshname3);
return ${${"GLOBALS"}["njdxasfu"]};
}
示例6: delete
public function delete()
{
if (!parent::delete()) {
return false;
}
if ($this->hasMultishopEntries()) {
return true;
}
if (!$this->deleteProductAttributeImage() || !$this->deleteImage()) {
return false;
}
// update positions
$result = Db::getInstance()->executeS('
SELECT *
FROM `' . _DB_PREFIX_ . 'image`
WHERE `id_product` = ' . (int) $this->id_product . '
ORDER BY `position`
');
$i = 1;
if ($result) {
foreach ($result as $row) {
$row['position'] = $i++;
Db::getInstance()->update($this->def['table'], $row, '`id_image` = ' . (int) $row['id_image'], 1);
}
}
return true;
}
示例7: delete
public function delete()
{
if (!parent::delete() or $this->deleteAssociations() === false) {
return false;
}
return true;
}
示例8: getFields
public function getFields()
{
parent::validateFields();
$fields['name'] = $this->name;
$fields['active'] = (int) $this->active;
return $fields;
}
示例9: add
public function add($autodate = true, $nullValues = false)
{
if ($result = parent::add($autodate, $nullValues)) {
Referrer::cacheNewSource($this->id);
}
return $result;
}
示例10: delete
public function delete()
{
if (!parent::delete()) {
return false;
}
return Db::getInstance()->execute('DELETE FROM ' . _DB_PREFIX_ . 'cart_rule_country WHERE id_country = ' . (int) $this->id);
}
示例11: delete
public function delete()
{
if ((int) $this->id === 0) {
return false;
}
return SimpleBlogPost::deleteCover($this) && SimpleBlogPost::deleteFeatured($this) && parent::delete();
}
示例12: getFields
public function getFields()
{
parent::validateFields();
$fields['time_start'] = pSQL($this->time_start);
$fields['time_end'] = pSQL($this->time_end);
return $fields;
}
示例13: getTranslationsFieldsChild
public function getTranslationsFieldsChild()
{
if (!parent::validateFieldsLang()) {
return false;
}
return parent::getTranslationsFields(array("name"));
}
示例14: delete
public function delete()
{
if (Db::getInstance()->Execute('DELETE FROM ' . _DB_PREFIX_ . 'access WHERE `id_tab` = ' . intval($this->id)) and parent::delete()) {
return $this->cleanPositions($this->id_parent);
}
return false;
}
示例15: delete
public function delete()
{
if (parent::delete()) {
return $this->cleanPositions($this->id_opartslideshow_slideshow);
}
return false;
}