PHP code example of scaleplan / access

1. Go to this page and download the library: Download scaleplan/access library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

scaleplan / access example snippets


/**
     * Get user object
     *
     * @accessMethod
     *
     * @accessFilter id
     *
     * @param int $id - user identifier
     *
     * @return UserAbstract
     */
    protected static function actionGet(int $id): UserAbstract
    {
//...
    }

/**
     * Set user role
     *
     * @accessMethod
     *
     * @accessFilter id, role
     *
     * @param int|string $id - user identifier
     * @param string/IRole $role - user role
     *
     * @return UserAbstract|void
     */
    protected static function actionSetRole(int $id, string $role)
    {
//...
    }