Location: PHPKode > projects > Noti > doc/core/noti/Note.html
<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  <html xmlns="http://www.w3.org/1999/xhtml">
		<head>
			<!-- template designed by Marco Von Ballmoos -->
			<title>Docs For Class Note</title>
			<link rel="stylesheet" href="../media/stylesheet.css" />
			<meta http-equiv='Content-Type' content='text/html; charset=iso-8859-1'/>
		</head>
		<body>
			<div class="page-body">			
<h2 class="class-name">Class Note</h2>

<a name="sec-description"></a>
<div class="info-box">
	<div class="info-box-title">Description</div>
	<div class="nav-bar">
					<span class="disabled">Description</span> |
													<a href="#sec-var-summary">Vars</a> (<a href="#sec-vars">details</a>)
						|											<a href="#sec-method-summary">Methods</a> (<a href="#sec-methods">details</a>)
						
					</div>
	<div class="info-box-body">
        		<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">The Note class provides basic data access and primitive functions for notes</p>
	<ul class="tags">
				<li><span class="field">since:</span> Noti 0.5.0</li>
				<li><span class="field">version:</span> $Revision: 1.4 $</li>
				<li><span class="field">license:</span> <a href="http://www.gnu.org/licenses/gpl.txt">GPL</a></li>
				<li><span class="field">author:</span> Pablo Hoffman &lt;<a href="mailto:hide@address.com">hide@address.com</a>&gt;</li>
			</ul>
		<p class="notes">
			Located in <a class="field" href="_Note_class.html">/Note.class</a> (line <span class="field">24</span>)
		</p>
		
				
		<pre></pre>
	
			</div>
