Youshido\Tests\StarWars\Schema\StarWarsData::getCharacter PHP Method

getCharacter() static public method

Helper function to get a character by ID.
static public getCharacter ( $id )
    static function getCharacter($id)
    {
        $humans = self::humans();
        $droids = self::droids();
        if (isset($humans[$id])) {
            return $humans[$id];
        }
        if (isset($droids[$id])) {
            return $droids[$id];
        }
        return null;
    }