Piwik\Tracker\Action::getTypeAsString PHP Метод

getTypeAsString() публичный статический Метод

public static getTypeAsString ( $type )
    public static function getTypeAsString($type)
    {
        $class = new \ReflectionClass("\\Piwik\\Tracker\\Action");
        $constants = $class->getConstants();
        $typeId = array_search($type, $constants);
        if (false === $typeId) {
            return $type;
        }
        return str_replace('TYPE_', '', $typeId);
    }

Usage Example

Пример #1
0
 private static function insertNewIdsAction($actionsNameAndType, $fieldNamesToInsert)
 {
     // Then, we insert all new actions in the lookup table
     $inserted = array();
     foreach ($fieldNamesToInsert as $fieldName) {
         list($name, $type, $urlPrefix) = $actionsNameAndType[$fieldName];
         $actionId = self::getModel()->createNewIdAction($name, $type, $urlPrefix);
         Common::printDebug("Recorded a new action (" . Action::getTypeAsString($type) . ") in the lookup table: " . $name . " (idaction = " . $actionId . ")");
         $inserted[$fieldName] = $actionId;
     }
     return $inserted;
 }
All Usage Examples Of Piwik\Tracker\Action::getTypeAsString