Implements TypedDataInterface::setValue().
Overrides TypedData::setValue
public function setValue($value) {
if (!isset($value)) {
$this->handle = NULL;
$this->uri = NULL;
}
elseif (is_resource($value)) {
$this->handle = $value;
}
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;
}
else {
throw new InvalidArgumentException("Invalid value for binary data given.");
}
}