original_string: public function delete($address_id, $check = true)
      {
          $result = null;
          $this->hook->attach('address.delete.before', $address_id, $check, $result, $this);
  
          if (isset($result)) {
              return (bool) $result;
          }
  
          if ($check && !$this->canDelete($address_id)) {
              return false;
          }
  
          $result = (bool) $this->db->delete('address', array('address_id' => $address_id));
          $this->hook->attach('address.delete.after', $address_id, $check, $result, $this);
          return (bool) $result;
      }
code: public function delete($address_id, $check = true)
      {
          $result = null;
          $this->hook->attach('address.delete.before', $address_id, $check, $result, $this);
  
          if (isset($result)) {
              return (bool) $result;
          }
  
          if ($check && !$this->canDelete($address_id)) {
              return false;
          }
  
          $result = (bool) $this->db->delete('address', array('address_id' => $address_id));
          $this->hook->attach('address.delete.after', $address_id, $check, $result, $this);
          return (bool) $result;
      }
code_tokens: public function delete ( $ address_id , $ check = true ) { $ result = null ; $ this -> hook -> attach ( 'address.delete.before' , $ address_id , $ check , $ result , $ this ) ; if ( isset ( $ result ) ) { return ( bool ) $ result ; } if ( $ check && ! $ this -> canDelete ( $ address_id ) ) { return false ; } $ result = ( bool ) $ this -> db -> delete ( 'address' , array ( 'address_id' => $ address_id ) ) ; $ this -> hook -> attach ( 'address.delete.after' , $ address_id , $ check , $ result , $ this ) ; return ( bool ) $ result ; }
docstring: Deletes an address
  @param integer $address_id
  @param bool $check
  @return boolean
docstring_tokens: Deletes an address