src/Models/ApiObject.php
protected function processPublicTags($data)
    {
        $tagIdList = [];
        // Clean tags before importing the new ones
        // but have not been returned this time around
        $this->PublicTags()->removeAll();
        foreach ($data as $tagData) {
            $tagIdList[] = $tagData['id'];

            // Find a matching HailTag or create an new one
            $tag = PublicTag::get()->filter(['HailID' => $tagData['id']])->first();

            if (!$tag) {
                $tag = new PublicTag();
            }

            $tag->OrganisationID = $this->OrganisationID;
            $tag->HailOrgID = $this->HailOrgID;
            $tag->HailOrgName = $this->HailOrgName;

            // Update the PublicTags
            $tag->importHailData($tagData);
            if (!$this->PublicTags()->byID($tag->ID)) {
                $this->PublicTags()->add($tag);
            }
        }

    }
protected function processPublicTags($data)
    {
        $tagIdList = [];
        // Clean tags before importing the new ones
        // but have not been returned this time around
        $this->PublicTags()->removeAll();
        foreach ($data as $tagData) {
            $tagIdList[] = $tagData['id'];

            // Find a matching HailTag or create an new one
            $tag = PublicTag::get()->filter(['HailID' => $tagData['id']])->first();

            if (!$tag) {
                $tag = new PublicTag();
            }

            $tag->OrganisationID = $this->OrganisationID;
            $tag->HailOrgID = $this->HailOrgID;
            $tag->HailOrgName = $this->HailOrgName;

            // Update the PublicTags
            $tag->importHailData($tagData);
            if (!$this->PublicTags()->byID($tag->ID)) {
                $this->PublicTags()->add($tag);
            }
        }

    }
protected function processPublicTags ( $ data ) { $ tagIdList = [ ] ; // Clean tags before importing the new ones // but have not been returned this time around $ this -> PublicTags ( ) -> removeAll ( ) ; foreach ( $ data as $ tagData ) { $ tagIdList [ ] = $ tagData [ 'id' ] ; // Find a matching HailTag or create an new one $ tag = PublicTag :: get ( ) -> filter ( [ 'HailID' => $ tagData [ 'id' ] ] ) -> first ( ) ; if ( ! $ tag ) { $ tag = new PublicTag ( ) ; } $ tag -> OrganisationID = $ this -> OrganisationID ; $ tag -> HailOrgID = $ this -> HailOrgID ; $ tag -> HailOrgName = $ this -> HailOrgName ; // Update the PublicTags $ tag -> importHailData ( $ tagData ) ; if ( ! $ this -> PublicTags ( ) -> byID ( $ tag -> ID ) ) { $ this -> PublicTags ( ) -> add ( $ tag ) ; } } }
Go through the list of public tags and assign them to this object.

@param array $data JSON data from Hail
Go through the list of public tags and assign them to this object .