2015-05-06 14:11:00 +02:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace Gist\Model;
|
|
|
|
|
|
|
|
use Gist\Model\Base\Gist as BaseGist;
|
|
|
|
|
|
|
|
class Gist extends BaseGist
|
|
|
|
{
|
|
|
|
public function hydrateWith(array $data)
|
|
|
|
{
|
|
|
|
if (isset($data['title'])) {
|
|
|
|
$this->setTitle(trim($data['title']));
|
|
|
|
}
|
|
|
|
|
|
|
|
if (isset($data['type'])) {
|
|
|
|
$this->setType($data['type']);
|
|
|
|
}
|
|
|
|
|
2015-05-06 20:35:30 +02:00
|
|
|
$this->setCipher(isset($data['cipher']) && $data['cipher'] === 'yes');
|
2015-05-06 14:11:00 +02:00
|
|
|
|
|
|
|
return $this;
|
|
|
|
}
|
|
|
|
|
|
|
|
public function generateFilename()
|
|
|
|
{
|
|
|
|
$this->setFile(uniqid());
|
|
|
|
}
|
|
|
|
}
|