<?php

/**
 * Subclass for representing a row from the 'node_news' table.
 *
 *
 *
 * @package lib.model
 */
class NodeNews extends BaseNodeNews implements ICatalyzLayoutProvider, ICatalyzHiddenNode {
	/**
	 * NodeHome::getAvailableLayouts()
	 *
	 * @return
	 */
	public function getAvailableLayouts()
	{
		return array('katao/default');
	}

	public function updateFromRequest($node, $request, $previewMode)
	{
		$culture = $request->getParameter('culture');
		$this->setContent($request->getParameter('content'), $culture);
		$this->setIntroduction($request->getParameter('introduction'), $culture);
		$this->setPicture($request->getParameter('picture'), $culture);
		try {
			$this->setPublishedAt(CatalyzDate::frenchDateFormatToTimestamp($request->getParameter('published_at')));
		}
		catch(exception $e) {
			$this->errors['published_at'] = 'Merci de fournir une date valide.';
		}
	}
	public function getValidSubClasses()
	{
		$result = array();
		return $result;
	}
	static function getNodeClassCaption()
	{
		return 'Actualité';
	}
	public static function getNodeClassDescription()
	{
		return '';
	}
	static public function getLayoutAreas()
	{
		return array();
	}
}