/**
  * Method to store the item
  *
  * @package MageBridge
  * @access public
  * @param array $data
  * @return bool
  */
 public function store($data)
 {
     $row = $this->getTable();
     if (!empty($data['store'])) {
         $values = explode(':', $data['store']);
         $data['type'] = $values[0] == 'g' ? 'storegroup' : 'storeview';
         $data['name'] = $values[1];
         $data['title'] = $values[2];
         unset($data['store']);
     } else {
         $this->setError(JText::_('No store was selected'));
         return false;
     }
     if (!empty($data['default']) && $data['default']) {
         $this->storeDefault($data['type'], $data['name']);
         return true;
     }
     if (empty($data['name']) || empty($data['title'])) {
         $this->setError(JText::_('Invalid store'));
         return false;
     }
     if (empty($data['connector'])) {
         $this->setError(JText::_('No connector was selected'));
         return false;
     }
     $connector = MageBridgeConnectorStore::getConnector($data['connector']);
     if ($connector == false) {
         $this->setError(JText::_('Failed to load connector'));
         return false;
     }
     $data['connector_value'] = $connector->getFormPost($data);
     if (empty($data['label'])) {
         $data['label'] = $data['title'];
     }
     // Bind the form fields to the item table
     if (!$row->bind($data)) {
         $this->setError($this->_db->getErrorMsg());
         return false;
     }
     // Make sure the item table is valid
     if (!$row->check()) {
         $this->setError($this->_db->getErrorMsg());
         return false;
     }
     // Store the item table to the database
     if (!$row->store()) {
         $this->setError($this->_db->getErrorMsg());
         return false;
     }
     // Save the ID for later usage
     $this->_id = $row->id;
     return true;
 }