function executeRequest() { $my_path = Request::getRequestPath(); $my_name = Request::getRequestName(); $peer = new PaginePeer(); $peer->path__EQUAL($my_path); $peer->nome__EQUAL($my_name); $all_pages = $peer->find(); $my_page = $all_pages[0]; $peer_ep = new ElementiPaginaPeer(); $peer_ep->id_pagina__EQUAL($my_page->id); $all_elementi_pagina = $peer_ep->find(); /* * Carico tutti gli elementi pagina * Nel nome di un settore eventualmente ci posso mettere una descrizione * */ foreach ($all_elementi_pagina as $elem) { $categoria = $elem->categoria; $sotto_categoria = $elem->sotto_categoria; $specifica = $elem->specifica; $categoria_instance = __create_instance(StringUtils::underscored_to_camel_case($categoria) . "SectorRenderer"); $result = $categoria_instance->{$sotto_categoria}($specifica); set_sector($elem->path_settore, $result); } /* * Questi rendering popolano i vari settori a modo loro * */ //render pagina render(PageData::instance()->get("/")); //trova il layout e renderizza il tutto. }
private static function internalInit() { if (self::$session_engine === null) { self::$session_engine = __create_instance(self::$session_engine_class); } return self::$session_engine; }
public static function create($type, $name, $value = null) { list($form_class_prefix, $function_name) = explode("/", $type); $class_name = StringUtils::underscored_to_camel_case($form_class_prefix) . "FormFieldFactory"; $form_field_factory = __create_instance($class_name); $form_field_factory->{$function_name}($name, $value); }
static function createRenderer($categoria) { if (isset(self::$renderers[$categoria])) { $renderer_name = $categoria; } $renderer_class_name = StringUtils::underscored_to_camel_case($renderer_name . "_sector_renderer"); return __create_instance($renderer_class_name); }
function apply($peer, $object) { $type = $object[$this->entity_type_field_name]; $id = $object[$this->entity_id_field_name]; $decoration_peer = __create_instance(StringUtils::underscored_to_camel_case($type . "_peer")); $decoration = ActiveRecordUtils::toArray($decoration_peer->find_by_id($id)); $object[$this->entity_type_field_name] = $decoration; return array($peer, $object); }
public static function fromArrayDOToDO($array) { if (array_key_exists(AbstractDO::CLASS_FIELD_KEY, $array)) { $raw_class_name = $array[AbstractDO::CLASS_FIELD_KEY]; $do = __create_instance($raw_class_name . "DO"); $do->__fromArray($array); return $do; } else { throw new ActiveRecordException("Impossibile caricare oggetto dall'array."); } }
private static function apply_patterns($result) { $current_result = $result; foreach ($this->patterns as $pattern_name) { $pattern_class = __create_instance(StringUtils::underscored_to_camel_case($pattern_name . "_pattern")); if ($pattern_class->needs_apply($result)) { $current_result = $pattern_class->apply($current_result); } } return $current_result; }
public static function create($controller_name) { if (!self::$initialized) { self::init(); } if (self::can_create($controller_name)) { $controller_class = self::get_controller_class_from_name($controller_name); $controller = __create_instance($controller_class); return $controller; } else { Log::error(__METHOD__, "Non posso creare il controller {$controller_name} ."); } }
static function load_attributes($result) { $folder_attribs_peer = new FolderAttribsPeer(); $folder_attribs_peer->id_folder__EQUALS($result["id"]); $attribs = $folder_attribs_peer->find(); $result["attributes"] = array(); foreach ($attribs as $attr) { $attribute_peer = __create_instance(StringUtils::underscored_to_camel_case($attr->attrib_name . "_peer")); $attribute_ob = $attribute_peer->find_by_id($attr->attrib_pk); if (!isset($result["attributes"][$attr->attrib_name])) { $result["attributes"][$attr->attrib_name] = array(); } $result["attributes"][$attr->attrib_name][] = ActiveRecordUtils::toArray($attribute_ob); } return $result; }
function getService() { return __create_instance($this->class_name); }
private static function __askPeer($raw_class_name, $method) { $class_name = $raw_class_name . "Peer"; $peer = __create_instance($class_name); return $peer->{$method}(); }
public static function getProfilePeerInstance($profile_id) { self::check_registered_profile($profile_id); return __create_instance(self::$profile_map[$profile_id]["peer_class_name"]); }
public function new_do() { return __create_instance($this->__getDataObjectClassName()); }
public function __construct($data_access_factory_class = "__MysqlDataAccessFactory") { $this->dataAccessFactoryClass = $data_access_factory_class; $this->dataAccessFactory = __create_instance($data_access_factory_class); }
public static function registerEngine($engine_class_name) { self::$engines[] = __create_instance($engine_class_name); }