<?php
class GenericListItem {

    public $title;
    public $key;
    public $value;
    public $imagePath;
//     public $option;

    public function __construct($obj,$titleAttribute,$valueKeyName,$valueAttribute,$imagePath='') {
    
        $this->setTitle($obj,$titleAttribute);
        $this->setValueKeyName($valueKeyName);
        $this->setValue($obj,$valueAttribute);
        $this->setImagePath($imagePath);
    }
// Geter adn Seter methods :
    protected function setTitle($obj,$titleAttribute) {
 
        $this->title = $obj->$titleAttribute;
    }

    protected function setValueKeyName($valueKeyName) {

        $this->key= $valueKeyName;
    }

    protected function setValue($obj,$valueAttribute) {

        $this->value = $obj->$valueAttribute;
    }

    protected function setImagePath($imagePath) {

        $this->imagePath = $imagePath;
    }
}?>