Location: PHPKode > projects > Anahita Social Engine > dependencies/plg_system_socialengine/socialengine/model/application/helper.php
<?php
/**
 * @version		1.0.0
 * @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 AnModelApplicationHelper extends KMixinAbstract
{	
	/**
	 * Get application object using an identifier
	 * @return 
	 * @param $identifier Object
	 */
	static function getApplicationByIdentifier($identifier)
	{
		$component = 'com_'.$identifier->package;
		return KFactory::get('lib.anahita.domain.factory.repository')->get('lib.anahita.model.application')->getApplicationByComponent($component);
	}
	
	/**
	 * Mixes with an identifiable object. It uses the object package to return an application
	 * $controller->mixin( KFactory::tmp('lib.anahita.model.application.helper', array('mixer'=>$controller)) )
	 * $controller->getApplication();
	 * @return AnModelApplication
	 */
	public function getApplication()
	{
		return self::getApplicationByIdentifier( $this->_mixer->getIdentifier() );
	}
	
}
Return current item: Anahita Social Engine