Property.class.php
997 Bytes
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
<?php
namespace Cpeople\Classes\Infoblock;
class Property extends \Cpeople\Classes\Base\Object
{
protected $data;
protected $options;
public function getOptions()
{
if (!isset($this->options))
{
$res = \CIBlockProperty::GetPropertyEnum(
$this->data['ID'],
Array("SORT"=>"asc"),
Array()
);
while ($row = $res->Fetch())
{
$this->options[] = $row;
}
}
return $this->options;
}
public function __get($name)
{
if (isset($this->data[strtoupper($name)]))
{
return $this->data[strtoupper($name)];
}
$trace = debug_backtrace();
trigger_error(
'Undefined property in __get(): ' . $name .
' in file ' . $trace[0]['file'] .
' line ' . $trace[0]['line'], E_USER_NOTICE
);
}
}