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


PHP Object::init方法代码示例

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


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

示例1: init

 public function init()
 {
     parent::init();
     \Pinst::$app->registerShutdownFunction(function ($app) {
         $app->errorHandel->unregister();
     });
 }
开发者ID:aoyel,项目名称:pinst,代码行数:7,代码来源:ErrorHandel.php

示例2: loadOrder

 /**
  * Sets an order as the current order.
  * @param Int | Order $order
  * @return Boolean
  */
 public function loadOrder($order)
 {
     //TODO: how to handle existing order
     //TODO: permission check - does this belong to another member? ...or should permission be assumed already?
     if (is_numeric($order)) {
         $this->order = DataObject::get_by_id('Order', $order);
     } elseif ($order instanceof Order) {
         $this->order = $order;
     }
     if ($this->order) {
         if ($this->order->canView()) {
             $this->order->init(true);
             $sessionVariableName = $this->sessionVariableName("OrderID");
             Session::set($sessionVariableName, $this->order->ID);
             $this->addMessage(_t("ShoppingCart.LOADEDEXISTING", "Order loaded."), 'good');
             return true;
         } else {
             $this->addMessage(_t("ShoppingCart.NOPERMISSION", "You do not have permission to view this order."), 'bad');
             return false;
         }
     } else {
         $this->addMessage(_t("ShoppingCart.NOORDER", "Order can not be found."), 'bad');
         return false;
     }
 }
开发者ID:nieku,项目名称:silverstripe-ecommerce,代码行数:30,代码来源:ShoppingCart.php

示例3: init

 protected function init(NamedArguments $arguments)
 {
     parent::init($arguments);
     $this->issn = $arguments->issn;
     $this->isbn = $arguments->isbn;
     $this->config = new Configuration();
     //determine the full URL
     //change the string sent to SFX depending on whether ISBN or ISSN was passed in
     if ($this->isbn) {
         $stringAppend = "&isbn=" . $this->isbn;
     } else {
         $stringAppend = "&issn=" . $this->issn;
     }
     //get the sfx open URL out of the config settings
     $open_url = $this->config->settings->open_url;
     //check if there is already a ? in the URL so that we don't add another when appending the parms
     if (strpos($open_url, "?") > 0) {
         $open_url .= "&";
     } else {
         $open_url .= "?";
     }
     $sid = $this->config->settings->sid;
     if ($sid) {
         $open_url .= "rfr_id=info:sid/" . $sid;
     }
     $this->open_url = $open_url . "&sfx.ignore_date_threshold=1&sfx.response_type=simplexml" . $stringAppend;
 }
开发者ID:TAMULib,项目名称:CORAL-Terms,代码行数:27,代码来源:SFXService.php

示例4: init

 protected function init(NamedArguments $arguments)
 {
     parent::init($arguments);
     $this->issn = $arguments->issn;
     $this->isbn = $arguments->isbn;
     $this->config = new Configuration();
 }
开发者ID:TAMULib,项目名称:CORAL-Terms,代码行数:7,代码来源:TermsService.php

示例5: loadOrder

 /**
  * Sets an order as the current order.
  * @param Int | Order $order
  * @return Boolean
  */
 public function loadOrder($order)
 {
     //TODO: how to handle existing order
     //TODO: permission check - does this belong to another member? ...or should permission be assumed already?
     if (is_numeric($order)) {
         $this->order = Order::get()->byID($order);
     } elseif (is_a($order, Object::getCustomClass("Order"))) {
         $this->order = $order;
     } else {
         user_error("Bad order provided as parameter to ShoppingCart::loadOrder()");
     }
     if ($this->order) {
         if ($this->order->canView()) {
             $this->order->init(true);
             $sessionVariableName = $this->sessionVariableName("OrderID");
             Session::set($sessionVariableName, $this->order->ID);
             $this->addMessage(_t("Order.LOADEDEXISTING", "Order loaded."), 'good');
             return true;
         } else {
             $this->addMessage(_t("Order.NOPERMISSION", "You do not have permission to view this order."), 'bad');
             return false;
         }
     } else {
         $this->addMessage(_t("Order.NOORDER", "Order can not be found."), 'bad');
         return false;
     }
 }
开发者ID:helpfulrobot,项目名称:sunnysideup-ecommerce,代码行数:32,代码来源:ShoppingCart.php

示例6: init

 public function init()
 {
     parent::init();
     \Pinst::$app->registerShutdownFunction(function ($app) {
         $app->logger->save();
     });
 }
开发者ID:aoyel,项目名称:pinst,代码行数:7,代码来源:Logger.php

示例7: init

 protected function init(NamedArguments $arguments)
 {
     parent::init($arguments);
     $this->issn = $arguments->issn;
     $this->isbn = $arguments->isbn;
     $this->config = new Configuration();
     //determine the full open URL
     //change the string sent depending on whether ISBN or ISSN was passed in
     if ($this->isbn) {
         $stringAppend = "&rft.isbn=" . $this->isbn;
     } else {
         $stringAppend = "&rft.issn=" . $this->issn;
     }
     //get the client identifier out of the config settings
     $client_identifier = $this->config->settings->client_identifier;
     $this->open_url = "http://" . $client_identifier . ".openurl.xml.serialssolutions.com/openurlxml?version=1.0&url_ver=Z39.88-2004" . $stringAppend;
 }
开发者ID:TAMULib,项目名称:CORAL-Terms,代码行数:17,代码来源:SerialsSolutionsService.php

示例8: init

 /**
  * When initiating set value for self::$_self; so that it can be called from ::get();
  * Multiple values will be set for that, one for each config variant that is initiated.
  * @param string[] $config Config values that were used when the object was instantiated.
  */
 protected function init($config)
 {
     $this->addNamespace(self::APP_DEVELOPER_VENDORKEY, APP_ROOT);
     self::$_self[md5(serialize($config))] = $this;
     return parent::init();
 }
开发者ID:mpf-soft,项目名称:mpf,代码行数:11,代码来源:AutoLoader.php

示例9: getType

            $params[$k] = $v;
        }
        return $params;
    }
    public function getType()
    {
        return substr($this->_id, 0, strpos($this->_id, "."));
    }
    public function __toJSON()
    {
        if (defined('JSON_PRETTY_PRINT')) {
            return json_encode($this->__toArray(true), JSON_PRETTY_PRINT);
        } else {
            return json_encode($this->__toArray(true));
        }
    }
    public function __toString()
    {
        return $this->__toJSON();
    }
    public function __toArray($recursive = false)
    {
        if ($recursive) {
            return Util::convertIxfObjectToArray($this->_values);
        } else {
            return $this->_values;
        }
    }
}
Object::init();
开发者ID:euro-ix,项目名称:ixf-client-php,代码行数:30,代码来源:Object.php

示例10: init

 /**
  * {@inheritdoc}
  */
 public function init(array $data)
 {
     parent::init($data);
     $this->setOption('target', $this->getId());
 }
开发者ID:EMerino236,项目名称:afiperudrupal,代码行数:8,代码来源:Map.php

示例11: init

 public function init()
 {
     parent::init();
 }
开发者ID:aoyel,项目名称:pinst,代码行数:4,代码来源:Db.php


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