diff --git a/include/class-App.php b/include/class-App.php index 72cfd12..f781c17 100644 --- a/include/class-App.php +++ b/include/class-App.php @@ -1,47 +1,66 @@ . /** * Methods of an App class */ trait AppTrait { /** * Get the App ID * * @return int */ public function getAppID() { return $this->get( 'app_ID' ); } /** * Get the App name * * @return string */ public function getAppName() { return $this->get( 'app_name' ); } + + /** + * Normalize an App after being retrieved from database + */ + protected function normalizeApp() { + $this->integers( 'app_ID' ); + } } /** * Class that can wrap an App retrieved from the database + * + * An App rappresents an instance of a WikiCAPTCHA application + * assigned to a website. */ class App { + use AppTrait; + + /** + * Constructor + */ + public function __construct() { + $this->normalizeApp(); + } + }