/** * / * @param Record $record [description] * @return [type] [description] */ public function insert(Record $record) { $fields = $record->getFieldsList(); $values = $record->getInsertValueString(); $sql = "INSERT INTO areas {$fields} VALUES {$values}"; $result = $this->db->run($sql, $record->toArray()); return $result; }
/** * / * @param Record $record [description] * @return [type] [description] */ public function insert(Record $record) { $sql = "INSERT INTO collections (type_id, parent_id, created, modified)\n VALUES (:type_id, :parent_id, NOW(), NOW())"; $result = $this->db->run($sql, array('type_id' => $record->get('type_id'), 'parent_id' => $record->get('parent_id'))); $record->remove('parent_id'); $record->remove('type_id'); $record->set('item_name', 'collection'); $record->set('item_id', $result->getLastInsertId()); $slug = $this->generateSlug($record->get('title')); $record->set('slug', $slug); $fields = $record->getFieldsList(); $values = $record->getInsertValueString(); $sql = "INSERT INTO translations {$fields} \n VALUES {$values}"; $result = $this->db->run($sql, $record->toArray()); return $result; }
/** * / * @param Record $record [description] * @return [type] [description] */ public function insert(Record $record) { $sql = "INSERT INTO resources (type_id, url, filepath, filename, extension, embed, mimetype, created, modified) \n VALUES (:type_id, :url, :filepath, :filename, :extension, :embed, :mimetype, NOW(), NOW())"; $result = $this->db->run($sql, array('type_id' => $record->get('type_id'), 'url' => $record->get('url'), 'filepath' => $record->get('filepath'), 'filename' => $record->get('filename'), 'extension' => $record->get('extension'), 'embed' => $record->get('embed'), 'mimetype' => $record->get('mimetype'))); $record->remove('type_id'); $record->remove('url'); $record->remove('filepath'); $record->remove('filename'); $record->remove('extension'); $record->remove('embed'); $record->remove('mimetype'); $record->set('item_name', 'resource'); $record->set('item_id', $result->getLastInsertId()); $slug = $this->generateSlug($record->get('title')); $record->set('slug', $slug); $fields = $record->getFieldsList(); $values = $record->getInsertValueString(); $sql = "INSERT INTO translations {$fields} \n VALUES {$values}"; $result = $this->db->run($sql, $record->toArray()); return $result; }
/** * / * @param Record $record [description] * @return [type] [description] */ public function insert(Record $record) { $fields = $record->getFieldsList(); $values = $record->getInsertValueString(); $sql = "INSERT INTO users {$fields}, created, modified\n VALUES {$values}, NOW(), NOW()"; $result = $this->db->run($sql, $record->toArray()); return $result; }