summaryrefslogtreecommitdiff
path: root/framework/Exceptions/TTemplateException.php
blob: 25b5caa5ccd800ed80ff3451b3fc1f850a8fa86b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
<?php
/**
 * Exception classes file
 *
 * @author Qiang Xue <qiang.xue@gmail.com>
 * @link http://www.pradosoft.com/
 * @copyright Copyright &copy; 2005-2014 PradoSoft
 * @license http://www.pradosoft.com/license/
 * @package Prado\Exceptions
 */

namespace Prado\Exceptions;
use Prado\TPropertyValue;

/**
 * TTemplateException class
 *
 * TTemplateException represents an exception caused by invalid template syntax.
 *
 * @author Qiang Xue <qiang.xue@gmail.com>
 * @package Prado\Exceptions
 * @since 3.1
 */
class TTemplateException extends TConfigurationException
{
	private $_template='';
	private $_lineNumber=0;
	private $_fileName='';

	/**
	 * @return string the template source code that causes the exception. This is empty if {@link getTemplateFile TemplateFile} is not empty.
	 */
	public function getTemplateSource()
	{
		return $this->_template;
	}

	/**
	 * @param string the template source code that causes the exception
	 */
	public function setTemplateSource($value)
	{
		$this->_template=$value;
	}

	/**
	 * @return string the template file that causes the exception. This could be empty if the template is an embedded template. In this case, use {@link getTemplateSource TemplateSource} to obtain the actual template content.
	 */
	public function getTemplateFile()
	{
		return $this->_fileName;
	}

	/**
	 * @param string the template file that causes the exception
	 */
	public function setTemplateFile($value)
	{
		$this->_fileName=$value;
	}

	/**
	 * @return integer the line number at which the template has error
	 */
	public function getLineNumber()
	{
		return $this->_lineNumber;
	}

	/**
	 * @param integer the line number at which the template has error
	 */
	public function setLineNumber($value)
	{
		$this->_lineNumber=TPropertyValue::ensureInteger($value);
	}
}