_data; } $this->delete(); if (is_array($data['top']) && !empty($data['top'])) { foreach ($data['top'] as $index => $v) { $row = array( 'slideId' => $this->_slideId, 'type' => $data['type'][$index], 'top' => (int) $data['top'][$index], 'left' => (int) $data['left'][$index], 'width' => (int) $data['width'][$index], 'height' => (int) $data['height'][$index], 'urlType' => $data['urlType'][$index], 'pageId' => $data['pageId'][$index], 'url' => $data['url'][$index], ); $this->_getTable()->insert($row); } } return true; } public function delete() { return $this->_getTable()->delete('`slideId` = ' . (int) $this->_slideId); } }