PHP code example of archey347 / uf_altpermissions

1. Go to this page and download the library: Download archey347/uf_altpermissions 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/ */

    

archey347 / uf_altpermissions example snippets


class Organisation extends Model implements IPermissionParent
{
    protected $table = 'organisations';

    protected function getChildren($seekerType) {
        if($seekerType == 'team') {
            return $this->teams();
        }
    }

    protected function teams() {
        return $this->hasMany('...Models\Team');
    }

    ...
}

class Team extends Model implements IPermissionChild
{
    $table_name = 'teams';

    protected function getChildren($seekerType) {
        if($seekerType == 'team') {
            return $this->teams();
        }
    }

    protected function teams() {
        return $this->hasMany('...Models\Team');
    }

    ...
}