AppIntegrator_model

Extends \CI_Model

This model file maintains tables of application integration informations

Functions available :-

    function __construct() - class constructor
    function exists() - checks for existing primary key
    function getArray() - gets table header array
    function getHeader() - gets record column information
    function get_data() - gets recrdset
    function set_query() - sets query to quiry the table
    function count_data() - counts the record set
    function save() - saves submitted data
    function delete() - deletes records
    function getMetadata() - gets table column information
    function get_app_data() - gets application data from db

Creation date :- Jun 5, 2014 Last Modified on :- Last Modification :-

package

AIR\Models\AppIntegrator_model

author

Mohamed Ruzaik Mohamed Roshan roshan@ekwa.com

version

V 2.7.0

created

Jun 5, 2014

Methods

Abstract __construct function

__construct() 

Meta Information will be generated at the class initialization

count_data() function

count_data( $data) : \All

gets complete data from the table with the facility of selection and filters. Then counts returned records

Arguments

$data

is a composit array with elements for selection - fields that are to be selected / default *, filter - the conditions for where clause, group by , having and order by Ex: Array(['selection']=>'table_name.field_name1,table_name.field_name2', ['filter']=>array(field_name=>value), ['group_by']=>'field_name1,field_name2', ['having']=>array(filed_name => value) , ['order_by']=>array(filed_name => order)); ['order_by']=>array(filed_name => order) - order is asc/desc

Response

\All

data, as an associative array with use of getArray() function

delete() function

delete( $pks) : \status

Delete record(s) from table

Arguments

$pks

Response

\status

of Query execution , TRUE if successful, otherwise FALSE

exists() function

exists( $primekey) : TRUE

Checks whether given entity exists in database or not

Arguments

$primekey

is an array of key field and value, starting index of dataset, useful for pagination etc Ex: Array($field_name=>value);

Response

TRUE

if exists, FALSE if not

get_app_data($integration_id,$calling_app_id,$called_app_id,$calling_app_func_id)

get_app_data(integer $integration_id, integer $calling_app_id, integer $called_app_id, integer $calling_app_func_id) : array

This method gets application information from db for given parameters

Arguments

$integration_id

integer

$calling_app_id

integer

$called_app_id

integer

$calling_app_func_id

integer

Response

array

get_data() function

get_data( $data) : \All

gets complete data from the table with the facility of selection and filters.Records can be grouped and ordered

Arguments

$data

is a composit array with elements for selection - fields that are to be selected / default *, filter - the conditions for where clause, group by , having and order by Ex: Array( ['selection']=>'table_name.field_name1,table_name.field_name2', ['filter']=>array(field_name=>value), ['group_by']=>'field_name1,field_name2', ['having']=>array(filed_name => value) , ['order_by']=>array(filed_name => order)); ['order_by']=>array(filed_name => order) - order is asc/desc

        $data['search'] is a an associative array
        will have the field, value and query method as array object
        array('search_field' => $field, 'search_text' => $search_text,'query_method'=>$query_method);
        search_field=> table field name
        search_text=> text / id to be searched
        query_method=> equal/like the query method to be used for the search

Response

\All

data, as an associative array with use of getArray() function

getArray() function

getArray( $data) : \An

converts database query resultset to an associative array

Arguments

$data

Response

\An

associative array of resultset and associate db table field comments

getHeader() function

getHeader(array $data) : array

This is a standard model function to get table column information

Arguments

$data

array

Response

array

record set

save() function

save( &$ar_applications_data,  $key = false) : \status

Insert data as a new record, if not exists, otherwise do Update

Arguments

$ar_applications_data

$key

an array of key field names and values

Response

\status

of Query execution , TRUE if successful, otherwise FALSE

set_query() function

set_query(array $data, boolean $limit_enable) 

This function is a standard model function. It sets query string to retrive table records based on given params

Arguments

$data

array

$limit_enable

boolean

Properties