vzlogger/backend/lib/Definition/EntityDefinition.php

95 lines
2.1 KiB
PHP
Raw Normal View History

<?php
/**
* @package default
* @copyright Copyright (c) 2010, The volkszaehler.org project
* @license http://www.gnu.org/licenses/gpl.txt GNU Public License
*/
/*
* This file is part of volkzaehler.org
*
* volkzaehler.org is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* any later version.
*
* volkzaehler.org is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with volkszaehler.org. If not, see <http://www.gnu.org/licenses/>.
*/
namespace Volkszaehler\Definition;
2010-09-19 20:40:37 +02:00
use Volkszaehler\Util;
/**
* @author Steffen Vogel <info@steffenvogel.de>
2010-09-04 02:00:12 +02:00
* @package default
*/
2010-09-05 22:16:08 +02:00
class EntityDefinition extends Definition {
2010-09-19 20:40:37 +02:00
/**
* File containing the JSON definitons
*
* @var string
*/
const FILE = '/lib/Definition/EntityDefinition.json';
2010-09-19 20:40:37 +02:00
/**
* List of required properties
*
* @var array
*/
protected $required = array();
2010-09-19 20:40:37 +02:00
/**
* List of optional properties
*
* @var array
*/
protected $optional = array();
2010-09-19 20:40:37 +02:00
/**
* Classname of intepreter (see backend/lib/Interpreter/)
*
* @var string
*/
protected $interpreter;
/**
* Classname of model (see backend/lib/Model/)
*
* @var string
*/
protected $model;
2010-09-19 20:40:37 +02:00
/**
* Optional for Aggregator class entities
*
* @var string
*/
protected $unit;
/**
2010-09-22 02:32:03 +02:00
* Relative url to an icon
* @var string
*/
protected $icon;
/**
* @var array holds definitions
*/
protected static $definitions = NULL;
2010-09-19 20:40:37 +02:00
/*
* Setter & Getter
*/
public function getInterpreter() { return $this->interpreter; }
public function getUnit() { return $this->unit; }
2010-09-19 20:40:37 +02:00
public function getRequiredProperties() { return $this->required; }
public function getValidProperties() { return array_merge($this->required, $this->optional); }
}
?>