<?php

    /**
     * @package dao
     */

	include_once( PLOG_CLASS_PATH."class/object/object.class.php" );
    include_once( PLOG_CLASS_PATH."class/dao/article.class.php" );

    /**
     * Represents a result generated by the link tracker feature. The link tracker simply goes through
     * all the posts made until the moment, extracting all the links it can find. The output of the
     * linktracker, internally, is an array of this object.
     *
     * The object itself offers methods to get the url to which the link was pointing to (the value of the
     * "href" attribute) and the description, which is the text that was between the opening and closing
     * tags of the anchor.     
     */
	class LinkTrackerResult extends Object {

		var $_url;
		var $_desc;
		var $_relatedPost;

        /**
         * Creates a new LinkTrackerResult object.
         *
         * @param url The url referenced by the link
         * @param desc The value of the text between the opening and closing anchor tags.
         */
		function LinkTrackerResult( $url = "", $desc = "" )
		{
			$this->Object();

			$this->_url = $url;
			$this->_desc = $desc;
			$this->_relatedPost = "";
		}

        /**
         * Returns the url of the link
         *
         * @param A string containing the url of the link.
         */
		function getUrl()
		{
			return $this->_url;
		}

        /**
         * Returns the value of the text between the opening and closing tags of the anchor.
         *
         * @return An string with the value of the text between the opening and closing tags of the anchor.
         */
        function getDescription()
        {
        	return $this->_desc;
        }

        /**
         * Returns an Article object representing the post where think link was found.
         *
         * @return An Article object representing the post where think link was found.
         */
		function getRelatedPost()
		{
			return $this->_relatedPost;
		}

        /**
         * @private
         */
		function setRelatedPost( $post )
		{
			$this->_relatedPost = $post;
		}
	}

?>
