partkeepr

fork of partkeepr
git clone https://git.e1e0.net/partkeepr.git
Log | Files | Refs | Submodules | README | LICENSE

commit 1cc45d53f5535912bea11ee15baf8a5ce4851ad1
parent d32a4fdf355d9370dfeb1660c6d2e0f28e0aa374
Author: Felicitus <felicitus@felicitus.org>
Date:   Mon, 23 Jul 2012 13:44:42 +0200

Added documentation for the auth API call

Diffstat:
Msrc/backend/PartKeepr/Auth/AuthService.php | 4+++-
Msrc/backend/PartKeepr/Service/ServiceManager.php | 6++++++
Msrc/backend/PartKeepr/UserPreference/UserPreference.php | 15+++++++++++++--
3 files changed, 22 insertions(+), 3 deletions(-)

diff --git a/src/backend/PartKeepr/Auth/AuthService.php b/src/backend/PartKeepr/Auth/AuthService.php @@ -13,12 +13,14 @@ use PartKeepr\Service\AnonService, /** + * Implements the AuthService * @ServiceDescription(description="Manages authentication against PartKeepr") */ class AuthService extends AnonService { /** * Logs in the given user. If the login was successful, a session is automatically started. - * + * + * @return array The data * @throws InvalidLoginDataException * * @ServiceCall(description="Authenticates a user against the system", diff --git a/src/backend/PartKeepr/Service/ServiceManager.php b/src/backend/PartKeepr/Service/ServiceManager.php @@ -163,5 +163,11 @@ class ServiceManager extends Singleton { throw new InvalidLoginDataException(); } } + + public function getRegisteredServices () { + return array( + "PartKeepr\\Auth\\AuthService" + ); + } } \ No newline at end of file diff --git a/src/backend/PartKeepr/UserPreference/UserPreference.php b/src/backend/PartKeepr/UserPreference/UserPreference.php @@ -8,7 +8,10 @@ use PartKeepr\Util\Serializable, PartKeepr\Util\BaseEntity, PartKeepr\UserPreference\Exceptions\UserPreferenceNotFoundException, PartKeepr\Util\Exceptions\EntityNotPersistantException, - Doctrine\ORM\NoResultException; + Doctrine\ORM\NoResultException, + PartKeepr\Service\Annotations\ApiType, + PartKeepr\Service\Annotations\ApiTypeOutput, + PartKeepr\Service\Annotations\ApiTypeOutputs; /** * Represents a user preference entry. @@ -17,7 +20,9 @@ use PartKeepr\Util\Serializable, * specify the key and value himself. * * Note that values are stored internally as serialized PHP values to keep their type. - * + * + * @ApiType(description="Represents a user preference", + * documentation="User preferences are user-specific settings, which are identified by keys and values. Think of them as an associative array.") * @Entity **/ class UserPreference implements Serializable { @@ -96,6 +101,12 @@ class UserPreference implements Serializable { /** * (non-PHPdoc) * @see PartKeepr\Util.Serializable::serialize() + * + * @ApiTypeOutputFields(outputFields={ + * @ApiTypeOutputField(name="key", type="string:255", description="The preference key"), + * @ApiTypeOutputField(name="value", type="text", description="The preference value"), + * @ApiTypeOutputField(name="user_id", type="integer", description="The user ID this preference belongs to") + * }) */ public function serialize () { return array(