当前位置: 首页>>代码示例>>PHP>>正文


PHP ObjectModel::__construct方法代码示例

本文整理汇总了PHP中ObjectModel::__construct方法的典型用法代码示例。如果您正苦于以下问题:PHP ObjectModel::__construct方法的具体用法?PHP ObjectModel::__construct怎么用?PHP ObjectModel::__construct使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在ObjectModel的用法示例。


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

示例1: __construct

 public function __construct($id = NULL, $id_lang = NULL)
 {
     parent::__construct($id, $id_lang);
     if ($this->name == '0') {
         $this->name = Configuration::get('PS_SHOP_NAME');
     }
 }
开发者ID:vincent,项目名称:theinvertebrates,代码行数:7,代码来源:Carrier.php

示例2: array

 function __construct($id = null)
 {
     if (version_compare(_PS_VERSION_, '1.5.0.2', '<')) {
         $definition = $this->getDefinitionProperty();
         // child class name
         $this->tables = array($definition['table']);
         $this->table = $definition['table'];
         $this->identifier = $definition['primary'];
     }
     if (version_compare(_PS_VERSION_, '1.5', '<')) {
         $definition = $this->getDefinitionProperty();
         // child class name
         $this->tables = array($definition['table']);
         $this->table = $definition['table'];
         $this->identifier = $definition['primary'];
         foreach ($definition['fields'] as $field_name => $field) {
             if (!in_array($field_name, array('id_shop', 'date_upd', 'date_add'))) {
                 $validateRule = isset($field['validate']) ? $field['validate'] : 'isAnything';
                 $this->fieldsValidate[$field_name] = $validateRule;
                 if (isset($field['required'])) {
                     array_push($this->fieldsRequired, $field_name);
                 }
                 if (isset($field['size'])) {
                     $this->fieldsSize[$field_name] = $field['size'];
                 }
             }
         }
     }
     return parent::__construct($id);
 }
开发者ID:ventsiwad,项目名称:presta_addons,代码行数:30,代码来源:ObjectModel.php

示例3: __construct

    public function __construct(SplFileInfo $fileinfo = null)
    {
        parent::__construct();
        if ($fileinfo) {
            $this->file_hash = md5($fileinfo->getRealPath());
            $fileSize = $fileinfo->getSize();
            // Looking for existing path
            $result = Db::getInstance()->getRow('
				SELECT *
				FROM `' . _DB_PREFIX_ . bqSQL(self::$definition['table']) . '`
				WHERE `file_hash` = \'' . pSQL($this->file_hash) . '\'');
            if (!$result) {
                $this->file_size = $fileSize;
                $this->file_info = $fileinfo;
            } else {
                $this->id = $result['id'];
                foreach ($result as $key => $value) {
                    if (array_key_exists($key, $this)) {
                        $this->{$key} = $value;
                    }
                }
                // Check file size
                if ($this->file_size != $fileSize) {
                    $this->file_size = $fileSize;
                    $this->file_info = $fileinfo;
                }
            }
        }
        return $this;
    }
开发者ID:Benichou34,项目名称:tinify,代码行数:30,代码来源:filecache.php

示例4: __construct

 public function __construct($id = NULL, $id_lang = NULL)
 {
     parent::__construct($id, $id_lang);
     /* Get the manufacturer's id_address */
     $this->id_address = $this->getManufacturerAddress();
     $this->link_rewrite = $this->getLink();
 }
开发者ID:vincent,项目名称:theinvertebrates,代码行数:7,代码来源:Manufacturer.php

示例5: __construct

 public function __construct($id = null, $id_lang = null, $id_shop = null)
 {
     parent::__construct($id, $id_lang, $id_shop);
     if ($this->id && !isset(Group::$group_price_display_method[$this->id])) {
         self::$group_price_display_method[$this->id] = $this->price_display_method;
     }
 }
