It worked fine on my test site.
You did not copy the getInputName method in your example. I would start looking there. Maybe you will return the desired variable?
My test code is:
<?php
abstract class WMSInput {
private $inputName;
public function setInputName( $inputName ) {
$this->inputName = $inputName;
}
public function getInputName() {
return $this->inputName;
}
}
class Test extends WMSInput {
}
$field = new Test();
$field->setInputName('email');
$fieldClone = clone $field;
echo $fieldClone->getInputName();
$fieldClone->setInputName( 'name' );
echo $fieldClone->getInputName();
Conclusion:
emailname
what is right.
source
share