// проверяем наличие доступа
if (!cmsUser::isAllowed($ctype_name, 'add')) {
if (!cmsUser::isAllowed($ctype_name, 'add_to_parent')) {
cmsCore::error404();
}
$is_check_parent_perm = true;
}
// проверяем наличие доступа
if (!cmsUser::isAllowed($ctype_name, 'add')) {
if (!cmsUser::isAllowed($ctype_name, 'add_to_parent')) {
if(!$this->cms_user->is_logged){
cmsUser::goLogin();
}
cmsCore::error404();
}
$is_check_parent_perm = true;
}
<?php
class computer {
public function __get($name) {
if(class_exists($name)){
$this->{$name} = new $name();
return $this->{$name};
}
return null;
}
}
abstract class computerInfo {
protected $price;
public function getPrice() {
return $this->price;
}
}
class hardware extends computerInfo {
public function __construct() {
$this->price=40000;
}
}
class software extends ComputerInfo {
public function __construct() {
$this->price=15000;
}
}
$computer = new computer;
print $computer->software->getPrice();
print "\r\n <br />";
print $computer->hardware->getPrice();