开发者ID:rongandat,项目名称:vatfairfoot,代码行数:7,代码来源:Group.php

示例6: __construct

 public function __construct($id = null)
 {
     if (version_compare(_PS_VERSION_, '1.5', '<')) {
         $caller_class_name = $this->getCallerClassName();
         // child class name
         if (property_exists($caller_class_name, 'definition')) {
             $class_variables = get_class_vars($caller_class_name);
             $this->table = $class_variables['definition']['table'];
             $this->identifier = $class_variables['definition']['primary'];
             foreach ($class_variables['definition']['fields'] as $field_name => $field) {
                 if (!in_array($field_name, array('id_shop', 'date_upd', 'date_add'))) {
                     $validate_rule = isset($field['validate']) ? $field['validate'] : 'isAnything';
                     $this->fieldsValidate[$field_name] = $validate_rule;
                     if (isset($field['required'])) {
                         array_push($this->fieldsRequired, $field_name);
                     }
                     if (isset($field['size'])) {
                         $this->fieldsSize[$field_name] = $field['size'];
                     }
                 }
             }
         }
     }
     return parent::__construct($id);
 }
开发者ID:remixaz,项目名称:dpdgroup,代码行数:25,代码来源:ObjectModel.php

示例7: __construct

 public function __construct($id = NULL, $identifier = 'id_shopgate_order')
 {
     $this->identifier = $identifier;
     parent::__construct($id);
     $this->id = $this->id_shopgate_order;
     $this->identifier = 'id_shopgate_order';
 }
开发者ID:ventsiwad,项目名称:presta_addons,代码行数:7,代码来源:PSShopgateOrder.php

示例8: __construct

    public function __construct($id = null, $alias = null, $search = null, $id_lang = null)
    {
        $this->def = Alias::getDefinition($this);
        $this->setDefinitionRetrocompatibility();
        if ($id) {
            parent::__construct($id);
        } elseif ($alias && Validate::isValidSearch($alias)) {
            if (!Alias::isFeatureActive()) {
                $this->alias = trim($alias);
                $this->search = trim($search);
            } else {
                $row = Db::getInstance(_PS_USE_SQL_SLAVE_)->getRow('
				SELECT a.id_alias, a.search, a.alias
				FROM `' . _DB_PREFIX_ . 'alias` a
				WHERE `alias` LIKE \'' . pSQL($alias) . '\' AND `active` = 1');
                if ($row) {
                    $this->id = (int) $row['id_alias'];
                    $this->search = $search ? trim($search) : $row['search'];
                    $this->alias = $row['alias'];
                } else {
                    $this->alias = trim($alias);
                    $this->search = trim($search);
                }
            }
        }
    }
开发者ID:NathanGiesbrecht,项目名称:PrestaShopAutomationFramework,代码行数:26,代码来源:Alias.php

