tangra logo
   
[ class tree: tangra_lib ] [ index: tangra_lib ] [ all elements ]
 

Class: Module_CTRL_XML_Importer

Source Location: /modules_manager/module_ctrl_xml_importer.class.php

Class Module_CTRL_XML_Importer

Inherited Properties, Constants, and Methods
Inherited Properties Inherited Methods Inherited Constants

Inherited From Tangra_Class

Tangra_Class::get_class_name()
Alias of get_class(). Exist because of historical reasons.
Tangra_Class::__set()
Overides PHP built-in method and just throws exception if called. Purpose - to "forbid" autosetting of nonexisting class properties.

[ Top ]
Constant Summary
LOCATION_TYPE_LOCAL   Location type "local"
LOCATION_TYPE_ONLINE   Location type "online repository"

[ Top ]
Method Summary
static array   capture_module_details()   Captures basic module details as hid, description, maintainer, url and license
static array   capture_module_release_details()   Extracts module release details from SimpleXMLElement object
static array   capture_relations()   Extracts relations from SimpleXMLElement object
static array   captute_params()   Extracts parameters from SimpleXMLElement object
static void   create_links_to_categories()   Creates links (Tangra_Module_Release_Category_DBC) to module categories
static Tangra_Module_DBC   create_module()   Populates Tangra_Module_DBC object and saves it in DB
static Tangra_Module_Release_DBC   create_module_release()   Creates instance of Tangra_Module_Release_DBC, populates it and saves in DB
static void   create_release_params_and_relations()   Creates release parameters and relations (Tangra_Module_Release_Param_DBC and Tangra_Module_Release_Relation_DBC)
static array   import()   Imports module information parsed from $xml_str which have to contain valid XML
static Tangra_Module_DBC   update_module()   Updates Module_CTRL_XML_Importer object and saves it in DB
static boolean   update_module_release()   Updates Tangra_Module_Release_DBC object and saves it in DB

[ Top ]
Methods
static method capture_module_details  [line 128]

  static array capture_module_details( DB_Connection $dbc, SimpleXMLElement $xml  )

Captures basic module details as hid, description, maintainer, url and license

Parameters:
DB_Connection   $dbc: 
SimpleXMLElement   $xml:  SimpleXMLElement instance usualy returned by simplexml_load_string

API Tags:
Access:  public


[ Top ]
static method capture_module_release_details  [line 201]

  static array capture_module_release_details( SimpleXMLElement $xml  )

Extracts module release details from SimpleXMLElement object

Parameters:
SimpleXMLElement   $xml: 

API Tags:
Access:  public


[ Top ]
static method capture_relations  [line 303]

  static array capture_relations( SimpleXMLElement $xml  )

Extracts relations from SimpleXMLElement object

Parameters:
SimpleXMLElement   $xml: 

API Tags:
Access:  public


[ Top ]
static method captute_params  [line 269]

  static array captute_params( SimpleXMLElement $xml  )

Extracts parameters from SimpleXMLElement object

Parameters:
SimpleXMLElement   $xml: 

API Tags:
Access:  public


[ Top ]
static method create_links_to_categories  [line 501]

  static void create_links_to_categories( DB_Connection $dbc, array $mod_release_details, integer $mod_release_id  )

Creates links (Tangra_Module_Release_Category_DBC) to module categories

Parameters:
DB_Connection   $dbc: 
array   $mod_release_details:  Array returned by Module_CTRL_XML_Importer::capture_module_release_details()
integer   $mod_release_id:  ID of module release

API Tags:
Internal:  
Access:  private


[ Top ]
static method create_module  [line 175]

  static Tangra_Module_DBC create_module( DB_Connection $dbc, SimpleXMLElement $xml  )

Populates Tangra_Module_DBC object and saves it in DB

Parameters:
DB_Connection   $dbc: 
SimpleXMLElement   $xml: 

API Tags:
Return:  On success returns Tangra_Module_DBC, on failure false
Internal:  
Access:  private


[ Top ]
static method create_module_release  [line 367]

  static Tangra_Module_Release_DBC create_module_release( DB_Connection $dbc, SimpleXMLElement $xml, integer $module_id  )

Creates instance of Tangra_Module_Release_DBC, populates it and saves in DB

Parameters:
DB_Connection   $dbc: 
SimpleXMLElement   $xml: 
integer   $module_id: 

API Tags:
Return:  on success returns Tangra_Module_Release_DBC object, on failure - false
Internal:  
Access:  private


[ Top ]
static method create_release_params_and_relations  [line 403]

  static void create_release_params_and_relations( DB_Connection $dbc, array $mod_release_details, integer $mod_release_id  )

Creates release parameters and relations (Tangra_Module_Release_Param_DBC and Tangra_Module_Release_Relation_DBC)

Parameters:
DB_Connection   $dbc: 
array   $mod_release_details:  Array returned by Module_CTRL_XML_Importer::capture_module_release_details()
integer   $mod_release_id:  ID of module release

API Tags:
Internal:  
Access:  private


[ Top ]
static method import  [line 67]

  static array import( DB_Connection $dbc, string $xml_str  )

Imports module information parsed from $xml_str which have to contain valid XML

Parameters:
DB_Connection   $dbc: 
string   $xml_str: 

API Tags:
Access:  public


[ Top ]
static method update_module  [line 523]

  static Tangra_Module_DBC update_module( DB_Connection $dbc, SimpleXMLElement $xml, Tangra_Module_DBC $module  )

Updates Module_CTRL_XML_Importer object and saves it in DB

Parameters:
DB_Connection   $dbc: 
SimpleXMLElement   $xml: 
Tangra_Module_DBC   $module: 

API Tags:
Return:  On success returns Tangra_Module_DBC object, on failure - false
Internal:  
Access:  private


[ Top ]
static method update_module_release  [line 550]

  static boolean update_module_release( DB_Connection $dbc, SimpleXMLElement $xml, Tangra_Module_Release_DBC $mod_release  )

Updates Tangra_Module_Release_DBC object and saves it in DB

Parameters:
DB_Connection   $dbc: 
SimpleXMLElement   $xml: 
Tangra_Module_Release_DBC   $mod_release: 

API Tags:
Return:  On success returns true, on failure - false
Internal:  
Access:  private


[ Top ]
Constants
LOCATION_TYPE_LOCAL = 0 [line 53]

Location type "local"


[ Top ]
LOCATION_TYPE_ONLINE = 1 [line 58]

Location type "online repository"


[ Top ]