/** * Constructor * * @param string $name * @param array $attrs */ public function __construct(Charcoal_PhpXmlParserComponent $parser, $name, $attrs) { parent::__construct(); $this->parser = $parser; $this->name = $name; $this->attrs = $attrs; }
public function __construct(Charcoal_String $file, Charcoal_Integer $line, Charcoal_Integer $range = NULL) { parent::__construct(); $this->_file = us($file); $this->_line = ui($line); $this->_range = $range ? ui($range) : self::DEFAULT_RANGE; }
public function __construct($class, $method) { parent::__construct(); $ref = new ReflectionMethod($class, $method); $this->_ref = $ref; $this->_args = $ref->getParameters(); $this->_args_cnt = $ref->getNumberOfParameters(); }
public function __construct(Charcoal_Integer $left, Charcoal_Integer $top, Charcoal_Integer $width, Charcoal_Integer $height) { parent::__construct(); $this->_left = ui($left); $this->_top = ui($top); $this->_width = ui($width); $this->_height = ui($height); }
public function __construct(Charcoal_Float $left, Charcoal_Float $top, Charcoal_Float $width, Charcoal_Float $height) { parent::__construct(); $this->_left = uf($left); $this->_top = uf($top); $this->_width = uf($width); $this->_height = uf($height); }
/** * Constructor * * @param array $data */ public function __construct(array $data) { parent::__construct(); $this->link = isset($data['link']) ? $data['link'] : ''; $this->title = isset($data['title']) ? $data['title'] : ''; $this->description = isset($data['description']) ? $data['description'] : ''; $this->date = isset($data['date']) ? $data['date'] : ''; }
/** * constructor */ public function __construct(Charcoal_String $url) { parent::__construct(); $this->original = $url; $this->url = parse_url($url); if ($this->url === FALSE) { _throw(new Charcoal_URLFormatException($url)); } }
/** * constructor */ public function __construct($values = array()) { parent::__construct($values); foreach ($values as $key => $value) { // if ( property_exists($this, $key) ){ $this->{$key} = $value; // } } }
/** * Construct object * * @param Charcoal_String|string $file_name Name of the file or directory. * @param Charcoal_File $parent Parent object */ public function __construct($file_name, $parent = NULL) { // Charcoal_ParamTrait::validateString( 1, $file_name ); // Charcoal_ParamTrait::validateFile( 2, $parent, TRUE ); assert($file_name instanceof Charcoal_String || is_string($file_name), 'Paremeter 1 must be string or Charcoal_String'); assert($parent instanceof Charcoal_File || $parent === NULL, 'Paremeter 2 must be NULL or Charcoal_File'); parent::__construct(); $path = $parent ? $parent->getPath() . '/' . us($file_name) : us($file_name); $this->path = str_replace('//', '/', $path); }
public function __construct($class_name) { // Charcoal_ParamTrait::validateString( 1, $class_name ); $class_name = us($class_name); parent::__construct(); if (!class_exists($class_name)) { _throw(new Charcoal_ClassNotFoundException($class_name)); } $this->class_name = us($class_name); }
/** * Constructor * * @param array $data */ public function __construct(Charcoal_FeedCreatorComponent $component, array $data) { parent::__construct(); $this->component = $component; $this->item = new FeedItem(); $this->item->link = isset($data['link']) ? $data['link'] : ''; $this->item->title = isset($data['title']) ? $data['title'] : ''; $this->item->description = isset($data['description']) ? $data['description'] : ''; $this->item->date = isset($data['date']) ? $data['date'] : ''; $this->item->author = isset($data['author']) ? $data['author'] : ''; }
public function __construct() { parent::__construct(); $this->values = array(); // store client cookies if ($_COOKIE && is_array($_COOKIE)) { foreach ($_COOKIE as $key => $value) { $this->values[$key] = $value; } } }
public function __construct($object_path_string) { // Charcoal_ParamTrait::validateString( 1, $object_path_string ); parent::__construct(); $object_path_string = us($object_path_string); list($object_name, $virtual_path, $real_path, $dir_list) = self::_parsePath($object_path_string); $this->_object_path_string = $object_path_string; $this->_virtual_path = $virtual_path; $this->_real_path = $real_path; $this->_object_name = $object_name; $this->_dir_list = $dir_list; }
/** * Constructor * * @param array $data */ public function __construct(array $data, array $items) { parent::__construct(); $this->subscribe_url = isset($data['subscribe_url']) ? $data['subscribe_url'] : ''; $this->date = isset($data['date']) ? $data['date'] : ''; $this->link = isset($data['link']) ? $data['link'] : ''; $this->title = isset($data['title']) ? $data['title'] : ''; $this->description = isset($data['description']) ? $data['description'] : ''; $this->items = array(); foreach ($items as $item) { $this->items[] = new Charcoal_SimplePieRSSItem($item); } }
public function __construct($values = array()) { parent::__construct(); if ($values) { if (is_array($values)) { $this->values = $values; } else { _throw(new NonArrayException($values)); } } else { $this->values = array(); } }
public function __construct($function) { parent::__construct(); try { $ref = new ReflectionFunction($function); $this->_function = $ref; $this->_args = $ref->getParameters(); $this->_args_cnt = $ref->getNumberOfParameters(); $this->_available = true; } catch (Exception $ex) { $this->_function = $function; $this->_available = false; } }
public function __construct($header, $replace) { parent::__construct(); $this->_header = $header; $this->_replace = $replace; }
/** * Constructor * * @param string|Charcoal_String $sql SQL statement(placeholders can be included) * @param array|Charcoal_HashMap $params Parameter values for prepared statement */ public function __construct($sql, $params = NULL) { parent::__construct(); $this->sql = $sql; $this->params = $params; }
/** * Constructor */ public function __construct($values = array()) { $this->values = $values; parent::__construct(); }
public function __construct($args) { parent::__construct(); $this->_args = $args; }
public function __construct(Charcoal_Sequence $global, Charcoal_Sequence $local) { parent::__construct(); $this->_global = $global; $this->_local = $local; }
public function __construct($attributes) { // Charcoal_ParamTrait::validateProperties( 1, $attributes ); parent::__construct(); $this->attributes = p($attributes); }
/** * Constructor */ public function __construct($sandbox) { // Charcoal_ParamTrait::validateSandbox( 1, $sandbox ); $this->sandbox = $sandbox; parent::__construct(); }
/** * constructor */ public function __construct() { parent::__construct(); $this->obj_name = Charcoal_System::snakeCase(get_class($this)); }
public function __construct($interface_name) { // Charcoal_ParamTrait::validateString( 1, $interface_name ); parent::__construct(); $this->interface_name = $interface_name; }
public function __construct(Charcoal_Integer $left, Charcoal_Integer $top) { parent::__construct(); $this->_left = ui($left); $this->_top = ui($top); }
public function __construct($expression) { Charcoal_ParamTrait::validateString(1, $expression); $expression = us($expression); parent::__construct(); $tokens = $this->tokenize($expression); if (count($tokens) < 1) { _throw(new Charcoal_QueryTargetException("no query target element is not specified.")); } $state = NULL; $element_list = NULL; foreach ($tokens as $token) { if (strlen($token) === 0) { continue; } if ($state === NULL) { $element_list[] = new Charcoal_QueryTargetElement(i(Charcoal_EnumQueryTargetType::TARGET_MODEL), s($token)); $state = "model set"; } elseif (in_array($state, array("model set", "join set")) && $token == 'as') { $state = "as"; } elseif ($state == "as") { $element_list[] = new Charcoal_QueryTargetElement(i(Charcoal_EnumQueryTargetType::TARGET_AS_NAME), s($token)); $state = "as set"; } elseif ($state == "model set" || $state == "as set" || $state == "join set" || $state == "on set") { if ($token == 'on') { $state = "on"; } elseif ($token == '+') { $element_list[] = new Charcoal_QueryTargetElement(i(Charcoal_EnumQueryTargetType::TARGET_INNER_JOIN)); $state = "join"; } elseif ($token == '(+') { $element_list[] = new Charcoal_QueryTargetElement(i(Charcoal_EnumQueryTargetType::TARGET_LEFT_JOIN)); $state = "join"; } elseif ($token == '+)') { $element_list[] = new Charcoal_QueryTargetElement(i(Charcoal_EnumQueryTargetType::TARGET_RIGHT_JOIN)); $state = "join"; } elseif ($state == "on set") { $element_list[] = new Charcoal_QueryTargetElement(i(Charcoal_EnumQueryTargetType::TARGET_ON_CONDITION), s($token)); } } elseif ($state == "join") { $element_list[] = new Charcoal_QueryTargetElement(i(Charcoal_EnumQueryTargetType::TARGET_MODEL), s($token)); $state = "join set"; } elseif ($state == "on") { $element_list[] = new Charcoal_QueryTargetElement(i(Charcoal_EnumQueryTargetType::TARGET_ON_CONDITION), s($token)); $state = "on set"; } } // log_debug( "debug, smart_gateway", "element_list: " . print_r($element_list,true) ); $main_model = NULL; $alias = NULL; $state = "main model"; $join_stack = new Charcoal_Stack(); foreach ($element_list as $element) { if ($state === "main model") { switch ($element->getType()) { case Charcoal_EnumQueryTargetType::TARGET_MODEL: $main_model = $element->getString(); break; case Charcoal_EnumQueryTargetType::TARGET_AS_NAME: $alias = $element->getString(); break; case Charcoal_EnumQueryTargetType::TARGET_INNER_JOIN: $join_stack->push(new Charcoal_QueryJoin(i(Charcoal_EnumSQLJoinType::INNER_JOIN))); $state = "joins"; break; case Charcoal_EnumQueryTargetType::TARGET_LEFT_JOIN: $join_stack->push(new Charcoal_QueryJoin(i(Charcoal_EnumSQLJoinType::LEFT_JOIN))); $state = "joins"; break; case Charcoal_EnumQueryTargetType::TARGET_RIGHT_JOIN: $join_stack->push(new Charcoal_QueryJoin(i(Charcoal_EnumSQLJoinType::RIGHT_JOIN))); $state = "joins"; break; } } elseif ($state === "joins") { $join = $join_stack->pop(); switch ($element->getType()) { case Charcoal_EnumQueryTargetType::TARGET_MODEL: $join->setModelName(s($element->getString())); break; case Charcoal_EnumQueryTargetType::TARGET_AS_NAME: $join->setAlias(s($element->getString())); break; case Charcoal_EnumQueryTargetType::TARGET_ON_CONDITION: $join_cond = $join->getCondition(); $join->setCondition(s($join_cond . $element->getString())); break; case Charcoal_EnumQueryTargetType::TARGET_INNER_JOIN: $join_stack->push($join); $join = new Charcoal_QueryJoin(i(Charcoal_EnumSQLJoinType::INNER_JOIN)); break; case Charcoal_EnumQueryTargetType::TARGET_LEFT_JOIN: $join_stack->push($join); $join = new Charcoal_QueryJoin(i(Charcoal_EnumSQLJoinType::LEFT_JOIN)); break; case Charcoal_EnumQueryTargetType::TARGET_RIGHT_JOIN: $join_stack->push($join); $join = new Charcoal_QueryJoin(i(Charcoal_EnumSQLJoinType::RIGHT_JOIN)); break; } $join_stack->push($join); } } $joins = $join_stack->toArray(); // log_debug( "debug, smart_gateway", "joins: " . print_r($joins,true) ); $this->model_name = $main_model; $this->alias = $alias; $this->joins = $joins; // log_debug( "debug, smart_gateway", "query_target_list: " . print_r($this,true) ); }
/** * Constructor * * @param simple_html_dom_node $element */ public function __construct($element) { Charcoal_ParamTrait::validateIsA(1, 'simple_html_dom_node', $element); parent::__construct(); $this->element = $element; }
/** * Constructor */ public function __construct($tidy_node) { parent::__construct(); $this->tidy_node = $tidy_node; }
public function __construct(Charcoal_Float $left, Charcoal_Float $top) { parent::__construct(); $this->_left = uf($left); $this->_top = uf($top); }