Example #1
0
 /**
  * Constructor
  */
 public function __construct()
 {
     parent::__construct();
     // Load stuff needed for this controller.
     $this->load->helper('form');
     $this->load->helper('typography');
     $this->load->helper('security');
     $this->load->library('form_validation');
     $this->load->model('survey_model');
     $this->load->model('call_task_model');
     load_entity('call_task');
     // Some data can't be stored on codeigniter session.
     // Start a regular php session.
     session_start();
 }
<?php

if (!defined('BASEPATH')) {
    exit('No direct script access allowed');
}
// Load the user entity.
// Since the model works with user entity its safe to load it here.
load_entity('call_task');
/**
 * Call Task model.
 */
class Call_task_model extends CI_Model
{
    /**
     * Mongo db collection for this model.
     */
    const COLLECTION = 'call_tasks';
    /**
     * Mongo db counter collection for this model.
     */
    const COUNTER_COLLECTION = 'call_task_ctid';
    /**
     * Model constructor.
     */
    function __construct()
    {
        parent::__construct();
    }
    /**
     * Returns all the Call tasks of a given survey.
     *  
 public static function setUpBeforeClass()
 {
     load_entity('survey_result');
 }
 public static function setUpBeforeClass()
 {
     load_entity('user');
 }
Example #5
0
<?php

if (!defined('BASEPATH')) {
    exit('No direct script access allowed');
}
// Load the user entity.
// Since the model works with user entity its safe to load it here.
load_entity('user');
/**
 * User model.
 */
class User_model extends CI_Model
{
    /**
     * Mongo db collection for this model.
     */
    const COLLECTION = 'users';
    /**
     * Mongo db counter collection for this model.
     */
    const COUNTER_COLLECTION = 'user_uid';
    /**
     * Model constructor.
     */
    function __construct()
    {
        parent::__construct();
    }
    /**
     * Returns all the users as User_entity
     * @param mixed $statuses
<?php

if (!defined('BASEPATH')) {
    exit('No direct script access allowed');
}
// Load the survey entity.
// Since the model work with survey entity its safe to load it here.
load_entity('survey');
/**
 * Survey model.
 */
class Survey_model extends CI_Model
{
    /**
     * Mongo db collection for this model.
     */
    const COLLECTION = 'surveys';
    /**
     * Mongo db counter collection for this model.
     */
    const COUNTER_COLLECTION = 'survey_sid';
    /**
     * Model constructor.
     */
    function __construct()
    {
        parent::__construct();
    }
    /**
     * Returns all the surveys as Survey_entity.
     * It is possible to restrict the query by passing some params.
 public static function setUpBeforeClass()
 {
     load_entity('call_task');
 }
<?php

if (!defined('BASEPATH')) {
    exit('No direct script access allowed');
}
// Load the Survey Result Entity.
// Since the model works with user entity its safe to load it here.
load_entity('survey_result');
/**
 * Survey Result model.
 */
class Survey_result_model extends CI_Model
{
    /**
     * Mongo db collection for this model.
     */
    const COLLECTION = 'survey_results';
    /**
     * Mongo db counter collection for this model.
     */
    const COUNTER_COLLECTION = 'survey_result_srid';
    /**
     * Model constructor.
     */
    function __construct()
    {
        parent::__construct();
    }
    /**
     * Returns the survey result with the given srid
     * @param int srid