Created
August 17, 2012 11:39
-
-
Save tkjaergaard/3378213 to your computer and use it in GitHub Desktop.
get attachment
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public function get_attachments($id,$limit=FALSE,$type='prod') | |
| { | |
| if(!is_numeric($id)): | |
| $this->error = 'We need a valid numeric ID number to get the attachments. provided: '.$id; | |
| return false; | |
| endif; | |
| if( $limit && is_numeric($limit) ) $this->db->limit($limit); | |
| // Let's define the $attr array | |
| $attr = array( | |
| 'type' => $type, | |
| 'parent' => $id | |
| ); | |
| $query = $this->db->get_where('xx_rdco_attachments', $attr); | |
| if($query->num_rows() < 1): | |
| $this->error = 'There is no attachments associated with to this id: '.$id; | |
| return false; | |
| endif; | |
| return $query->result_array(); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment