<?php
defined('HOSTCMS') || exit('HostCMS: access denied.');

/**
 * Antispam_Domain_Model
 *
 * @package HostCMS
 * @subpackage Antispam
 * @version 6.x
 * @copyright © 2005-2024, https://www.hostcms.ru
 */
class Antispam_Domain_Model extends Core_Entity
{
	/**
	 * Model name
	 * @var mixed
	 */
	protected $_modelName = 'antispam_domain';

	/**
	 * Column consist item's name
	 * @var string
	 */
	protected $_nameColumn = 'domain';

	/**
	 * Belongs to relations
	 * @var array
	 */
	protected $_belongsTo = array(
		'user' => array()
	);

	/**
	 * Constructor.
	 * @param int $id entity ID
	 */
	public function __construct($id = NULL)
	{
		parent::__construct($id);

		if (is_null($id) && !$this->loaded())
		{
			$oUser = Core_Auth::getCurrentUser();
			$this->_preloadValues['user_id'] = is_null($oUser) ? 0 : $oUser->id;
		}
	}
}