Commit 82cb0662 authored by Brice Vercoustre's avatar Brice Vercoustre
Browse files

Add method to delete File, Stream and Resource objects

parent a6641000
<?php
namespace Libcast\Client\Command;
use Libcast\Client\Model\FileInterface;
use Libcast\Client\Exception\BadParameterException;
class DeleteFile extends FileCommand
{
/**
*
* @var string
*/
protected $method = 'DELETE';
/**
*
* @param FileInterface $folder
*/
public function __construct(FileInterface $file)
{
if (!$file->href) {
throw new BadParameterException(__CLASS__.' requires a File hyperlink, none given.');
}
$this->fullPath = $file->href;
}
}
<?php
namespace Libcast\Client\Command;
use Libcast\Client\Model\ResourceInterface;
use Libcast\Client\Exception\BadParameterException;
class DeleteResource extends ResourceCommand
{
/**
*
* @var string
*/
protected $method = 'DELETE';
/**
*
* @param ResourceInterface $folder
*/
public function __construct(ResourceInterface $resource)
{
if (!$resource->href) {
throw new BadParameterException(__CLASS__.' requires a Resource hyperlink, none given.');
}
$this->fullPath = $resource->href;
}
}
<?php
namespace Libcast\Client\Command;
use Libcast\Client\Model\StreamInterface;
use Libcast\Client\Exception\BadParameterException;
class DeleteStream extends StreamCommand
{
/**
*
* @var string
*/
protected $method = 'DELETE';
/**
*
* @param StreamInterface $folder
*/
public function __construct(StreamInterface $stream)
{
if (!$stream->href) {
throw new BadParameterException(__CLASS__.' requires a Stream hyperlink, none given.');
}
$this->fullPath = $stream->href;
}
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment