Returns the loaded behaviors and loads them if not done before

@return array behaviors
69
public function getBehaviors()
    {
        if (null === $this->behaviors) {
            // find behaviors in composer.lock file
            $lock = $this->findComposerLock();

            if (null === $lock) {
                $this->behaviors = [];
            } else {
                $this->behaviors = $this->loadBehaviors($lock);
            }

            // find behavior in composer.json (useful when developing a behavior)
            $json = $this->findComposerJson();

            if (null !== $json) {
                $behavior = $this->loadBehavior(json_decode($json->getContents(), true));

                if (null !== $behavior) {
                    $this->behaviors[$behavior['name']] = $behavior;
                }
            }
        }

        return $this->behaviors;
    }
1242130
public function actions()
    {
        $flag = [
            'actions',
            '__construct',
            '__toString',
            '__invoke',
            '__call',
            'offsetExists',
            'offsetGet',
            'offsetSet',
            'offsetUnset',
            '__get',
            '__set',
            '__isset',
            '__unset',
            'normalizeKey',
            'set',
            'get',
            'replace',
            'has',
            'remove',
            'getIterator',
        ];

        return [
            'classname' => get_class($this),
            'methods' => array_diff(get_class_methods($this), $flag),
            '_methods' => array_intersect(get_class_methods($this), $flag),
            '_sys' => array_intersect(get_class_methods($this), [
                'actions',
                'clear',
                'count',
                'all',
                'keys',
                'load'
            ]),
            '_config' => $class_vars = get_class_vars(get_class($this)),
        ];
    }
973414
protected function getCurrentState()
    {
        return [
            'application_name' => $this->config->get('application_name'),
            'application' => realpath($this->paths->getBasePath()),
            'configuration' => realpath($this->paths->getConfigurationPath()),
            'logs' => $this->paths->getLogsPath(),
        ];
    }
1127423
public function behaviors() {

        return [
            'rbac' => [
                'class' => Yii::$app->cmgCore->getRbacFilterClass(),
                'actions' => [
	                'invite' => [ 'permission' => CoreGlobal::PERM_USER ],
	                'activate' => [ 'permission' => CoreGlobal::PERM_USER ],
	                'deactivate' => [ 'permission' => CoreGlobal::PERM_USER ],
	                'join' => [ 'permission' => CoreGlobal::PERM_USER ],
	                'update-role' => [ 'permission' => CoreGlobal::PERM_USER ],
	                'delete' => [ 'permission' => CoreGlobal::PERM_USER ]
                ]
            ],
            'verbs' => [
                'class' => VerbFilter::className(),
                'actions' => [
                    'invite' => [ 'post' ],
                    'activate' => [ 'post' ],
                    'deactivate' => [ 'post' ],
                    'join' => [ 'post' ],
                    'update-role' => [ 'post' ],
                    'delete' => [ 'post' ]
                ]
            ]
        ];
    }
1118691
public function get_activities() {
        $modinfo = get_fast_modinfo($this->course);
        $result = array();
        foreach ($modinfo->get_cms() as $cm) {
            if ($cm->completion != COMPLETION_TRACKING_NONE && !$cm->deletioninprogress) {
                $result[$cm->id] = $cm;
            }
        }
        return $result;
    }
128897
public function getPluginsLoadedAndActivated()
    {
        if (is_null($this->pluginsLoadedAndActivated)) {
            $enabled = $this->getActivatedPlugins();

            if (empty($enabled)) {
                return array();
            }

            $plugins = $this->getLoadedPlugins();
            $enabled = array_combine($enabled, $enabled);
            $plugins = array_intersect_key($plugins, $enabled);

            $this->pluginsLoadedAndActivated = $plugins;
        }

        return $this->pluginsLoadedAndActivated;
    }
1131489
public function getActions()
    {
        $actions = [];
        foreach ($this->data['actions'] as $action) {
            $name = $action['name'];
            $time = isset($action['time'])
                ? $action['time']
                : 0;
            if (isset($actions[$name])) {
                $actions[$name]['count'] += 1;
                $actions[$name]['time'] += $time;
            } else {
                $actions[$name] = ['name' => $name, 'count' => 1, 'time' => $time];
            }
        }

        return array_values($actions);
    }
156383
public function getObjectActions()
    {
        if (null === $this->objectActions) {
            $this->objectActions = array();
            $this->findObjectActions();
        }

        return $this->objectActions;
    }
1227400
function() {
      var behaviorContext = Behavior.prototype.prepare.apply(this) || {};
      behaviorContext.data = this.data.toJSON();
      behaviorContext.loading = this.isLoading();
      behaviorContext.loadingIds = this.isLoadingIds();
      behaviorContext.loadingObjects = this.isLoadingObjects();
      return behaviorContext;
    }
