Overrides TypedData::setValue().
Supports a PHP file resource or a (absolute) stream resource URI as value.
Overrides TypedData::setValue
public function setValue($value, $notify = TRUE) {
// Notify the parent of any changes to be made.
if ($notify && isset($this->parent)) {
$this->parent
->onChange($this->name);
}
if (!isset($value)) {
$this->handle = NULL;
$this->uri = NULL;
}
elseif (is_string($value)) {
// Note: For performance reasons we store the given URI and access the
// resource upon request. See Binary::getValue()
$this->uri = $value;
$this->handle = NULL;
}
else {
$this->handle = $value;
}
}