public function addMap(Map $map, $login = null, $force = false, $addFirst = false)
    {

        if (!$login) {
            return false;
        }

        $player = $this->playerStorage->getPlayerInfo($login);
        $jbMap = new JukeboxMap($map, $player);

        if ($force) {
            $this->add($jbMap, $addFirst);

            return true;
        }
        // no some restrictions for admin
        if ($this->adminGroups->hasPermission($login, "jukebox")) {
            if ($this->checkMap($map) === false) {
                $this->add($jbMap, $addFirst);

                return true;
            }

        } else {
            // restrict 1 map per 1 login
            if ($this->checkLogin($login) === false && $this->checkMap($map) === false) {
                $this->add($jbMap, $addFirst);

                return true;
            }
        }

        return false;
    }
public function addMap(Map $map, $login = null, $force = false, $addFirst = false)
    {

        if (!$login) {
            return false;
        }

        $player = $this->playerStorage->getPlayerInfo($login);
        $jbMap = new JukeboxMap($map, $player);

        if ($force) {
            $this->add($jbMap, $addFirst);

            return true;
        }
        // no some restrictions for admin
        if ($this->adminGroups->hasPermission($login, "jukebox")) {
            if ($this->checkMap($map) === false) {
                $this->add($jbMap, $addFirst);

                return true;
            }

        } else {
            // restrict 1 map per 1 login
            if ($this->checkLogin($login) === false && $this->checkMap($map) === false) {
                $this->add($jbMap, $addFirst);

                return true;
            }
        }

        return false;
    }
public function addMap ( Map $ map , $ login = null , $ force = false , $ addFirst = false ) { if ( ! $ login ) { return false ; } $ player = $ this -> playerStorage -> getPlayerInfo ( $ login ) ; $ jbMap = new JukeboxMap ( $ map , $ player ) ; if ( $ force ) { $ this -> add ( $ jbMap , $ addFirst ) ; return true ; } // no some restrictions for admin if ( $ this -> adminGroups -> hasPermission ( $ login , "jukebox" ) ) { if ( $ this -> checkMap ( $ map ) === false ) { $ this -> add ( $ jbMap , $ addFirst ) ; return true ; } } else { // restrict 1 map per 1 login if ( $ this -> checkLogin ( $ login ) === false && $ this -> checkMap ( $ map ) === false ) { $ this -> add ( $ jbMap , $ addFirst ) ; return true ; } } return false ; }
Adds map as last or first item

@param Map  $map
@param null $login
@param bool $force
@param bool $addFirst

@return bool
Adds map as last or first item