</div>



	<a name="sec-var-summary"></a>
	<div class="info-box">
		<div class="info-box-title">Variable Summary</span></div>
		<div class="nav-bar">
			<a href="#sec-description">Description</a> |
						<span class="disabled">Vars</span> (<a href="#sec-vars">details</a>)
							| 
									<a href="#sec-method-summary">Methods</a> (<a href="#sec-methods">details</a>)
							
								</div>
		<div class="info-box-body">
			<div class="var-summary">
								<div class="var-title">
					<span class="var-type">mixed</span>
					<a href="#$_category" title="details" class="var-name">$_category</a>
				</div>
								<div class="var-title">
					<span class="var-type">mixed</span>
					<a href="#$_details" title="details" class="var-name">$_details</a>
				</div>
								<div class="var-title">
					<span class="var-type">mixed</span>
					<a href="#$_id" title="details" class="var-name">$_id</a>
				</div>
								<div class="var-title">
					<span class="var-type">mixed</span>
					<a href="#$_time" title="details" class="var-name">$_time</a>
				</div>
								<div class="var-title">
					<span class="var-type">mixed</span>
					<a href="#$_title" title="details" class="var-name">$_title</a>
				</div>
								<div class="var-title">
					<span class="var-type">mixed</span>
					<a href="#$_url" title="details" class="var-name">$_url</a>
				</div>
								<div class="var-title">
					<span class="var-type">mixed</span>
					<a href="#$_viewcount" title="details" class="var-name">$_viewcount</a>
				</div>
							</div>
		</div>
	</div>

	<a name="sec-method-summary"></a>
	<div class="info-box">
		<div class="info-box-title">Method Summary</span></div>
		<div class="nav-bar">
			<a href="#sec-description">Description</a> |
																		<a href="#sec-var-summary">Vars</a> (<a href="#sec-vars">details</a>)
				 
				|
						<span class="disabled">Methods</span> (<a href="#sec-methods">details</a>)
		</div>
		<div class="info-box-body">			
			<div class="method-summary">
								
				<div class="method-definition">
											<span class="method-result">Note</span>
										<a href="#Note" title="details" class="method-name">Note</a>
											(<span class="var-type">int</span>&nbsp;<span class="var-name">$nid</span>)
									</div>
								
				<div class="method-definition">
											<span class="method-result">boolean</span>
										<a href="#exists" title="details" class="method-name">exists</a>
											(<span class="var-type">string</span>&nbsp;<span class="var-name">$nid</span>)
									</div>
								
				<div class="method-definition">
											<span class="method-result">mixed</span>
										<a href="#get" title="details" class="method-name">get</a>
											(<span class="var-type">array</span>&nbsp;<span class="var-name">$notedata</span>)
									</div>
								
				<div class="method-definition">
											<span class="method-result"><a href="../noti/Category.html">Category</a></span>
										<a href="#getCategory" title="details" class="method-name">getCategory</a>
										()
									</div>
								
				<div class="method-definition">
											<span class="method-result">string</span>
										<a href="#getDetails" title="details" class="method-name">getDetails</a>
										()
									</div>
								
				<div class="method-definition">
											<span class="method-result">int</span>
										<a href="#getId" title="details" class="method-name">getId</a>
										()
									</div>
								
				<div class="method-definition">
											<span class="method-result"><a href="../noti/Site.html">Site</a></span>
										<a href="#getSite" title="details" class="method-name">getSite</a>
										()
									</div>
								
				<div class="method-definition">
											<span class="method-result">time</span>
										<a href="#getTime" title="details" class="method-name">getTime</a>
										()
									</div>
								
				<div class="method-definition">
											<span class="method-result">string</span>
										<a href="#getTitle" title="details" class="method-name">getTitle</a>
										()
									</div>
								
				<div class="method-definition">
											<span class="method-result">string</span>
										<a href="#getUrl" title="details" class="method-name">getUrl</a>
										()
									</div>
								
				<div class="method-definition">
											<span class="method-result">int</span>
										<a href="#getViewCount" title="details" class="method-name">getViewCount</a>
										()
									</div>
								
				<div class="method-definition">
											<span class="method-result">void</span>
										<a href="#incViewCount" title="details" class="method-name">incViewCount</a>
										()
									</div>
								
				<div class="method-definition">
											<span class="method-result">void</span>
										<a href="#resetViewCount" title="details" class="method-name">resetViewCount</a>
										()
									</div>
								
				<div class="method-definition">
											<span class="method-result">array</span>
										<a href="#search" title="details" class="method-name">search</a>
											(<span class="var-type">array</span>&nbsp;<span class="var-name">$filter</span>)
									</div>
								
				<div class="method-definition">
											<span class="method-result">mixed</span>
										<a href="#spawn" title="details" class="method-name">spawn</a>
											(<span class="var-type">array</span>&nbsp;<span class="var-name">$notedata</span>)
									</div>
							</div>
		</div>
	</div>		

	<a name="sec-vars"></a>
	<div class="info-box">
		<div class="info-box-title">Variables</div>
		<div class="nav-bar">
			<a href="#sec-description">Description</a> |
										<a href="#sec-var-summary">Vars</a> (<span class="disabled">details</span>)
						
			
										| 
									<a href="#sec-method-summary">Methods</a> (<a href="#sec-methods">details</a>)
							
					</div>
		<div class="info-box-body">
			<a name="var$_category" id="$_category"><!-- --></A>
<div class="evenrow">

	<div class="var-header">
		<span class="var-title">
			<span class="var-type">mixed</span>
			<span class="var-name">$_category</span>
						(line <span class="line-number">29</span>)
		</span>
	</div>

	<!-- ========== Info from phpDoc block ========= -->
	
	
		
		

</div>
<a name="var$_details" id="$_details"><!-- --></A>
<div class="oddrow">

	<div class="var-header">
		<span class="var-title">
			<span class="var-type">mixed</span>
			<span class="var-name">$_details</span>
						(line <span class="line-number">32</span>)
		</span>
	</div>

	<!-- ========== Info from phpDoc block ========= -->
	
	
		
		

</div>
<a name="var$_id" id="$_id"><!-- --></A>
<div class="evenrow">

	<div class="var-header">
		<span class="var-title">
			<span class="var-type">mixed</span>
			<span class="var-name">$_id</span>
						(line <span class="line-number">27</span>)
		</span>
	</div>

	<!-- ========== Info from phpDoc block ========= -->
	
	
		
		

</div>
<a name="var$_time" id="$_time"><!-- --></A>
<div class="oddrow">

	<div class="var-header">
		<span class="var-title">
			<span class="var-type">mixed</span>
			<span class="var-name">$_time</span>
						(line <span class="line-number">28</span>)
		</span>
	</div>

	<!-- ========== Info from phpDoc block ========= -->
	
	
		
		

