/** * @param string $name * @param array $parameters * @params array $tags */ public function __construct($name, $parameters, $tags = null) { $this->_name = $name; $this->_parameters = $parameters; $this->_tags = $tags ? $tags : array(); parent::__construct($parameters); }
/** * Constructor. * * @param mixed $value The value to mark as safe */ public function __construct($value) { $this->value = $value; if (is_array($value) || is_object($value)) { parent::__construct($value); } }
/** * Constructor method. * * @param Crawler $crawler * A crawler object which already contains info about the page we're * scraping. * @param UrlBuilder $page * URL builder object from which we can derive the URL of the page we want * to scrape. */ public function __construct(Crawler $crawler, UrlBuilder $base_url) { $pages = array(); $externals = array(); $parse_crawler = $crawler->filter('a, link, script, img'); foreach ($parse_crawler as $element) { $attr = ''; switch ($element->tagName) { case 'a': case 'link': $attr = 'href'; break; case 'script': case 'img': $attr = 'src'; } $link_on_the_page = $element->getAttribute($attr); if ($link_on_the_page) { $url = new UrlBuilder($link_on_the_page, $base_url); // Key is URL without fragment. $url_key = $url->toUrl(FALSE); $externals[$url_key] = $url; } } parent::__construct($externals); }
/** * put your comment there... * * @param mixed $templates * @return CJTInstallerTemplate */ public function __construct($templates) { // Initialize! $this->model = CJTModel::getInstance('template'); // Initialize Iterator! parent::__construct(is_array($templates) ? $templates : array()); }
/** * @param array $services * @param string $status * @param int $count * @param int $startElement */ public function __construct(array $services, $status, $count, $startElement) { parent::__construct($services); $this->status = $status; $this->count = $count; $this->startElement = $startElement; }
public function __construct(array $filesArray = array()) { $files = array_map(function ($file) { return new MockSplFileInfo($file); }, $filesArray); parent::__construct($files); }
/** * Constructs a new collection being sure that data are all `\MarkdownExtended\API\ContentInterface` * * @param array $data */ public function __construct(array $data = array()) { parent::__construct(); foreach ($data as $item) { $this->append($item); } }
/** * @param string $name * @param array $parameters * @params array $tags */ public function __construct($name, $parameters, $metadata = array()) { $this->_name = $name; $this->_parameters = $parameters; $this->_metadata = $metadata; parent::__construct($parameters); }
public function __construct($array) { if (is_object($array)) { $array = $array->toArray(); } parent::__construct($array); }
public function __construct(array $files = [], FileSystemInterface $fileSystem = null) { foreach ($files as $key => $file) { $files[$key] = new File($file, $fileSystem); } parent::__construct($files); }
public function __construct($filename = null, $sheet = 0) { $this->filename = $filename; if (file_exists($filename)) { /* on charge le contenu du fichier dans l'objet phpExcel */ $inputFileType = PHPExcel_IOFactory::identify($filename); $objReader = PHPExcel_IOFactory::createReader($inputFileType); $this->phpExcel = $objReader->load($filename); /* on implémente dans le tableau */ // Get worksheet dimensions $sheet = $this->phpExcel->getSheet($sheet); $highestRow = $sheet->getHighestRow(); $highestColumn = $sheet->getHighestColumn(); // Loop through each row of the worksheet in turn for ($row = 1; $row <= $highestRow; $row++) { // Read a row of data into an array $rowData = $sheet->rangeToArray('A' . $row . ':' . $highestColumn . $row, NULL, TRUE, FALSE); $this->container[] = $rowData[0]; } } else { $this->phpExcel = new PHPExcel(); $this->phpExcel->setActiveSheetIndex($sheet); } parent::__construct($this->container); }
public function __construct() { $input = array(); $input[self::REGEX_USE] = $this->useMacro(); $input[self::REGEX_SPLICE] = $this->spliceMacro(); parent::__construct($input); }
public function __construct($name, DbAdapter $dbAdapter) { if ($dbAdapter) { $this->_db = $dbAdapter; } $this->_name = preg_replace('#[^a-z0-9\\_\\-]#si', '', $name); $this->getDb()->query('USE ' . $this->getName()); //$metadata = new \Zend\Db\Metadata\Metadata($dbAdapter); $sql = 'show tables'; $tableNames = $dbAdapter->fetchCol($sql); /** @var Table[] $tables */ $tables = array(); if (!empty($tableNames)) { foreach ($tableNames as $tableName) { if ($tableName[0] == '_') { continue; } $tables[] = new Table($tableName, $this); } } foreach ($tables as $table) { $this->_tableByTableNameRegistry[$table->getName()] = $table; /** @var Column $column */ foreach ($table as $column) { $this->_tableNameListByTableFieldNameRegistry[$column->getName()][] = $table->getName(); } } parent::__construct($tables); $this->initIndex(); $this->initTableLinks(); }
public function __construct($array) { if (!is_array($array) && !$array instanceof SuperGlobal) { throw new Exception('Parameter must be array or SuperGlobal'); } parent::__construct($array); }
/** * Constructs Collection object * * @param mixed $data data */ public function __construct($data = null) { parent::__construct([]); if ($data) { $this->append($data); } }
/** * @param array $paths List of paths returned by shell command * @param string $baseDir Base dir for relative path building */ public function __construct(array $paths, $baseDir) { $this->baseDir = $baseDir; $this->baseDirLength = strlen($baseDir); parent::__construct($paths); }
function __construct() { $this->state = MyArrayIterator::$fail; self::fail(0, __FUNCTION__); parent::__construct(array(1, 2)); self::fail(1, __FUNCTION__); }
public function __construct(ClassLoader $aClassLoader, $sNamespace = null, $nPriority = Package::all) { $arrClasses = array(); foreach ($aClassLoader->packageIterator($nPriority) as $aPackage) { if ($sNamespace) { $sPackageNamespace = $aPackage->ns(); if ($sNamespace == $sPackageNamespace) { $sSubNs = null; } else { if (strpos($sNamespace, $sPackageNamespace . '\\') === 0) { $sSubNs = substr($sNamespace, strlen($sPackageNamespace) + 1); } else { continue; } } } else { $sSubNs = null; } foreach ($aPackage->classIterator($sSubNs) as $sClass) { if (!in_array($sClass, $arrClasses)) { $arrClasses[] = $sClass; } } } sort($arrClasses); parent::__construct($arrClasses); }
/** * @param array $array * @throws Exception */ function __construct($array) { // Widget numbers start at 2. unset($array[0]); unset($array[1]); parent::__construct($array); }
/** * put your comment there... * * @param mixed $blocks * @return CJTInstallerBlock */ public function __construct($blocks) { // Initialize! $this->model = CJTModel::getInstance('blocks'); // Initialize Array Iterator class! parent::__construct(is_array($blocks) ? $blocks : array()); }
public function __construct(Storage\IWarehouse $warehouse, Storage\IRequestManager $request) { parent::__construct(); $this->warehouse = $warehouse; $this->request = $request; self::$history[$warehouse->getName()] = $this; }
public function __construct(array $raw = array()) { if ($raw) { $keys = array_keys($raw); $this->map = array_combine(array_map('strtolower', $keys), $keys); parent::__construct($raw); } }
public function __construct(Nette\DI\IContainer $context) { parent::__construct(); $this->context = $context; $this->download(); $this->session(); $this->loadCurrencies(); }
/** * Class constructor * * @param array $array */ public function __construct($array = []) { $array += ['class' => []]; if (is_string($array['class'])) { $array['class'] = preg_split('/\\s+/', $array['class']); } parent::__construct($array); }
public function __construct(IContainer $aParent, $aCallback) { if (!is_callable($aCallback)) { throw new Exception(__CLASS__ . "() 的参数 \$aCallback 必须是一个回调函数,传入的参数类型为:%s", Type::reflectType($aCallback)); } $arrBingo = self::searching($aParent, $aCallback); parent::__construct($arrBingo); }
public function __construct($collection, $flags = 0) { $this->_collection = $collection; if ($collection instanceof Kwf_Collection) { $collection = $collection->getArray(); } parent::__construct($collection, $flags); }
/** * Construct a new MapIterator. * * @param array $list * The list of data to traverse. * @param \Closure $callback * The callback to be called per item. * * @throws \InvalidArgumentException */ public function __construct(array $list, $callback) { parent::__construct($list); if (!is_callable($callback)) { throw new \InvalidArgumentException('The function must be a PHP "callable"'); } $this->callback = $callback; }
/** * The constructor * * @param string $name * * @param string $name The name of the entry in the $_FILES array */ public function __construct($name) { $this->far = $_FILES[$name]; /* * The 'error' sub-array is just used an iteration control and any of the field arrays could be used. */ parent::__construct($_FILES[$name]['error']); }
public function __construct($dependency, $dependencyType) { $this->_dependencyType = $dependencyType; if (!is_array($dependency)) { $dependency = array($dependency); } parent::__construct($dependency); }
/** * (PHP 5 >= 5.0.0)<br/> * Construct an ArrayIterator * * @link http://php.net/manual/en/arrayiterator.construct.php * * @param array $array The array or object to be iterated on. * @param int $flags Flags to control the behaviour of the ArrayObject object. * * @throws Exception\Collection When the given array contains invalid values * @see ArrayObject::setFlags() */ public function __construct($array = array(), $flags = 0) { foreach ($array as $value) { $this->isValidValue($value); throw Exception\Collection::invalidType($value, get_class($this)); } parent::__construct($array, $flags); }