/
LegacyKey.php
48 lines (39 loc) · 1.12 KB
/
LegacyKey.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
<?php
namespace Concrete\Core\Entity\Attribute\Key;
use Concrete\Core\Attribute\Category\LegacyCategory;
use Concrete\Core\Attribute\Value\EmptyRequestAttributeValue;
use Concrete\Core\Entity\Attribute\Value\Value\Value;
use Doctrine\ORM\Mapping as ORM;
/**
* @deprecated
* @ORM\Entity
* @ORM\Table(name="LegacyAttributeKeys")
*/
class LegacyKey extends Key
{
public function getAttributeKeyCategoryHandle()
{
return 'legacy';
}
public function getAttributeKeyIconSRC()
{
$type = $this->getAttributeType();
$env = \Environment::get();
$url = $env->getURL(
implode('/', array(DIRNAME_ATTRIBUTES . '/' . $type->getAttributeTypeHandle() . '/' . FILENAME_BLOCK_ICON)),
$type->getPackageHandle()
);
return $url;
}
public function update($args)
{
$controller = $this->getAttributeCategory();
return $controller->updateFromRequest($this, \Request::getInstance());
}
public function delete()
{
$em = \Database::connection()->getEntityManager();
$em->remove($this);
$em->flush();
}
}