</div>
<a name="var$_title" id="$_title"><!-- --></A>
<div class="evenrow">

	<div class="var-header">
		<span class="var-title">
			<span class="var-type">mixed</span>
			<span class="var-name">$_title</span>
						(line <span class="line-number">30</span>)
		</span>
	</div>

	<!-- ========== Info from phpDoc block ========= -->
	
	
		
		

</div>
<a name="var$_url" id="$_url"><!-- --></A>
<div class="oddrow">

	<div class="var-header">
		<span class="var-title">
			<span class="var-type">mixed</span>
			<span class="var-name">$_url</span>
						(line <span class="line-number">31</span>)
		</span>
	</div>

	<!-- ========== Info from phpDoc block ========= -->
	
	
		
		

</div>
<a name="var$_viewcount" id="$_viewcount"><!-- --></A>
<div class="evenrow">

	<div class="var-header">
		<span class="var-title">
			<span class="var-type">mixed</span>
			<span class="var-name">$_viewcount</span>
						(line <span class="line-number">33</span>)
		</span>
	</div>

	<!-- ========== Info from phpDoc block ========= -->
	
	
		
		

</div>

						
		</div>
	</div>
	
	<a name="sec-methods"></a>
	<div class="info-box">
		<div class="info-box-title">Methods</div>
		<div class="nav-bar">
			<a href="#sec-description">Description</a> |
															<a href="#sec-var-summary">Vars</a> (<a href="#sec-vars">details</a>)
																	<a href="#sec-method-summary">Methods</a> (<span class="disabled">details</span>)
						
		</div>
		<div class="info-box-body">
			<A NAME='method_detail'></A>
<a name="methodNote" id="Note"><!-- --></a>
<div class="oddrow">
	
	<div class="method-header">
		<span class="method-title">Constructor Note</span> (line <span class="line-number">43</span>)
	</div> 
	
	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Constructor: creates a Note object given its ID.</p>
	<ul class="tags">
				<li><span class="field">static:</span> </li>
				<li><span class="field">access:</span> public</li>
			</ul>
	
	<div class="method-signature">
		<span class="method-result">Note</span>
		<span class="method-name">
			Note
		</span>
					(<span class="var-type">int</span>&nbsp;<span class="var-name">$nid</span>)
			</div>
	
			<ul class="parameters">
					<li>
				<span class="var-type">int</span>
				<span class="var-name">$nid</span><span class="var-description">: The note ID</span>			</li>
				</ul>
		
		
	</div>
<a name="methodexists" id="exists"><!-- --></a>
<div class="evenrow">
	
	<div class="method-header">
		<span class="method-title">exists</span> (line <span class="line-number">175</span>)
	</div> 
	
	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Checks if the note exists given its ID</p>
	<ul class="tags">
				<li><span class="field">static:</span> </li>
				<li><span class="field">access:</span> public</li>
			</ul>
	
	<div class="method-signature">
		<span class="method-result">boolean</span>
		<span class="method-name">
			exists
		</span>
					(<span class="var-type">string</span>&nbsp;<span class="var-name">$nid</span>)
			</div>
	
			<ul class="parameters">
					<li>
				<span class="var-type">string</span>
				<span class="var-name">$nid</span><span class="var-description">: The note ID</span>			</li>
				</ul>
		
		
	</div>
<a name="methodget" id="get"><!-- --></a>
<div class="oddrow">
	
	<div class="method-header">
		<span class="method-title">get</span> (line <span class="line-number">138</span>)
	</div> 
	
	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Return a note given its notedata (used to check for dupes)</p>
	<ul class="tags">
				<li><span class="field">return:</span> A Note (if exists). False otherwise.</li>
				<li><span class="field">static:</span> </li>
				<li><span class="field">access:</span> public</li>
			</ul>
	
	<div class="method-signature">
		<span class="method-result">mixed</span>
		<span class="method-name">
			get
		</span>
					(<span class="var-type">array</span>&nbsp;<span class="var-name">$notedata</span>)
			</div>
	
			<ul class="parameters">
					<li>
				<span class="var-type">array</span>
				<span class="var-name">$notedata</span><span class="var-description">: The note data. See spawn() method for info</span>			</li>
				</ul>
		
		
	</div>
