/** * prepares arguments for DML */ protected function _prep_args() { // this is the data prepared for binding. // these fields are ordered as they are in the table $args = array('the_id' => $this->id, 'gate_id' => $this->gate_id, 'name' => $this->name, 'slug' => $this->slug ?: \PSU::createSlug($this->name), 'legacy_code' => $this->legacy_code); return $args; }
/** * prepares arguments for DML */ protected function _prep_args() { // this is the data prepared for binding. // these fields are ordered as they are in the table $args = array('the_id' => $this->id, 'sau_id' => $this->sau_id, 'district_id' => $this->district_id, 'school_type_id' => $this->school_type_id, 'school_approval_level_id' => $this->school_approval_level_id, 'name' => $this->name, 'slug' => $this->slug ?: \PSU::createSlug($this->name), 'grade_span' => $this->grade_span, 'enrollment' => $this->enrollment, 'street_line1' => $this->street_line1, 'street_line2' => $this->street_line2, 'city' => $this->city, 'state' => $this->state, 'zip' => $this->zip, 'phone' => $this->phone, 'fax' => $this->fax, 'legacy_code' => $this->legacy_code); return $args; }
/** * prepares arguments for DML */ protected function _prep_args() { // this is the data prepared for binding. // these fields are ordered as they are in the table $args = array('the_id' => $this->id, 'name' => $this->name, 'slug' => $this->slug ?: \PSU::createSlug($this->name), 'street_line1' => $this->street_line1, 'street_line2' => $this->street_line2, 'city' => $this->city, 'state' => $this->state, 'zip' => $this->zip, 'phone' => $this->phone, 'fax' => $this->fax, 'legacy_code' => $this->legacy_code); return $args; }
public function types($search = null) { $types = array(); foreach (self::items($search) as $item) { $types[\PSU::createSlug($item['type'])] = $item['type']; } //end foreach return $types; }
public function getReceivableNetAmount($params = '') { $params = \PSU::params($params); $token = ''; if (count($params) == 0) { $token = 'total'; } else { ksort($params); foreach ($params as $key => $param) { $token .= $key . $param; } //end foreach } //end else $token = \PSU::createSlug($token); if (isset($this->data['receivable_net_amount'][$token])) { $total = $this->data['receivable_net_amount'][$token]; } else { $total = 0; $sql = "BEGIN :val := tb_receivable.f_sum_net_amount(p_pidm => :pidm"; foreach ($params as $key => $p) { if ($key == 'bill_date' || $key == 'as_of_date') { $sql .= ", p_" . $key . " => to_date('" . $p . "', 'RRRR-MM-DD')"; } else { $sql .= ", p_" . $key . " => :" . $key; } } //end foreach $sql .= "); END;"; $stmt = \PSU::db('banner')->PrepareSP($sql); \PSU::db('banner')->InParameter($stmt, $this->pidm, 'pidm'); foreach ($params as $key => $p) { if ($key != 'bill_date' && $key != 'as_of_date') { \PSU::db('banner')->InParameter($stmt, $p, $key); } } //end foreach \PSU::db('banner')->OutParameter($stmt, $total, 'val'); \PSU::db('banner')->Execute($stmt); $this->data['receivable_net_amount'][$token] = $total ? $total : 0; } //end else return $total; }