當前位置: 首頁>>代碼示例>>PHP>>正文


PHP self::load方法代碼示例

本文整理匯總了PHP中self::load方法的典型用法代碼示例。如果您正苦於以下問題:PHP self::load方法的具體用法?PHP self::load怎麽用?PHP self::load使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在self的用法示例。


在下文中一共展示了self::load方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: create

 /**
  * @param string $pathName
  * @param string $mode [r,w]
  * @return static
  */
 public static function create($pathName, $mode = self::MODE_READ)
 {
     $yaml = new self($pathName);
     if ($mode == self::MODE_READ) {
         $yaml->load();
     } elseif ($mode == self::MODE_WRITE) {
         try {
             touch($pathName);
         } catch (\ErrorException $e) {
             throw new ApplicationException("Error creating file '{$pathName}'");
         }
         $yaml->load();
     }
     return $yaml;
 }
開發者ID:keboola,項目名稱:juicer,代碼行數:20,代碼來源:YamlFile.php

示例2: store

	/**
	 * @param bool $updateNulls
	 * @return bool
	 */
	public function store( $updateNulls = false )
	{
		global $_PLUGINS;

		$new	=	( $this->get( 'id' ) ? false : true );
		$old	=	new self();

		$this->set( 'type', preg_replace( '/[^-a-zA-Z0-9_.]/', '', $this->get( 'type' ) ) );

		if ( ! $new ) {
			$old->load( (int) $this->get( 'id' ) );

			$_PLUGINS->trigger( 'activity_onBeforeUpdateHidden', array( &$this, $old ) );
		} else {
			$_PLUGINS->trigger( 'activity_onBeforeCreateHidden', array( &$this ) );
		}

		if ( ! parent::store( $updateNulls ) ) {
			return false;
		}

		if ( ! $new ) {
			$_PLUGINS->trigger( 'activity_onAfterUpdateHidden', array( $this, $old ) );
		} else {
			$_PLUGINS->trigger( 'activity_onAfterCreateHidden', array( $this ) );
		}

		return true;
	}
開發者ID:kosmosby,項目名稱:medicine-prof,代碼行數:33,代碼來源:HiddenTable.php

示例3: set_password

 /**
  * crypt password
  * Defines whether to use bcrypt or salted MD5
  * @param $val
  * @return string
  */
 public function set_password($val)
 {
     $f3 = \Base::instance();
     if (!$val) {
         $userDetails = new self();
         $userDetails->load(array('username = ?', $f3->get('POST.username')));
         $val = $userDetails->password;
         return $val;
     } else {
         $hash_engine = $f3->get('password_hash_engine');
         switch ($hash_engine) {
             case 'bcrypt':
                 $crypt = \Bcrypt::instance();
                 $val = $crypt->hash($val);
                 break;
             case 'md5':
                 // fall-through
             // fall-through
             default:
                 $val = md5($val . $f3->get('password_md5_salt'));
                 break;
         }
         return $val;
     }
 }
開發者ID:alienwithin,項目名稱:OWASP-mth3l3m3nt-framework,代碼行數:31,代碼來源:user.php

示例4: isBlocked

 public static function isBlocked()
 {
     $ip_block_model = new self();
     $ip_block_model->setCond('ip = "' . $_SERVER['REMOTE_ADDR'] . '"');
     $ip_block = $ip_block_model->load();
     return !empty($ip_block);
 }
開發者ID:kirygithub,項目名稱:chatNow,代碼行數:7,代碼來源:IpBlockModel.class.php

示例5: store

	/**
	 * @param bool $updateNulls
	 * @return bool
	 */
	public function store( $updateNulls = false )
	{
		global $_PLUGINS;

		$new	=	( $this->get( 'id' ) ? false : true );
		$old	=	new self();

		if ( ! $new ) {
			$old->load( (int) $this->get( 'id' ) );

			$_PLUGINS->trigger( 'gj_onBeforeUpdateNotification', array( &$this, $old ) );
		} else {
			$_PLUGINS->trigger( 'gj_onBeforeCreateNotification', array( &$this ) );
		}

		if ( ! parent::store( $updateNulls ) ) {
			return false;
		}

		if ( ! $new ) {
			$_PLUGINS->trigger( 'gj_onAfterUpdateNotification', array( $this, $old ) );
		} else {
			$_PLUGINS->trigger( 'gj_onAfterCreateNotification', array( $this ) );
		}

		return true;
	}
