Location: PHPKode > scripts > Bookmarks class > Bookmark.php
<?php
/*
 * This file is part of the Booby project.
 * The booby project is located at the following location:
 * http://www.nauta.be/booby/
 *
 * Booby - Copyright (c) 2003 - 2004 Barry Nauta
 *
 * The Booby project is released under the General Public License
 * More detailes in the file 'gpl.html' or on the following
 * website: http://www.gnu.org and look for licenses
 *
 * Enjoy :-)
 */
require_once ('base/model/Item.php');
/**
 * The Bookmark item.
 *
 * @author Barry Nauta March 2003
 * @package be.nauta.booby.plugins.bookmarks.model
 * @copyright 
 *
 * Copyright (c) 2003 - 2004 Barry Nauta 
 *
 * The Booby project is released under the General Public License
 * More detailes on the following
 * website: <code>http://www.gnu.org</code>
 * and look for licenses
 */
class Bookmark extends Item
{
	/**
	 * When this bookmark was last visited
	 * @access private
	 * @var string 
	 */
	var $when_visited;
	
	/**
	 * The locator (URI) of this bookmark
	 * @access private
	 * @var string 
	 */
	var $locator;
	
	/**
	 * The number of times this bookmark has been visited
	 * @access private
	 * @var int 
	 */
	var $visitCount;

	/**
	 * Full-blown Constructor.
	 * 
	 * @param integer theItemId the id of the item
	 * @param string theOwner who owns this item?
	 * @param integer theParentId what is the id of the parent of this item?
	 * @param boolean parent is this a parent (true) or child (false)
	 * @param string theName the name of this item
	 * @param string theDescription the description of this item
	 * @param string theVisibility the visibility (private or public)
	 * @param string theCategory what is the category of this item?
	 * @param string created When was this item created?
	 * @param string modified When was this item modified?
	 * @param string visited When was this item last visited?
  	 * @param string theLocator what is the locator (URL)?
	 * @param integer theVisitCount how many times has this item been vsisted?
	 */
	function Bookmark (
		$theItemId, $theOwner, $theParentId, $parent, $theName,
		$theDescription, $theVisibility, $theCategory,
		$created, $modified, $visited,
		$theLocator, $theVisitCount)
	{
		parent :: Item (
				$theItemId, 
				$theOwner, 
				$theParentId, 
				$parent,
				$theName, 
				$theDescription, 
				$theVisibility,
				$theCategory, 
				$created, 
				$modified);

		$this->type = "Bookmark";
		$this->when_visited = $visited;
		$this->locator = $theLocator;
		$this->visitCount = $theVisitCount;
	}
	
	/**
	 * Checks whether the constructed item is a valid item (has all the
	 * required fields)
	 *
	 * @return boolean <code>true</code> if the item is valid, <code>false</code> otherwise
	 */	
	function isValid ()
	{
		if (!$this->isParent ())
		{
			return parent::isValid () && $this->locator != null;
		}
		return parent::isValid ();
	}
}
?>
Return current item: Bookmarks class