1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
<?php /** * Created by PhpStorm. * User: denys * Date: 20.10.15 * Time: 15:48 */ namespace backend\components; use ReflectionClass; trait ConstantTrait { public function getConstants() { $oClass = new ReflectionClass(get_class($this)); return $oClass->getConstants(); } }