src/Models/ApiObject.php
protected function importHailData($data)
    {

        if ($this->excluded($data)) {
            return false;
        }

        $dataMap = array_merge(
            ['HailID' => 'id'],
            static::$api_map
        );

        foreach ($dataMap as $ssKey => $hailKey) {
            $value = (isset($data[$hailKey]) && !empty($data[$hailKey])) ? $data[$hailKey] : '';
            //Remove all NON UTF8 if Emoji support is disabled
            if (!Config::inst()->get(Client::class, 'EnableEmojiSupport')) {
                $value = preg_replace('/[^(\x20-\x7F)]*/', '', $value);
            }
            $this->{$ssKey} = html_entity_decode($value);
        }
        $this->Fetched = date("Y-m-d H:i:s");

        $this->write();

        $this->importing($data);

        $this->write();

        return true;
    }
protected function importHailData($data)
    {

        if ($this->excluded($data)) {
            return false;
        }

        $dataMap = array_merge(
            ['HailID' => 'id'],
            static::$api_map
        );

        foreach ($dataMap as $ssKey => $hailKey) {
            $value = (isset($data[$hailKey]) && !empty($data[$hailKey])) ? $data[$hailKey] : '';
            //Remove all NON UTF8 if Emoji support is disabled
            if (!Config::inst()->get(Client::class, 'EnableEmojiSupport')) {
                $value = preg_replace('/[^(\x20-\x7F)]*/', '', $value);
            }
            $this->{$ssKey} = html_entity_decode($value);
        }
        $this->Fetched = date("Y-m-d H:i:s");

        $this->write();

        $this->importing($data);

        $this->write();

        return true;
    }
protected function importHailData ( $ data ) { if ( $ this -> excluded ( $ data ) ) { return false ; } $ dataMap = array_merge ( [ 'HailID' => 'id' ] , static :: $ api_map ) ; foreach ( $ dataMap as $ ssKey => $ hailKey ) { $ value = ( isset ( $ data [ $ hailKey ] ) && ! empty ( $ data [ $ hailKey ] ) ) ? $ data [ $ hailKey ] : '' ; //Remove all NON UTF8 if Emoji support is disabled if ( ! Config :: inst ( ) -> get ( Client :: class , 'EnableEmojiSupport' ) ) { $ value = preg_replace ( '/[^(\x20-\x7F)]*/' , '' , $ value ) ; } $ this -> { $ ssKey } = html_entity_decode ( $ value ) ; } $ this -> Fetched = date ( "Y-m-d H:i:s" ) ; $ this -> write ( ) ; $ this -> importing ( $ data ) ; $ this -> write ( ) ; return true ; }
Process the json data from Hail API and writes to SS db

Return true if the value should be saved to the database. False if it has been excluded.

@param array $data JSON data from Hail
@return boolean
@throws
Process the json data from Hail API and writes to SS db