/**
  * Delete data
  *
  * @param int $id
  * @return int|bool
  */
 public function delete($del_id)
 {
     //        $this->_dbTable->select()
     //                ->setIntegrityCheck(false)
     //                ->from($this->_prefix.'translate_menu');
     $this->_dbTable->getAdapter()->delete($this->_prefix . 'translate', array('`key` = ?' => $del_id));
     return $this->_dbTable->getAdapter()->delete($this->_prefix . 'translate_key', array('`key` = ?' => $del_id));
 }
Example #2
0
 /** Check if valid
  * @access public
  * @param string $value
  * @param string $context
  * @return boolean
  */
 public function isValid($value, $context = null)
 {
     $this->_setValue($value);
     $where = array();
     // Check that this is not the user's own identity
     if (isset($context[$this->_idKey])) {
         $where[] = $this->_zendDbTable->getAdapter()->quoteInto($this->_primaryKeyColumn . ' != ?', $context[$this->_idKey]);
     }
     $where[] = $this->_zendDbTable->getAdapter()->quoteInto($this->_identityColumn . ' = ?', $value);
     $row = $this->_zendDbTable->fetchRow($where);
     if (null !== $row) {
         $this->_error(self::NOT_UNIQUE);
         return false;
     }
     return true;
 }
Example #3
0
 public function isValid($username, $key, $email)
 {
     $username = $this->_getParam('username');
     $key = $this->_getParam('key');
     $email = $this->_getParam('email');
     $where = array();
     // Check that this is not the user's own identity
     $where[] = $this->_zendDbTable->getAdapter()->quoteInto($this->_Key . ' = ?', $key);
     $where[] = $this->_zendDbTable->getAdapter()->quoteInto($this->_emailColumn . ' = ?', $email);
     $where[] = $this->_zendDbTable->getAdapter()->quoteInto($this->_identityColumn . ' = ?', $username);
     $row = $this->_zendDbTable->fetchRow($where);
     if (null !== $row) {
         $this->_error(self::NOT_VALID);
         return false;
     }
     return true;
 }