src/Entities/Achievement.php
public function parse($achievement)
    {
        // add default fields
        $this->id = $achievement['achievement']['id'];
        $this->name = $achievement['achievement']['name'];
        $this->category = $achievement['achievement']['category'];

        // add requirements if available
        if (isset($achievement['requirements'])) {
            $this->requirements = $achievement['requirements'];
        }

        // add user state if available
        if (isset($achievement['level'])) {
            $this->level = $achievement['level'];
        }
        if (isset($achievement['score'])) {
            $this->score = $achievement['score'];
        }
    }
public function parse($achievement)
    {
        // add default fields
        $this->id = $achievement['achievement']['id'];
        $this->name = $achievement['achievement']['name'];
        $this->category = $achievement['achievement']['category'];

        // add requirements if available
        if (isset($achievement['requirements'])) {
            $this->requirements = $achievement['requirements'];
        }

        // add user state if available
        if (isset($achievement['level'])) {
            $this->level = $achievement['level'];
        }
        if (isset($achievement['score'])) {
            $this->score = $achievement['score'];
        }
    }
public function parse ( $ achievement ) { // add default fields $ this -> id = $ achievement [ 'achievement' ] [ 'id' ] ; $ this -> name = $ achievement [ 'achievement' ] [ 'name' ] ; $ this -> category = $ achievement [ 'achievement' ] [ 'category' ] ; // add requirements if available if ( isset ( $ achievement [ 'requirements' ] ) ) { $ this -> requirements = $ achievement [ 'requirements' ] ; } // add user state if available if ( isset ( $ achievement [ 'level' ] ) ) { $ this -> level = $ achievement [ 'level' ] ; } if ( isset ( $ achievement [ 'score' ] ) ) { $ this -> score = $ achievement [ 'score' ] ; } }
Parses achievement info array to Achievement object
@param $achievement
Parses achievement info array to Achievement object