開發者ID:kosmosby,項目名稱:medicine-prof,代碼行數:31,代碼來源:NotificationTable.php

示例6: store

	/**
	 * @param bool $updateNulls
	 * @return bool
	 */
	public function store( $updateNulls = false )
	{
		global $_PLUGINS;

		$new	=	( $this->get( 'id' ) ? false : true );
		$old	=	new self();

		$this->set( 'date', $this->get( 'date', Application::Database()->getUtcDateTime() ) );

		if ( ! $new ) {
			$old->load( (int) $this->get( 'id' ) );

			$_PLUGINS->trigger( 'gj_onBeforeUpdateAttendance', array( &$this, $old ) );
		} else {
			$_PLUGINS->trigger( 'gj_onBeforeCreateAttendance', array( &$this ) );
		}

		if ( ! parent::store( $updateNulls ) ) {
			return false;
		}

		if ( ! $new ) {
			$_PLUGINS->trigger( 'gj_onAfterUpdateAttendance', array( $this, $old ) );
		} else {
			$_PLUGINS->trigger( 'gj_onAfterCreateAttendance', array( $this ) );
		}

		return true;
	}
開發者ID:kosmosby,項目名稱:medicine-prof,代碼行數:33,代碼來源:AttendanceTable.php

示例7: collectDay

 public static function collectDay($date)
 {
     $instance = new self();
     $instance->load($date, 'date');
     $instance->setDate($date);
     $carts = Mage::getModel('adjcartalert/quotestat')->getCollection();
     $carts->getSelect()->where('`cart_abandon_date` BETWEEN \'' . $instance->getDate() . '\' AND \'' . $instance->getDate() . '\' + INTERVAL 1 DAY');
     $abandonedItemsNum = 0;
     $abandonedCartsPrice = 0;
     $recoveredCarts = 0;
     $orderedItemsNum = 0;
     $orderedCartsPrice = 0;
     $orderedCarts = 0;
     $letterStep = 0;
     //$orderTime = 0;
     $moduleCouponsUsed = 0;
     foreach ($carts as $cart) {
         $abandonedCartsPrice += $cart->getCartPrice();
         $items = unserialize($cart->getCartItems());
         foreach ($items as $item) {
             $abandonedItemsNum += $item;
         }
         if ($cart->getRecoveryDate()) {
             $recoveredCarts++;
         }
         if ($cart->getOrderDate()) {
             $orderedCarts++;
             $orderedCartsPrice += $cart->getOrderPrice();
             $items = unserialize($cart->getOrderItems());
             foreach ($items as $item) {
                 $orderedItemsNum += $item;
             }
             $letterStep += $cart->getAlertNumber();
         }
         if ($cart->getAlertCouponGenerated() != '' && $cart->getAlertCouponGenerated() == $cart->getOrderCouponUsed()) {
             $moduleCouponsUsed++;
         }
     }
     $instance->setAbandonedCartsNum(count($carts));
     $instance->setAbandonedCartsPrice($abandonedCartsPrice);
     $instance->setAbandonedItemsNum($abandonedItemsNum);
     $instance->setRecoveredCartsNum($recoveredCarts);
     $instance->setOrderedCartsNum($orderedCarts);
     $instance->setOrderedCartsPrice($orderedCartsPrice);
     $instance->setOrderedItemsNum($orderedItemsNum);
     $instance->setOrderedItemsNum($orderedItemsNum);
     $instance->setCouponsUsed($moduleCouponsUsed);
     if ($orderedCarts) {
         /*$orderTime = round($orderTime / $orderedCarts);
           $orderTimeS = $orderTime % 60;
           $orderTime = (int)$orderTime/60;
           $orderTimeM = $orderTime % 60;
           $orderTime = (int)$orderTime/60;
           $instance->setAvBackTime($orderTime.':'.$orderTimeM.':'.$orderTimeS);*/
         $instance->setTargetLetterStep($letterStep / $orderedCarts);
     }
     $instance->save();
 }
