protected function encodeObject($object)
	{
		foreach ($this->objectEncoders as $className => $callback)
		{
			if ($object instanceof $className)
			{
				return $callback($object);
			}
		}

		throw new RuntimeException('Cannot encode instance of ' . get_class($object));
	}
protected function encodeObject($object)
	{
		foreach ($this->objectEncoders as $className => $callback)
		{
			if ($object instanceof $className)
			{
				return $callback($object);
			}
		}

		throw new RuntimeException('Cannot encode instance of ' . get_class($object));
	}
protected function encodeObject ( $ object ) { foreach ( $ this -> objectEncoders as $ className => $ callback ) { if ( $ object instanceof $ className ) { return $ callback ( $ object ) ; } } throw new RuntimeException ( 'Cannot encode instance of ' . get_class ( $ object ) ) ; }
Encode an object into JavaScript

@param  object $object
@return string
Encode an object into JavaScript