public function toJSON ($attributes = FALSE, $addClass = FALSE)
	{
		
		// Get array
		
		$arr	= $this->toArray ($attributes);
		
		// Add the class name if required
		
		if ($addClass)
		{
			$arr['class']	= str_replace ('\\', '_', str_replace ('sonic\\model\\', '', strtolower (get_called_class ())));
		}
		
		// Return json encoded
		
		return json_encode ($arr);
		
	}
public function toJSON ($attributes = FALSE, $addClass = FALSE)
	{
		
		// Get array
		
		$arr	= $this->toArray ($attributes);
		
		// Add the class name if required
		
		if ($addClass)
		{
			$arr['class']	= str_replace ('\\', '_', str_replace ('sonic\\model\\', '', strtolower (get_called_class ())));
		}
		
		// Return json encoded
		
		return json_encode ($arr);
		
	}
public function toJSON ( $ attributes = FALSE , $ addClass = FALSE ) { // Get array $ arr = $ this -> toArray ( $ attributes ) ; // Add the class name if required if ( $ addClass ) { $ arr [ 'class' ] = str_replace ( '\\' , '_' , str_replace ( 'sonic\\model\\' , '' , strtolower ( get_called_class ( ) ) ) ) ; } // Return json encoded return json_encode ( $ arr ) ; }
Return a JSON encoded string with object attributes
@param array|boolean $attributes Attributes to include, default to false i.e all attributes
@param boolean $addClass Whether to add the class name to each exported object
@return object|boolean
Return a JSON encoded string with object attributes