I just want to create function just like getFieldname() that is in magento.
For Ex:
In Magento
getId() - returns value of ID field
getName() - returns value of Name field
How can I create like that function? Kindly help me in this case..
I want to do just Like Below code,
Class Called{
$list=array();
function __construct() {
$this->list["name"]="vivek";
$this->list["id"]="1";
}
function get(){
echo $this->list[$fieldname];
}
}
$instance=new Called();
$instance->getId();
$instance->getName();