/** * Return a singleton instance of the class and call setup functions. * * @since 1.0.0 * @return Theme_Posts_Shortcode */ public static function factory() { static $instance = false; if (!$instance) { $instance = new self(); $instance->setup(); } return $instance; }
/** * Get class instance * * @return object */ public static function factory() { static $instance; if (empty($instance)) { $instance = new self(); $instance->setup(); } return $instance; }
public static function instance() { static $instance; if (!is_a($instance, __CLASS__)) { $instance = new self(); $instance->setup(); } return $instance; }
/** * Returns the instance. * * @since 1.0.0 * @access public * @return object */ public static function get_instance() { static $instance = null; if (is_null($instance)) { $instance = new self(); $instance->setup(); $instance->includes(); $instance->setup_actions(); } return $instance; }
/** * Запустить типограф со стандартными параметрами * * @param string $text * @param array $options * @return string */ public static function fast_apply($text, $options = null) { $obj = new self(); if (is_array($options)) { $obj->setup($options); } $obj->set_text($text); return $obj->apply(); }
/** * Instantiate Process controller and setup * * @return object * @disposition static * @access public **/ public static function get() { $pc = new self(); $pc->setup(); return $pc; }
/** * Get or create a server. Check for servers in DB that have same TLD. * @param string $host * @param int $port * @param int $options * @return Dog_Server */ public static function getOrCreate($host, $port = 6667, $options = self::DEFAULT_OPTIONS) { if (false !== ($server = self::getByTLD(self::parseTLD($host)))) { return $server; } $server = new self(array('serv_id' => '0', 'serv_host' => $host, 'serv_port' => $port, 'serv_lang' => 'en', 'serv_triggers' => NULL, 'serv_options' => $options)); if (false === $server->insert()) { return false; } $server->setup(); return $server; }
/** * Build, setup and display a new breadcrumb trail. * * @static * @access public * * @param array $args Configuration options to modify the breadcrumb trail output. */ public static function output($args = array()) { $trail = new self($args); $trail->setup(); $trail->render(); }
public function deploy() { if ($this->getRole() != "build") { throw new Exception("only worksheets with role 'build' can be deployed!"); } $currentUser = $GLOBALS["STEAM"]->get_current_steam_user(); $userWorkroom = $currentUser->get_workroom(); $newObj = \steam_factory::create_copy($GLOBALS["STEAM"]->get_id(), $this->steamObj); $newObj->move($userWorkroom); $newWorksheet = new self($newObj->get_id()); $newWorksheet->setup(); $newWorksheet->setRole("view"); $name = $newWorksheet->getName(); $name = preg_replace('!(\\ )*\\(Vorlage\\)!isU', '', $name); $name = $name . " (Verteilkopie)"; $newWorksheet->setName($name); return $newWorksheet; }