/** * @param $permission * @return mixed * @throws \Exception */ public static function getByKey($permission) { if (!$permission) { throw new \Exception("No permisson defined."); } $list = new Definition\Listing(); $list->setCondition("`key`=?", [$permission]); $list->setLimit(1); $permissionDefinition = $list->load(); if ($permissionDefinition[0]) { return $permissionDefinition[0]; } }