示例9: __construct

 public function __construct($id_simpleblog_post = null, $id_lang = null, $id_shop = null)
 {
     parent::__construct($id_simpleblog_post, $id_lang, $id_shop);
     $category = new SimpleBlogCategory($this->id_simpleblog_category, $id_lang);
     $this->category = $category->name;
     $this->category_rewrite = $category->link_rewrite;
     $this->url = self::getLink($this->link_rewrite, $this->category_rewrite, $id_lang);
     $this->category_url = SimpleBlogCategory::getLink($category->link_rewrite, $id_lang);
     if ($category->id_parent > 0) {
         $parent = new SimpleBlogCategory($category->id_parent, $id_lang);
         $this->parent_category = $parent;
     }
     if (file_exists(_PS_MODULE_DIR_ . 'ph_simpleblog/covers/' . $this->id_simpleblog_post . '.' . $this->cover)) {
         $this->banner = _MODULE_DIR_ . 'ph_simpleblog/covers/' . $this->id_simpleblog_post . '.' . $this->cover;
         $this->banner_thumb = _MODULE_DIR_ . 'ph_simpleblog/covers/' . $this->id_simpleblog_post . '-thumb.' . $this->cover;
         $this->banner_wide = _MODULE_DIR_ . 'ph_simpleblog/covers/' . $this->id_simpleblog_post . '-wide.' . $this->cover;
     }
     if (file_exists(_PS_MODULE_DIR_ . 'ph_simpleblog/featured/' . $this->id_simpleblog_post . '.' . $this->featured)) {
         $this->featured_image = _MODULE_DIR_ . 'ph_simpleblog/featured/' . $this->id_simpleblog_post . '.' . $this->featured;
     }
     if ($this->id) {
         $tags = SimpleBlogTag::getPostTags((int) $this->id);
         $this->tags = $tags;
         if (isset($tags) && isset($tags[$id_lang])) {
             $this->tags_list = $tags[$id_lang];
         }
         $this->comments = SimpleBlogComment::getCommentsCount((int) $this->id);
         $this->post_type = SimpleBlogPostType::getSlugById((int) $this->id_simpleblog_post_type);
         if ($this->post_type == 'gallery') {
             $this->gallery = SimpleBlogPostImage::getAllById((int) $this->id);
         }
     }
 }
开发者ID:evgrishin,项目名称:se1614,代码行数:33,代码来源:SimpleBlogPost.php

示例10: __construct

 /**
  * On shop instance, get its theme and URL data too
  *
  * @param int $id
  * @param int $id_lang
  * @param int $id_shop
  */
 public function __construct($id = null, $id_lang = null, $id_shop = null)
 {
     parent::__construct($id, $id_lang, $id_shop);
     if ($this->id) {
         $this->setUrl();
     }
 }
开发者ID:jpodracky,项目名称:dogs,代码行数:14,代码来源:Shop.php

示例11: __construct

 public function __construct($id = NULL, $id_lang = NULL)
 {
     parent::__construct($id, $id_lang);
     if ($this->id) {
         $this->default_img = $this->getDefaultImage();
     }
 }
开发者ID:rongandat,项目名称:vatfairfoot,代码行数:7,代码来源:BlogPost.php

示例12: __construct

 public function __construct($id = null, $id_lang = null, $id_shop = null)
 {
     parent::__construct($id, $id_lang, $id_shop);
     if ($this->id) {
         $this->associated_shops = $this->getAssociatedShops();
     }
 }
开发者ID:rongandat,项目名称:vatfairfoot,代码行数:7,代码来源:Employee.php

示例13: __construct

 public function __construct($id_seo = NULL, $id_lang = NULL, $id_shop = NULL)
 {
     if (version_compare(_PS_VERSION_, '1.5.0.0', '>=')) {
         parent::__construct($id_seo, $id_lang, $id_shop);
     } else {
         parent::__construct($id_seo, $id_lang);
     }
 }
开发者ID:acreno,项目名称:pm-ps,代码行数:8,代码来源:AdvancedSearchSeoClass.php

示例14: __construct

 public function __construct($id = null, $id_lang = null, $id_shop = null)
 {
     parent::__construct($id, $id_lang, $id_shop);
     // prefix and suffix are convenient shortcut for displaying
     // price sign before or after the price number
     $this->prefix = $this->format % 2 != 0 ? $this->sign . ' ' : '';
     $this->suffix = $this->format % 2 == 0 ? ' ' . $this->sign : '';
 }
开发者ID:FAVHYAN,项目名称:a3workout,代码行数:8,代码来源:Currency.php

示例15: __construct

 public function __construct($id_address = NULL, $id_lang = NULL)
 {
     parent::__construct($id_address);
     // Check if all files needed are here, if not, disabled language
     if ($this->iso_code != 'en' and !$this->checkFiles()) {
         $this->active = false;
     }
 }
开发者ID:raulgimenez,项目名称:dreamongraphics_shop,代码行数:8,代码来源:Language.php


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