. */ /** * The LDAP type, representing the base of an object in LDAP. * * The getters for multi-value attributes will return an array. In case an index * is given, only that attribute of the array will be returned. * The setters for multi-value attributes can be called with both an array and * single value. A single value will only overwrite the first value, so to * replace all values with a single value, give an array with one element as * parameter. * * @version 1.0 * @date 03.08.2010 * @author Wim van Ravesteijn * @license http://opensource.org/licenses/gpl-license.php GNU Public License */ require_once(FILESYSTEMROOTPATH."include/classes/IModel.php"); abstract class AbstractLdap implements IModel { /** DN */ private $dn; /** Change log */ private $changeLog; /** * Constructor, should only be used to load the data from LDAP into the object * * @param array $data Array of values to be stored, in LDAP format (only single entry) */ public function __construct($data) { if( is_array($data) ) { $this->dn = $data['dn']; isset($data['changelog']) && $this->changeLog = $data['changelog']; unset($this->changeLog['count']); }else { $this->dn = NULL; $this->changeLog = array(); } } public function getDn() { return $this->dn; } public function getId() { return $this->getDn(); } public function getChangeLog() { return $this->changeLog; } public function getChangeLogString() { $r = ""; for( $i=0; $ichangeLog); $i++ ) { if( $i == 0 ) { $r .= $this->changeLog[$i]; }else { $r .= "\n" . $this->changeLog[$i]; } } return $r; } } ?>