Location: PHPKode > projects > Anahita Social Engine > site/helpers/application.php
<?php
/**
 * @category	Anahita Social Engine™
 * @copyright	Copyright (C) 2008 - 2010 rmdStudio Inc. and Peerglobe Technology Inc. All rights reserved.
 * @license		GNU GPLv2 <http://www.gnu.org/licenses/old-licenses/gpl-2.0.html>
 * @link     	http://www.anahitapolis.com
 */

class ComSocialengineHelperApplication
{
		
	static protected $_owners;
	
	/**
	 * Method to obtain an application's owner
	 * @param string 
	 * @return actor node object
	 */
	static function getOwner($param='oid', $returnViewer = true)
	{
		static $_owners = array();
		
		$oid  = KRequest::get("request.{$param}",'int', 0);
		
		if ( !$oid ) return $returnViewer ? AnModelAnahita::getSessionViewer() : null;
		
		if ( !isset($_owners[$oid]) ) {
			
			$query = KFactory::get('lib.anahita.domain.factory')->getQuery('lib.anahita.model.person');
			$query->where('id','=',$oid);
			$actor = $query->fetch();
			$_owners[$oid] = $actor;
		}
		
		return !is_null($_owners[$oid]) ? $_owners[$oid] : ($returnViewer ? AnModelAnahita::getSessionViewer() : null);
	}


//end class
}
Return current item: Anahita Social Engine