<?php
/* Please see the README and LICENSE files. */
/**
* This class represents a specific, arbitrary, attribute of information
*/
class Data_Attribute {
/**
* The name of the attribute
* @var String
*/
protected $name;
/**
* The attribute's value
* @var String
*/
protected $value;
/**
* @param String $name
* @param String $value
*/
public function __construct($name,$value=NULL) {
$this->name = $name;
$this->value = $value;
}
/**
* Magic Method to get things
* @param String $n The name of the attribute to get
* @return Mixed
*/
public function __get($n) {
switch($n){
case "name":
case "value":
return $this->$n;
}
return false;
}
/**
* Magic method to set things (the value)
* @param String $n The name of the thing to change
* @param String $v The value to set to
* @return boolean True if changed
*/
public function __set($n, $v) {
if($n =="value"){
$this->$name = $v;
return true;
}
return false;
}
/**
* Check if the attribute has changed in storage
* @return Boolean
*/
public function has_changed(){
return false;
}
}
?>