本文整理汇总了PHP中self::init方法的典型用法代码示例。如果您正苦于以下问题:PHP self::init方法的具体用法?PHP self::init怎么用?PHP self::init使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类self
的用法示例。
在下文中一共展示了self::init方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: create
/**
* Static constructor.
*
* @param MiniGameId $gameId
* @param PlayerId $playerId
* @param PlayerOptions $playerOptions
* @param Context $context
*
* @return JoinGameCommand
*/
public static function create(MiniGameId $gameId, PlayerId $playerId, PlayerOptions $playerOptions, Context $context = null)
{
$obj = new self();
$obj->init($gameId, $playerId, $context);
$obj->playerOptions = $playerOptions;
return $obj;
}
示例2: getConfig
/**
* Get an instance of the columnconfig class.
*
* @param Node $node
* @param string $id
* @param bool $forceNew force new instance?
*
* @return ColumnConfig An instance of the columnconfig class
*/
public static function getConfig($node, $id = null, $forceNew = false)
{
static $s_instances = [];
$sm = SessionManager::getInstance();
if ($id == null) {
$id = $node->atkNodeUri();
}
if (!isset($s_instances[$id]) || $forceNew) {
$cc = new self();
$s_instances[$id] = $cc;
$cc->setNode($node);
$colcfg = $sm != null ? $sm->pageVar('atkcolcfg_' . $id) : null;
if (!is_array($colcfg) || $forceNew) {
// create new
Tools::atkdebug('New colconfig initialising');
$cc->init();
} else {
// inherit old config from session.
Tools::atkdebug('Resuming colconfig from session');
$cc->m_colcfg =& $colcfg;
}
// See if there are any url params which influence this colcfg.
$cc->doUrlCommands();
}
if ($sm != null) {
$sm->pageVar('atkcolcfg_' . $id, $s_instances[$id]->m_colcfg);
}
return $s_instances[$id];
}
示例3: create
/**
* Static constructor.
*
* @param TwitterMessageId $id
* @param TwitterUser $recipient
* @param TwitterUser $sender
* @param string $text
* @param \DateTimeInterface $createdAt
* @param TwitterEntities $entities
*
* @return TwitterDirectMessage
*/
public static function create(TwitterMessageId $id, TwitterUser $sender, TwitterUser $recipient, $text, \DateTimeInterface $createdAt, TwitterEntities $entities)
{
$obj = new self();
$obj->init($id, $sender, $text, $entities, $createdAt);
$obj->recipient = $recipient;
return $obj;
}
示例4: quickStart
public static function quickStart()
{
$Loader = new self();
$Loader->init();
$Loader->display();
return $Loader;
}
示例5: create
/**
* Construct
*
* @param MiniGameId $id
* @param PlayerId $playerId
* @param GameOptions $options
* @param Context $origin
*
* @return CreateGameCommand
*/
public static function create(MiniGameId $id, PlayerId $playerId, GameOptions $options = null, Context $origin = null)
{
$obj = new self();
$obj->init($id, $playerId, $origin);
$obj->options = $options;
return $obj;
}
示例6: build
/**
* Build a migration file using a given table.
*
* @param Table $table
* @return mixed
*/
public static function build(Table $table)
{
$squasher = new self($table);
$squasher->content = $squasher->init();
$squasher->fillInTableData();
$squasher->content .= $squasher->close();
return str_replace("\n", PHP_EOL, $squasher->content);
}
示例7: create
/**
*
* @param string $action
* @param \CourseDescription\CourseDescription $description
* @return \CourseDescription\CourseDescription
*/
static function create($action, $description = null)
{
$result = new self('course_description', 'post', $action);
if ($description) {
$result->init($description);
}
return $result;
}
示例8: create
/**
*
* @param string $action
* @param \Glossary\Glossary $item
* @return \Glossary\GlossaryForm
*/
static function create($action, $item = null)
{
$result = new self('glossary', 'post', $action);
if ($item) {
$result->init($item);
}
return $result;
}
示例9: create
/**
* Constructor
*
* @param PlayerId $playerId
* @param MiniGameId $gameId
* @param string $name
* @param int $lives
* @param string $externalReference
*
* @return HangmanPlayerOptions
*/
public static function create(PlayerId $playerId, MiniGameId $gameId, $name, $lives, $externalReference = null)
{
$obj = new self();
$obj->init($playerId, $gameId, $name);
$obj->lives = $lives;
$obj->externalReference = $externalReference;
return $obj;
}
示例10: staticInit
/**
* No LSB in pre-5.3 PHP, to be refactored later
*/
public static function staticInit( Parser &$parser ) {
global $egParserFunEnabledFunctions;
if( in_array( 'parse', $egParserFunEnabledFunctions ) ) {
// only register function if not disabled by configuration
$instance = new self;
$instance->init( $parser );
}
return true;
}
示例11: getInstance
public static function getInstance(array $config)
{
if (self::$_instance === null) {
$instance = new self();
$instance->init($config);
self::$_instance = $instance;
}
return self::$_instance;
}
示例12: get_instance
/**
* Singleton class instance
* @return Login_Counter
*/
public static function get_instance()
{
static $instance;
if (!isset($instance)) {
$instance = new self();
$instance->init();
}
return $instance;
}
示例13: getInstance
/**
* 获取一个Cache_Memcache实例
*
* @param integer $clusterId cluster id
* @return object
*/
public static function getInstance($config_name = 'DefaultMemcacheServers')
{
if (empty(self::$_objList[$config_name])) {
$obj = new self($config_name);
$obj->init();
self::$_objList[$config_name] =& $obj;
}
return self::$_objList[$config_name];
}
示例14: from
public static function from($params = array())
{
$client = new self();
foreach ($params as $key => $val) {
$client->{$key} = $val;
}
$client->init();
return $client;
}
示例15: instance
/**
* Instance factory
*
* @since 1.0.0
*/
public static function instance()
{
static $instance = null;
if (null === $instance) {
$instance = new self();
$instance->init();
$instance->setup_actions();
}
return $instance;
}