Location: PHPKode > projects > Jarida > jarida_1.0/classes/Entry.php
<?php

/*
                                                                                                                             
-------------------------------------------------------------------------
                                                                                                                             
Entry Class
      Abstract class to be used as a base class for all entry related classes.
                                                                                                                             
-------------------------------------------------------------------------
                                                                                                                             
Developer
      Name -- Haddad Said.
      Date -- 17-09-2004
      Version -- 0.1
                                                                                                                             
-------------------------------------------------------------------------
                                                                                                                             
Member Functions

-------------------------------------------------------------------------
                                                                                                                             
*/


class Entry
{

  //Vars to hold attributes of the entry
  var $id;

  //DB connection object
  var $db;

  //DB Resultset Resource object
  var $result;


  /*

-------------------------------------------------------------------------
Class Constructor
      
Parameters:
      id
      

Notes:
      

Example Usage:
     
-------------------------------------------------------------------------

  */

  function Entry(&$db, $id)
  {
    $this->db = &$db;
    $this->setId($id);
  }



  /*

-------------------------------------------------------------------------
Function setId
      
Parameters:
      id

Notes:
      

Example Usage:
      
-------------------------------------------------------------------------

  */

  function setId($id)
  {
    $this->id = $id;
  }



  /*

-------------------------------------------------------------------------
Function getId
      
Parameters:
      

Notes:
      

Example Usage:
      
-------------------------------------------------------------------------

  */

  function getId()
  {
    return $this->id;
  }







  /*

-------------------------------------------------------------------------
Function edit
      
Parameters:
      

Notes:
      

Example Usage:

-------------------------------------------------------------------------

  */

  function edit()
  {

  }


  /*

-------------------------------------------------------------------------
Function delete
      
Parameters:
      table

Notes:
      

Example Usage:

-------------------------------------------------------------------------

  */

  function delete($table, $key)
  {
    $query = "DELETE FROM $table WHERE $key = " . $this->getId();

    if($this->result = $this->db->doQuery($query))
      {
		return true;
      }
    else
      {
		return false;
      }

  }



}


?>
Return current item: Jarida