<a name="methodgetCategory" id="getCategory"><!-- --></a>
<div class="evenrow">
	
	<div class="method-header">
		<span class="method-title">getCategory</span> (line <span class="line-number">262</span>)
	</div> 
	
	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Get the note category</p>
	<ul class="tags">
				<li><span class="field">access:</span> public</li>
			</ul>
	
	<div class="method-signature">
		<span class="method-result"><a href="../noti/Category.html">Category</a></span>
		<span class="method-name">
			getCategory
		</span>
				()
			</div>
	
		
		
	</div>
<a name="methodgetDetails" id="getDetails"><!-- --></a>
<div class="oddrow">
	
	<div class="method-header">
		<span class="method-title">getDetails</span> (line <span class="line-number">298</span>)
	</div> 
	
	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Get the note details</p>
	<ul class="tags">
				<li><span class="field">access:</span> public</li>
			</ul>
	
	<div class="method-signature">
		<span class="method-result">string</span>
		<span class="method-name">
			getDetails
		</span>
				()
			</div>
	
		
		
	</div>
<a name="methodgetId" id="getId"><!-- --></a>
<div class="evenrow">
	
	<div class="method-header">
		<span class="method-title">getId</span> (line <span class="line-number">226</span>)
	</div> 
	
	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Get the note ID</p>
	<ul class="tags">
				<li><span class="field">access:</span> public</li>
			</ul>
	
	<div class="method-signature">
		<span class="method-result">int</span>
		<span class="method-name">
			getId
		</span>
				()
			</div>
	
		
		
	</div>
<a name="methodgetSite" id="getSite"><!-- --></a>
<div class="oddrow">
	
	<div class="method-header">
		<span class="method-title">getSite</span> (line <span class="line-number">249</span>)
	</div> 
	
	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Get the note site</p>
	<ul class="tags">
				<li><span class="field">access:</span> public</li>
			</ul>
	
	<div class="method-signature">
		<span class="method-result"><a href="../noti/Site.html">Site</a></span>
		<span class="method-name">
			getSite
		</span>
				()
			</div>
	
		
		
	</div>
<a name="methodgetTime" id="getTime"><!-- --></a>
<div class="evenrow">
	
	<div class="method-header">
		<span class="method-title">getTime</span> (line <span class="line-number">237</span>)
	</div> 
	
	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Get the note time</p>
	<ul class="tags">
				<li><span class="field">access:</span> public</li>
			</ul>
	
	<div class="method-signature">
		<span class="method-result">time</span>
		<span class="method-name">
			getTime
		</span>
				()
			</div>
	
		
		
	</div>
<a name="methodgetTitle" id="getTitle"><!-- --></a>
<div class="oddrow">
	
	<div class="method-header">
		<span class="method-title">getTitle</span> (line <span class="line-number">274</span>)
	</div> 
	
	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Get the note title</p>
	<ul class="tags">
				<li><span class="field">access:</span> public</li>
			</ul>
	
	<div class="method-signature">
		<span class="method-result">string</span>
		<span class="method-name">
			getTitle
		</span>
				()
			</div>
	
		
		
	</div>
<a name="methodgetUrl" id="getUrl"><!-- --></a>
<div class="evenrow">
	
	<div class="method-header">
		<span class="method-title">getUrl</span> (line <span class="line-number">286</span>)
	</div> 
	
	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Get the note URL</p>
	<ul class="tags">
				<li><span class="field">access:</span> public</li>
			</ul>
	
	<div class="method-signature">
		<span class="method-result">string</span>
		<span class="method-name">
			getUrl
		</span>
				()
			</div>
	
		
		
	</div>
<a name="methodgetViewCount" id="getViewCount"><!-- --></a>
<div class="oddrow">
	
	<div class="method-header">
		<span class="method-title">getViewCount</span> (line <span class="line-number">214</span>)
	</div> 
	
	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Get the note view counter</p>
	<ul class="tags">
				<li><span class="field">access:</span> public</li>
			</ul>
	
	<div class="method-signature">
		<span class="method-result">int</span>
		<span class="method-name">
			getViewCount
		</span>
				()
			</div>
	
		
		
	</div>
