<?php
namespace App\EntityMatch;

/**
 * The class is used for matching trusts / holdings
 * @author LauraMotoc
 *
 */
class Trust extends \App\EntityMatch\BaseAbstract
{

	/**
	 * The export fields for corporations.
	 * @var array
	 */
	protected $exportFields = ['name'];

	/**
	 * Extra filters - deleted trusts are not allowed.
	 * @var String
	 */
 	protected $matchingFilteringSQL = 'AND ent.deleted=0';

	/**
	 * The class name which will instantiate the Entity - used for primaryKey search.
	 * @var String
	 */
	protected $entityClassName = '\Entity\Trust';

	/**
	 * (non-PHPdoc)
	 * @see \App\EntityMatch\BaseAbstract::setTableName()
	 */
	protected function setTableName()
	{
		global $DBTTrusts;
		$this->tableName = $DBTTrusts;
	}

	/**
	 * Sets a search by trust name.
	 * @param String $value - the trust name.
	 * @param Boolean $useWildcard - uses wildcard for this search or not.
	 */
	public function setName($value, $useWildcard = true)
	{
		$this->setSearchCriterion('name', $value, $useWildcard);
	}
}