The trait Idable provides a method equalsId that in turn relies on the
method getId(). If this method does not exist on a class mixing in this
trait, the method will fail.
Adding the getId() as an abstract method to the trait will make sure it
is available.
Loading history...
39
)->render();
40
}
41
42
/**
43
* Returns name of view template.
44
*
45
* @return string
46
*/
47
public function getTemplate()
48
{
49
return $this->template;
50
}
51
52
/**
53
* Allows to specify view template.
54
*
55
* @param string $template
56
* @return $this
57
*/
58
public function setTemplate($template)
59
{
60
$this->template = $template;
61
return $this;
62
}
63
64
/**
65
* Returns true if object already was rendered.
66
*
67
* @return bool
68
*/
69
public function isRendered()
70
{
71
return $this->is_rendered;
72
}
73
74
/**
75
* Renders object when it is treated like a string.
This check looks for methods that are used by a trait but not required by it.
To illustrate, let’s look at the following code example
The trait
Idableprovides a methodequalsIdthat in turn relies on the methodgetId(). If this method does not exist on a class mixing in this trait, the method will fail.Adding the
getId()as an abstract method to the trait will make sure it is available.