freenet-router | 
    Subversion Repositories:  | 
  
   [/] [trunk/] [freenet-router/] [var/] [www/] [freenet-router/] [Application/] [Models/] [System/] [ConfigEntry.php] - Rev 2
   Compare with Previous -
     Blame
       - Download
   
   
<?php
namespace FreenetRouter\Models\System;
use FreenetRouter\Libraries\ConfigEntryManagers\IConfigEntryManager;
use Phem\Core\Object;
/**
 * @author Jakub PetrĹžĂlka <kubapet@lbcfree.net>
 */
class ConfigEntry extends Object
{  
    private $name;
    private $label;
    private $value;
    private $configEntryManager;
    
    function __construct($name, $label, IConfigEntryManager $cem)
    {
        $this->name = $name;
        $this->label = $label;
        $this->configEntryManager = $cem;
    }
    
    public function getName()
    {
        return $this->name;
    }
    public function getLabel()
    {
        return $this->label;
    }
    public function getValue()
    {
        if ($this->value === null)
        {
            $this->value = $this->configEntryManager->getValue();
        }
        return $this->value;
    }
    public function setName($name)
    {
        $this->name = $name;
    }
    public function setLabel($label)
    {
        $this->label = $label;
    }
    public function setValue($value)
    {
        $this->configEntryManager->setValue($value);
        $this->value = $this->configEntryManager->getValue();
    }
}
   
      Powered by WebSVN 2.2.1