<?php

/**
 * Description of Letter
 *
 * @author Arkadiusz Rychlik <a.rychlik at eppe.com.pl>
 */
class Main_Newsletter_CRUD_Letter extends Rtn_CRUD {

	protected $beanName = 'nlletter';

	protected function _beforeStore($context, &$bean) {
		$time = time();
		if ($context == Rtn_CRUD::CONTEXT_CREATE) {
			$bean->created = $time;
			$bean->status = Newsletter_Model_Nlletter::STATUS_NEW;
		}
		elseif ($context == Rtn_CRUD::CONTEXT_UPDATE) {
			$bean->updated = $time;
		}
	}

}