<a name="methodincViewCount" id="incViewCount"><!-- --></a>
<div class="evenrow">
	
	<div class="method-header">
		<span class="method-title">incViewCount</span> (line <span class="line-number">200</span>)
	</div> 
	
	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Increment the note view counter</p>
	<ul class="tags">
				<li><span class="field">access:</span> public</li>
			</ul>
	
	<div class="method-signature">
		<span class="method-result">void</span>
		<span class="method-name">
			incViewCount
		</span>
				()
			</div>
	
		
		
	</div>
<a name="methodresetViewCount" id="resetViewCount"><!-- --></a>
<div class="oddrow">
	
	<div class="method-header">
		<span class="method-title">resetViewCount</span> (line <span class="line-number">187</span>)
	</div> 
	
	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Reset the note view counter</p>
	<ul class="tags">
				<li><span class="field">access:</span> public</li>
			</ul>
	
	<div class="method-signature">
		<span class="method-result">void</span>
		<span class="method-name">
			resetViewCount
		</span>
				()
			</div>
	
		
		
	</div>
<a name="methodsearch" id="search"><!-- --></a>
<div class="evenrow">
	
	<div class="method-header">
		<span class="method-title">search</span> (line <span class="line-number">341</span>)
	</div> 
	
	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Search for all notes that match the given criteria  If $dateto is ommited, it will only return notes from $datefrom  If both $datefrom and $dateto are ommited, it will return today notes</p>
	<ul class="tags">
				<li><span class="field">return:</span> The array of matching Notes</li>
				<li><span class="field">static:</span> </li>
				<li><span class="field">access:</span> public</li>
			</ul>
	
	<div class="method-signature">
		<span class="method-result">array</span>
		<span class="method-name">
			search
		</span>
					(<span class="var-type">array</span>&nbsp;<span class="var-name">$filter</span>)
			</div>
	
			<ul class="parameters">
					<li>
				<span class="var-type">array</span>
				<span class="var-name">$filter</span><span class="var-description">: <p>The search criteria as an array of                        key=&gt;values. Supported keys are:</p><p>datefrom  - notes posted after this date                                    (default: now - 24hs)                        dateto    - notes posted before this date                                    (default: now)                        all       - set this flag to return all notes                                    between datefrom and dateto ignoring                                    area/site/category.                        area      - notes belonging to this area                        site      - notes belonging to this site                        category  - notes belonging to this category                        keywords  - notes which contains these                                    keywords (space separated)                        kwmatch   - keyword match type. Possible values                                    are: AND, OR                        limit     - maximum number of notes to return                                    (default: 0, which means no limit)                        sort      - sort criteria. Supported fields                                    are: nviewcount, ntime. Multiple                                    values separated by commas are                                    allowed.</p><p>area, site and category may be an array which                       means: match any of these</p></span>			</li>
				</ul>
		
		
	</div>
<a name="methodspawn" id="spawn"><!-- --></a>
<div class="oddrow">
	
	<div class="method-header">
		<span class="method-title">spawn</span> (line <span class="line-number">69</span>)
	</div> 
	
	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Create new note into database. To be called like this:</p>
<p class="description"><p>If the note is created succesfully, it's returned.  If the note it's a dupe, the original one is returned.  If the note can't be created, FALSE is returned.</p></p>
	<ul class="tags">
				<li><span class="field">return:</span> Note</li>
				<li><span class="field">static:</span> </li>
				<li><span class="field">access:</span> public</li>
			</ul>
	
	<div class="method-signature">
		<span class="method-result">mixed</span>
		<span class="method-name">
			spawn
		</span>
					(<span class="var-type">array</span>&nbsp;<span class="var-name">$notedata</span>)
			</div>
	
			<ul class="parameters">
					<li>
				<span class="var-type">array</span>
				<span class="var-name">$notedata</span><span class="var-description">: Array containing the note data. Fields must be: <ul><li>time      The note time</li><li>site      The note site name</li><li>siteurl   The note site URL</li><li>category  The note category name</li><li>title     The note title</li><li>url       The note URL</li><li>details   The note details</li></ul></span>			</li>
				</ul>
		
		
	</div>
						
		</div>
	</div>


	<p class="notes" id="credit">
		Documentation generated on Sat, 18 Mar 2006 04:40:15 -0300 by <a href="http://www.phpdoc.org" target="_blank">phpDocumentor 1.3.0RC3</a>
	</p>
	</div></body>
</html>
Return current item: Noti