当前位置: 首页>>代码示例>>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;未经允许,请勿转载。