Code: Select all
define('FLAG_REQUIRED', 0x01); // binary 0001
define('FLAG_OPTIONAL', 0x02); // binary 0010
define('FLAG_ONCE', 0x04); // binary 0100Code: Select all
$this->valid_properties = array(
'SOMETHING' => FLAG_OPTIONAL | FLAG_ONCE, // binary 0110
'SOMETHING_ELSE' => FLAG_OPTIONAL | FLAG_ONCE, // binary 0110
'SOME_PROPERTY' => FLAG_REQUIRED | FLAG_ONCE, // binary 0101
'PROPALICIOUS' => FLAG_REQUIRED | FLAG_ONCE, // binary 0101
'I_AM_PROPERTASTIC' => FLAG_OPTIONAL // binary 0010
);EDIT- and also, how would you then enforce this using these? I see later on they do this...
Code: Select all
if(($propdata & FLAG_REQUIRED) && // some other condition) {
// snip
}