開發者ID:rajarshc,項目名稱:Rooja,代碼行數:58,代碼來源:Dailystat.php

示例8: create

 /**
  * @param string $path_
  * @param string $storage_
  * @param string[] $schema_
  *
  * @return \Components\Media_Store
  */
 public static function create($path_, $storage_, array $schema_)
 {
     $instance = new self($path_);
     $instance->initialize();
     @file_put_contents($instance->path . '/' . self::NAME_MANIFEST, json_encode(['storage' => $storage_, 'schema' => $schema_]));
     $instance->load();
     Cache::set('components/media/store/' . md5($path_), serialize($instance));
     return $instance;
 }
開發者ID:evalcodenet,項目名稱:net.evalcode.components.media,代碼行數:16,代碼來源:store.php

示例9: factory

 public static function factory($model)
 {
     $paths = static::service('paths');
     $paths->setModel($model);
     $relations = new self();
     $relations->setRelationsTree($paths->relationsTree())->setRelationsTreeIndex($paths->relationsTreeIndex());
     $relations->load();
     return $relations;
 }
開發者ID:ttmdear,項目名稱:juborm,代碼行數:9,代碼來源:Relations.php

示例10: getInstance

 public static function getInstance($file)
 {
     static $instance;
     if (!$instance) {
         $instance = new self();
         $instance->load($file);
     }
     return $instance;
 }
開發者ID:EmmiSiitonen,項目名稱:Hops-palvelu,代碼行數:9,代碼來源:configuration.php

示例11: getByName

 /**
  * @param $name
  * @return Config
  * @throws \Exception
  */
 public static function getByName($name)
 {
     $pipe = new self();
     $pipe->setName($name);
     if (!is_readable($pipe->getConfigFile()) || !$pipe->load()) {
         throw new \Exception("video thumbnail definition : " . $name . " does not exist");
     }
     return $pipe;
 }
開發者ID:yonetici,項目名稱:pimcore-coreshop-demo,代碼行數:14,代碼來源:Config.php

示例12: getByID

 public static function getByID($avID)
 {
     $cav = new self();
     $cav->load($avID);
     if ($cav->getAttributeValueID() == $avID) {
         return $cav;
     }
     return null;
 }
開發者ID:ExchangeCore,項目名稱:concrete5-attribute-forms,代碼行數:9,代碼來源:AttributeFormValue.php

示例13: getByName

 /**
  * @param $name
  * @return Config
  * @throws \Exception
  */
 public static function getByName($name)
 {
     $letter = new self();
     $letter->setName($name);
     if (!$letter->load()) {
         throw new \Exception("newsletter definition : " . $name . " does not exist");
     }
     return $letter;
 }
開發者ID:ChristophWurst,項目名稱:pimcore,代碼行數:14,代碼來源:Config.php

示例14: getByHandle

 public static function getByHandle($akHandle)
 {
     $ak = new self();
     $ak->load($akHandle, 'akHandle');
     if ($ak->getAttributeKeyID() < 1) {
         $ak = -1;
     }
     return $ak;
 }
開發者ID:ExchangeCore,項目名稱:concrete5-attribute-forms,代碼行數:9,代碼來源:AttributeFormKey.php

示例15: getByName

 /**
  * @static
  * @param  $name
  * @return Tool_Tag_Config
  */
 public static function getByName($name)
 {
     $tag = new self();
     $tag->setName($name);
     if (!$tag->load()) {
         throw new Exception("tag definition : " . $name . " does not exist");
     }
     return $tag;
 }
開發者ID:shanky0110,項目名稱:pimcore-custom,代碼行數:14,代碼來源:Config.php


注:本文中的self::load方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。