Compatibility Object is reserved for future use. * * @package php-reader * @subpackage ASF * @author Sven Vollbehr * @copyright Copyright (c) 2008-2009 The PHP Reader Project Workgroup * @license http://code.google.com/p/php-reader/wiki/License New BSD License * @version $Rev$ */ final class ASF_Object_Compatibility extends ASF_Object { /** @var integer */ private $_profile; /** @var integer */ private $_mode; /** * Constructs the class with given parameters and reads object related data * from the ASF file. * * @param Reader $reader The reader object. * @param Array $options The options array. */ public function __construct($reader = null, &$options = array()) { parent::__construct($reader, $options); if ($reader === null) return; $this->_profile = $this->_reader->readUInt8(); $this->_mode = $this->_reader->readUInt8(); } /** * Returns the profile field. This field is reserved and is set to 2. * * @return integer */ public function getProfile() { return $this->_profile; } /** * Returns the profile field. This field is reserved and is set to 2. * * @param integer $profile The profile. */ public function setProfile($profile) { $this->_profile = $profile; } /** * Returns the mode field. This field is reserved and is set to 1. * * @return integer */ public function getMode() { return $this->_mode; } /** * Sets the mode field. This field is reserved and is set to 1. * * @param integer $mode The mode. */ public function setMode($mode) { $this->_mode = $mode; } /** * Returns the whether the object is required to be present, or whether * minimum cardinality is 1. * * @return boolean */ public function isMandatory() { return false; } /** * Returns whether multiple instances of this object can be present, or * whether maximum cardinality is greater than 1. * * @return boolean */ public function isMultiple() { return false; } /** * Returns the object data with headers. * * @return string */ public function __toString() { $data = Transform::toUInt8($this->_profile) . Transform::toUInt8($this->_mode); $this->setSize(24 /* for header */ + strlen($data)); return Transform::toGUID($this->getIdentifier()) . Transform::toInt64LE($this->getSize()) . $data; } }