src/modules/apiapp/models/Apiapp.php
public static function getTokenForName ($name)
		{
			$object = self::findOne([ 'name' => $name ]);
			if ($object == null)
			{
				$object = new App([
					'name'  => $name,
					'token' => StringHelper::random(16)
				]);
				$object->save();
			}

			return $object->token;
		}
public static function getTokenForName ($name)
		{
			$object = self::findOne([ 'name' => $name ]);
			if ($object == null)
			{
				$object = new App([
					'name'  => $name,
					'token' => StringHelper::random(16)
				]);
				$object->save();
			}

			return $object->token;
		}
public static function getTokenForName ( $ name ) { $ object = self :: findOne ( [ 'name' => $ name ] ) ; if ( $ object == null ) { $ object = new App ( [ 'name' => $ name , 'token' => StringHelper :: random ( 16 ) ] ) ; $ object -> save ( ) ; } return $ object -> token ; }
Finds App token by its name.

@param string $name     App name.

@return string
Finds App token by its name .