Location: PHPKode > projects > Anahita Social Engine > dependencies/plg_system_socialengine/socialengine/model/story/data/image.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 AnModelStoryDataImage extends KObject implements AnModelStoryDataInterface
{
	/**
	 * Text 
	 */
	public $src;
	
	/**
	 * Link href
	 */
	public $href;
	
	/**
	 * alt
	 */
	public $alt;
	
	/**
	 * Constructor Accept two parameters $text and $href
	 * @return 
	 * @param $options Object[optional]
	 */	
	public function __construct(array $options = array())
	{
		$options = $this->_initialize($options);
		
		$this->src  = $options['src'];
		
		$this->href = $options['href'];
		
		$this->alt	= $options['alt'];
		
	}
	
	/**
	 * Initialize object
	 * @return Array
	 * @param $options Array
	 */
	protected function _initialize(array $options = array())
	{
		$default = array(
			'href' => null ,
			'alt'  => null ,
		);
		
		return array_merge($default, $options);
	}
	
	/**
	 * 
	 * @return 
	 */
	public function __toString()
	{
		$img = '<img src="'.$this->src.'" alt="'.$this->alt.'" />';
		return $this->href ? '<div class="an-se-story-medium"><a href="'.$this->href.'">'.$img.'</a></div>' : $img;
	}
}
Return current item: Anahita Social Engine