I'm having some trouble trying to write a plugin. I'm trying to create a simple fieldtype that I'm going to use inside a matrix block.
So far the public function getInputHtml
of my fieldtype class, contains only:
var_dump($this->element)
And it shows me, as expected:
object(Craft\MatrixBlockModel)#1121 (25){["elementType":protected]=> string(11) "MatrixBlock" [.......]
The problem is that, as I try to change the previous
var_dump($this->element)
with a
var_dump($this->element->getOwner())
(or any other method/property of the MatrixBlockModel class), I obtain:
"Call to a member function getOwner() on a non-object"
Any suggestion? Could it have something to do with the magic methods (maybe __call) inherited by CComponent class?