Exemple #1
0
 /**
  * constructor
  *
  * @param $person \b PSUPerson object
  * @param $level_or_data \b This can be 1 of two things:
  *                          - if a string, it is the Level code of student data (e.g. ug, gr, etc)
  *                          - if an array, it is an array of sgbstdn data
  * @param $term_code \b Effective term code
  */
 public function __construct($student, $level_or_data, $max_term_code = null, $term_code_eff = null)
 {
     parent::__construct();
     $data_loaders = array();
     $this->data_loaders = \PSU::params($data_loaders, $this->data_loaders);
     // make sure this object can access its associated PSU_Student
     if ($student instanceof \PSU\Student) {
         $this->student = $student;
     } else {
         $this->student = $person->student;
     }
     //end if
     // store the pidm globally to shorten the bind variables in queries :)
     $this->pidm = $this->student->person->pidm;
     if (is_array($level_or_data)) {
         $this->parse($level_or_data);
         $this->term_code = $max_term_code ? $max_term_code : \PSU\Student::getCurrentTerm($this->level_code);
     } else {
         $this->level_code = $level_or_data;
         $this->term_code = $max_term_code ? $max_term_code : \PSU\Student::getCurrentTerm($this->level_code);
         $this->term_code_eff = $term_code_eff;
         $this->load();
     }
     //end else
 }
 public function __construct($pidm, $term_code = null)
 {
     parent::__construct();
     $data_loaders = array('primary_spouse' => 'spouse', 'spouse_category' => 'spouse', 'income' => 'constituent_information', 'college' => 'constituent_information', 'occupation' => 'constituent_information', 'category' => 'constituent_information', 'recent_gift_date' => 'gift_summary', 'recent_gift_amount' => 'gift_summary', 'recent_designation' => 'gift_summary', 'recent_gift_year' => 'gift_summary', 'high_gift_date' => 'gift_summary', 'high_gift_amount' => 'gift_summary', 'high_designation' => 'gift_summary', 'number_gifts' => 'gift_summary', 'hard_credit' => 'gift_summary', 'pledge_payments' => 'gift_summary', 'outright_gifts' => 'gift_summary');
     $this->data_loaders = \PSU::params($data_loaders, $this->data_loaders);
     if (is_array($pidm)) {
         $this->parse($pidm);
     } else {
         $this->pidm = $pidm;
         $this->load($pidm);
     }
     //end else
 }
 public function __construct($crn, $term_code, $params = null)
 {
     parent::__construct();
     $data_loaders = array('cross_list_group' => 'cross_listed', 'cross_list_desc' => 'cross_listed', 'cross_list_max_enrollment' => 'cross_listed', 'cross_list_enrollment' => 'cross_listed', 'cross_list_seats_available' => 'cross_listed', 'meeting_times' => 'schedule', 'meeting_locations' => 'schedule');
     $this->data_loaders = \PSU::params($this->data_loaders, $data_loaders);
     $this->crn = $crn;
     $this->term_code = $term_code;
     if ($params) {
         $params = \PSU::params($params);
         $this->parse($params);
     } else {
         $this->load();
     }
     //end else
 }
 public function __construct(\PSUPerson $person, $date = null)
 {
     parent::__construct();
     $this->possible_levels = array('ug', 'gr', 'nc', 'ia');
     foreach ($this->possible_levels as $level) {
         $data_loaders[$level] = 'student_data';
     }
     //end foreach
     if (isset($date)) {
         $this->date = $date;
     } else {
         $this->date = time();
     }
     //end if
     $this->person = $person;
     $this->pidm = $this->person->pidm;
 }
 /**
  * PSUCourse constructor
  *
  * valid params (in addition to scbcrse data) used in course selection
  *   term = single/array of term codes from which to query
  *   crn = single/array of crns from which to query
  *   since = date selection should begin
  *   until = date selection should end
  *   term_low = term selection should begin
  *   term_high = term selection should end
  *
  * @param $identifier \b Identifier of user
  * @param $load \b data sets to be loaded
  */
 public function __construct($subject_code, $course_number, $params = null)
 {
     parent::__construct();
     $data_loaders = array('grading_mode_code' => 'grading_mode', 'gmod_code' => 'grading_mode', 'instructors_unique' => 'instructors', 'instructors_term_unique' => 'instructors', 'average_enrollment' => 'rosters');
     $this->data_loaders = \PSU::params($this->data_loaders, $data_loaders);
     $this->subj_code = strtoupper($subject_code);
     $this->crse_numb = strtoupper($course_number);
     if ($params) {
         $params = \PSU::params($params);
         if ($params['term_code']) {
             $params['term'] = $params['term_code'];
         }
         if ($params['crn']) {
             $this->crn = $params['crn'];
         }
         if ($params['term']) {
             $this->term = $params['term'];
         }
         if ($params['term_low']) {
             $this->term_low = $params['term_low'];
         }
         if ($params['term_high']) {
             $this->term_high = $params['term_high'];
         }
         if ($params['since']) {
             $this->since = strtotime($params['since']);
         }
         if ($params['until']) {
             $this->until = strtotime($params['until']);
         }
         unset($params['crn'], $params['term'], $params['term_code'], $params['term_low'], $params['term_high'], $params['since'], $params['until']);
         if (!empty($params)) {
             $this->parse($params);
         }
     }
     //end if
     $this->load();
 }
 public function destroy()
 {
     unset($this->person);
     parent::destroy();
 }
 /**
  * __construct
  * 
  * PSUPerson constructor
  *
  * @access		public
  * @param string $identifier Identifier of user
  * @param mixed $load data sets to be loaded. deprecated in favor of lazy loading.
  * @param $default_loaders \b bool true if we should use the default loaders
  * @todo scrub old usage of $load and remove parameter
  */
 public function __construct($identifier, $load = null, $default_loaders = true)
 {
     parent::__construct();
     $this->initial_identifier = trim($identifier);
     $this->merge_data_loaders($this);
     // deprecated load params
     //$this->load_params = PSU::params($load, $this->default_load);
     if ($default_loaders) {
         $this->add_failover('PSUPerson_Loader_SIS');
         $this->add_failover('PSUPerson_Loader_Connect');
         $this->add_failover('PSUPerson_Loader_Relationshiptemp');
     }
     $this->events->trigger('load_all');
 }
 /**
  * @param $wpid \b string the person's wpid
  * @param $type \b MyRelationshipType|array|int MyRelationshipType object, or array of ($code, $gender), or a specific type's id
  * @param $data \b array extra data provided in some situations (ie. creation of a temp id)
  */
 public function __construct($wpid, $type)
 {
     parent::__construct();
     $this->events->bind('relationship_set', array($this, 'got_relationship'));
     $this->wpid = $wpid;
     if ($type instanceof MyRelationshipType) {
         $this->type = $type;
     } elseif (is_array($type)) {
         list($atvxref_code, $gender) = $type;
         $this->type = MyRelationshipType::load($atvxref_code, $gender);
     } else {
         $rt = MyRelationshipType::load($type);
         if ($rt instanceof MyRelationshipType) {
             $this->type = $rt;
         } elseif (is_array($rt)) {
             throw new Exception('ambiguious relationship type provided, please specify gender or type id');
         } else {
             throw new Exception('unknown error while retrieving relationship type');
         }
     }
 }
 /**
  * @brief constructor
  *
  * @param mixed $params Transaction data OR the transactionid
  */
 public function __construct($params = false, $prod = false, $type = 'commerce_manager')
 {
     parent::__construct();
     $this->base_url = 'https://' . $_SERVER['HTTP_HOST'] . '/webapp/ecommerce';
     if (is_numeric($params)) {
         $this->load($params);
     } else {
         $this->parse($params);
     }
     //end else
     $sql = "SELECT * FROM all_tab_columns WHERE table_name = '" . strtoupper($this->tables['transaction']) . "'";
     $this->columns = PSU::db('banner')->GetAll($sql);
     $this->initURLParams();
 }
 /**
  * PSUPhone constructor
  */
 public function __construct($data)
 {
     parent::__construct();
     if (empty(self::$tele)) {
         $types = PSU::db('banner')->CacheGetAll("SELECT stvtele_code, stvtele_desc FROM stvtele");
         foreach ($types as $type) {
             self::$tele[$type['stvtele_code']] = $type['stvtele_desc'];
         }
     }
     if ($this->sprtele_columns === null) {
         $rset = PSU::db('banner')->CacheExecute("SELECT * FROM sprtele WHERE 1 = 2");
         $this->sprtele_columns = array();
         $i = 0;
         while ($field = $rset->FetchField($i++)) {
             $this->sprtele_columns[] = substr($field->name, 8);
         }
     }
     $this->parse($data);
 }
 public function __construct($pidm, $aid_year = null)
 {
     $this->pidm = $pidm;
     $this->aid_year = $aid_year ? $aid_year : \PSU\Student::getAidYear();
     parent::__construct();
 }
Exemple #12
0
 public function __construct($identifier, $term_code = null)
 {
     parent::__construct();
     if ($identifier instanceof \PSUPerson) {
         $this->person = $identifier;
     } else {
         $this->person = \PSUPerson::get($identifier);
     }
     //end else
     if ($this->person->include_non_bill_entries) {
         $this->include_non_bill_entries = true;
     }
     //end if
     $this->pidm = $this->person->pidm;
     $this->data_loaders = array('all_term_current_amount' => 'prepareTermBill', 'earliest_unsatisfied_term_remaining' => 'earliest_unsatisfied_term', 'other_term_current_amount' => 'prepareTermBill', 'other_term_net_amount' => 'prepareTermBill', 'other_term_aid_total' => 'other_term_aid', 'term_current_amount' => 'prepareTermBill', 'term_future_amount' => 'prepareTermBill', 'total_negative_balances' => 'all_term_balances', 'total_positive_balances' => 'all_term_balances', 'aid_total' => 'aid', 'memo_total' => 'memos', 'deposit_total' => 'deposits', 'misc_memos' => 'memos', 'receivable_total' => 'receivable', 'receivables' => 'receivable');
     if ($term_code) {
         $this->term_code = $term_code;
     }
     //end if
 }