907502
public function getActions()
    {
        $this->beforeAction();
        $role = new \core_kernel_classes_Resource($this->getRequestParameter('role'));
        $included = array();
        foreach (\tao_models_classes_RoleService::singleton()->getIncludedRoles($role) as $includedRole) {
            $included[] = $includedRole->getUri();
        }
        $module = new \core_kernel_classes_Resource($this->getRequestParameter('module'));

        $controllerClassName = MapHelper::getControllerFromUri($module->getUri());
        $controllerAccess = CacheHelper::getControllerAccess($controllerClassName);

        $actions = array();
        foreach (ControllerHelper::getActions($controllerClassName) as $actionName) {
            $uri = MapHelper::getUriForAction($controllerClassName, $actionName);
            $part = explode('#', $uri);
            list($type, $extId, $modId, $actId) = explode('_', $part[1]);

            $allowedRoles = isset($controllerAccess['actions'][$actionName])
                ? array_merge($controllerAccess['module'], $controllerAccess['actions'][$actionName])
                : $controllerAccess['module'];

            $access = count(array_intersect($included, $allowedRoles)) > 0
                ? self::ACCESS_INHERITED
                : (in_array($role->getUri(), $allowedRoles)
                    ? self::ACCESS_FULL
                    : self::ACCESS_NONE);

            $actions[$actId] = array(
                'uri' => $uri,
                'access' => $access,
                'locked' => $this->isLocked(),
            );
        }

        ksort($actions);

        $this->returnJson($actions);
    }
914508
protected function loadFlashes()
	{
		if (isset($this->loadFlashesCallback) && $this->loadFlashesCallback instanceof \Closure) {
			return call_user_func($this->loadFlashesCallback);
		} else {
			return Yii::$app->session->getAllFlashes();
		}
	}
611359
public function getStatistics()
    {
        return [
            'currentCallCount'       => count($this->calls),
            'registeredAt'           => $this->registeredAt,
            'invocationCount'        => $this->invocationCount,
            'invocationAverageTime'  => $this->invocationAverageTime,
            'busyTime'               => $this->busyTime,
            'busyStart'              => $this->busyStart,
            'lastIdledAt'            => $this->lastIdledAt,
            'lastCallStartedAt'      => $this->lastCallStartedAt,
            'completedCallTimeTotal' => $this->completedCallTimeTotal
        ];
    }
715001
public function getMethods()
    {
        $methods = parent::getMethods();
        $methods = array_diff($methods, $this->_exclude_actions);

        return $methods;
    }
906634
public function getNextTableBehavior()
    {
        // order the behaviors according to Behavior::$tableModificationOrder
        $behaviors = array();
        foreach ($this->getTables() as $table) {
            foreach ($table->getBehaviors() as $behavior) {
                if (!$behavior->isTableModified()) {
                    $behaviors[$behavior->getTableModificationOrder()][] = $behavior;
                }
            }
        }
        ksort($behaviors);
        foreach ($behaviors as $behaviorList) {
            foreach ($behaviorList as $behavior) {
                return $behavior;
            }
        }
    }
1001933
public function performSelfCheck()
	{
		$results = [];

		$results['id'] = $this->describeId();
		$results['class'] = get_class($this);
		$results['missing_methods'] = [];
		$results['errors'] = $this->errors;

		foreach ($this->describeAllMachineActions() as $a => $action) {
			foreach ($action['transitions'] as $t => $transition) {
				$transition = array_merge($action, $transition);
				$method = isset($transition['method']) ? $transition['method'] : $a;
				if (!is_callable([$this, $method])) {
					$results['missing_methods'][] = $method;
				}
			}
			sort($results['missing_methods']);
			$results['missing_methods'] = array_unique($results['missing_methods']);
		}

		$results['unreachable_states'] = $this->findUnreachableStates();

		return $results;
	}
725089
public function getTraits()
    {
        if (!isset($this->traits)) {
            $traitAdaptations = [];
            $this->traits     = ReflectionClass::collectTraitsFromClassNode($this->classLikeNode, $traitAdaptations);
            $this->traitAdaptations = $traitAdaptations;
        }

        return $this->traits;
    }
523850
public function getBlameableBehaviors()
    {
        $cache = $this->getCache();
        if ($cache) {
            $this->blameableLocalBehaviors = $cache->get($this->getBlameableBehaviorsCacheKey());
        }
        if (empty($this->blameableLocalBehaviors) || !is_array($this->blameableLocalBehaviors)) {
            if ($cache) {
                TagDependency::invalidate($cache, [$this->getEntityBehaviorsCacheTag()]);
            }
            $behaviors = parent::behaviors();
            $behaviors['blameable'] = [
                'class' => BlameableBehavior::class,
                'createdByAttribute' => $this->createdByAttribute,
                'updatedByAttribute' => $this->updatedByAttribute,
                'value' => [$this,
                    'onGetCurrentUserGuid'],
            ];
            $this->setBlameableBehaviors($behaviors);
        }
        return $this->blameableLocalBehaviors;
    }