* @package Mammut\DB\Sql */ trait WithTarget { protected $target; /** * Set the target of the expression * * @param string|array $identifier * @return In */ public function setTarget($target) { if (is_string($target) || is_array($target)) $target = new Literal($target, iExprValue::TYPE_IDENTIFIER); if (!($target instanceof iExprValue)) throw new \InvalidArgumentException('string or iExprValue required'); $this->target = $target; return $this; } /** * Get the target of the expression * * @return Literal */ public function getTarget() { return $this->target; } }