for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace Sirius\Input\Traits;
use Sirius\Input\Specs;
trait HasUploadTrait
{
/**
* Returns the upload container for the element
*
* @return null|mixed
*/
public function getUploadContainer()
return isset($this[Specs::UPLOAD_CONTAINER]) ? $this[Specs::UPLOAD_CONTAINER] : null;
}
* Sets the upload container for the elment
* @param string|\Sirius\Upload\Container\ContainerInterface $container
* @return $this
public function setUploadContainer($container)
$this[Specs::UPLOAD_CONTAINER] = $container;
return $this;
* Get the upload options (overwrite, auto confirm, etc)
* @see \Sirius\Upload\Handler
* @return null|array
public function getUploadOptions()
return isset($this[Specs::UPLOAD_OPTIONS]) ? $this[Specs::UPLOAD_OPTIONS] : null;
* @param array $options
public function setUploadOptions($options = array())
$this[Specs::UPLOAD_OPTIONS] = $options;
* Get the validation rules for the uploaded file(s)
public function getUploadRules()
return isset($this[Specs::UPLOAD_RULES]) ? $this[Specs::UPLOAD_RULES] : null;
* Sets the validation rules for the uploaded file(s)
* @param array $rules
public function setUploadRules($rules = array())
$this[Specs::UPLOAD_RULES] = $rules;