stream opening
This commit is contained in:
parent
70b186f8dd
commit
7a18467734
|
@ -99,12 +99,17 @@ class Storage
|
||||||
return $storage->retrieve("$prefix{$entity->{"get".$camel}()}", $local_path);
|
return $storage->retrieve("$prefix{$entity->{"get".$camel}()}", $local_path);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function stream($entity, $attribute, $target_stream)
|
public function stream($entity, $attribute, $target_stream = null)
|
||||||
{
|
{
|
||||||
$annotation = $this->getStorageAnnotation($entity, $attribute);
|
$annotation = $this->getStorageAnnotation($entity, $attribute);
|
||||||
$storage = $this->get($annotation->name);
|
$storage = $this->get($annotation->name);
|
||||||
$prefix = is_null($annotation->prefix) || empty($annotation->prefix) ? '' : trim($annotation->prefix, '/').'/';
|
$prefix = is_null($annotation->prefix) || empty($annotation->prefix) ? '' : trim($annotation->prefix, '/').'/';
|
||||||
$camel = ucfirst(Container::camelize($attribute));
|
$camel = ucfirst(Container::camelize($attribute));
|
||||||
|
|
||||||
|
if (is_null($target_stream)) {
|
||||||
|
return $storage->getStream("$prefix{$entity->{"get".$camel}()}");
|
||||||
|
}
|
||||||
|
|
||||||
return $storage->stream("$prefix{$entity->{"get".$camel}()}", $target_stream);
|
return $storage->stream("$prefix{$entity->{"get".$camel}()}", $target_stream);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue