function __construct($data, $options = array()) { parent::__construct($data, $options); if ($this->_filter === null) { throw new \Exception('option "filter" is required for a FilterWrapper'); } if ($this->_inputFilter === null) { $this->_inputFilter = $this->_filter; } if ($this->_outputFilter === null) { $this->_outputFilter = $this->_filter; } }
function __construct($text) { self::$patterns = array('#http://www\\.dailymotion\\.com/video/(?<id>[a-zA-Z0-9]+)_#', '#http://www\\.dailymotion\\.com/[a-z]+/video/(?<id>[a-zA-Z0-9]+)#'); parent::__construct($text); if (!$this->info) { $pattern = '#http://www\\.dailymotion\\.com/video/([a-zA-Z0-9]+)#'; if (preg_match($pattern, $text, $match)) { $long_id = $match[1]; $url = 'https://api.dailymotion.com/video/' . $long_id; $cache_id = md5($url); if (!($data = $this->cache->get($cache_id))) { $data = json_decode(file_get_contents($url)); if ($data) { $this->cache->set($cache_id, $data); } } $this->info = array('id' => $data->id); } } }
/** * prepare tab content element * @param $objElement */ public function __construct($objElement) { parent::__construct($objElement); // load tab definitions if ($this->objWrapper->getType() == ContentWrapper\Model::TYPE_START) { $tabs = deserialize($this->tabs, true); $tab = null; foreach ($tabs as $i => $t) { $tabs[$i]['id'] = standardize($t['title']); if ($t['type'] != 'dropdown' && $tab === null) { $tab = $tabs[$i]; } } $this->arrTabs = $tabs; $this->arrTab = $tab; $this->fade = $this->bootstrap_fade; } elseif ($this->objWrapper->getType() == ContentWrapper\Model::TYPE_SEPARATOR) { $elements = $this->Database->prepare('SELECT id FROM tl_content WHERE bootstrap_parentId=? ORDER by sorting')->execute($this->bootstrap_parentId); /** @var \Database\Result $elements */ $elements = array_merge(array($this->bootstrap_parentId), $elements->fetchEach('id')); $index = 0; $parent = \ContentModel::findByPK($this->bootstrap_parentId); if ($parent) { $parent = new ContentWrapper\Model($parent); $this->fade = $parent->bootstrap_fade; } $tabs = deserialize($parent->bootstrap_tabs, true); foreach ($tabs as $i => $t) { $tabs[$i]['id'] = standardize($t['title']); if ($t['type'] != 'dropdown') { if ($elements[$index] == $this->id) { $this->arrTab = $tabs[$i]; } $index++; } } $this->arrTabs = $tabs; } }
/** * {@inheritdoc} */ public function __construct($codeStore, $nameMangler, $lobAsString) { parent::__construct($codeStore, $nameMangler, $lobAsString); $this->exceptions[] = 'ResultException'; $this->imports[] = 'SetBased\\Stratum\\Exception\\ResultException'; }
public function __construct($file, $bare = true) { parent::__construct($file); $this->bare = $bare; }
function __construct($text) { self::$patterns = array('#https?://vimeo.com/(?<id>[0-9]+)#', '#https?://vimeo.com/channels/.*?/(?<id>[0-9]+)#', '#https?://vimeo.com/groups/.*?/videos/(?<id>[0-9]+)#'); $this->options += array('byline' => 0, 'portrait' => 0); parent::__construct($text); }
function __construct($text) { self::$patterns = array('#https?://test\\.com/(\\d+)#'); parent::__construct($text); }
function __construct($text) { self::$patterns = array('#https?://twitter\\.com/[a-zA-Z0-9_]+/status/(?<id>\\d+)#'); $this->options += array('lang' => 'en'); parent::__construct($text); }
function __construct($text) { self::$patterns = array('#https?://youtu\\.be/(?<id>[a-zA-Z0-9\\-_]+)#', '#https?://www\\.youtube(-nocookie)?\\.com/\\S+[\\?&;]v=(?<id>[a-zA-Z0-9\\-_]+)#'); $this->options += array('wmode' => 'transparent'); parent::__construct($text); }