src/Models/ApiObject.php
protected function processHeroVideo($heroVidData)
    {
        if ($heroVidData) {
            $hero = Video::get()->filter(['HailID' => $heroVidData['id']])->first();
            if (!$hero) {
                $hero = new Video();
            }
            $hero->OrganisationID = $this->OrganisationID;
            $hero->HailOrgID = $this->HailOrgID;
            $hero->HailOrgName = $this->HailOrgName;

            $hero->importHailData($heroVidData);
            $hero = $hero->ID;
        } else {
            $hero = null;
        }

        $this->HeroVideoID = $hero;
    }
protected function processHeroVideo($heroVidData)
    {
        if ($heroVidData) {
            $hero = Video::get()->filter(['HailID' => $heroVidData['id']])->first();
            if (!$hero) {
                $hero = new Video();
            }
            $hero->OrganisationID = $this->OrganisationID;
            $hero->HailOrgID = $this->HailOrgID;
            $hero->HailOrgName = $this->HailOrgName;

            $hero->importHailData($heroVidData);
            $hero = $hero->ID;
        } else {
            $hero = null;
        }

        $this->HeroVideoID = $hero;
    }
protected function processHeroVideo ( $ heroVidData ) { if ( $ heroVidData ) { $ hero = Video :: get ( ) -> filter ( [ 'HailID' => $ heroVidData [ 'id' ] ] ) -> first ( ) ; if ( ! $ hero ) { $ hero = new Video ( ) ; } $ hero -> OrganisationID = $ this -> OrganisationID ; $ hero -> HailOrgID = $ this -> HailOrgID ; $ hero -> HailOrgName = $ this -> HailOrgName ; $ hero -> importHailData ( $ heroVidData ) ; $ hero = $ hero -> ID ; } else { $ hero = null ; } $ this -> HeroVideoID = $ hero ; }
Match the hero video if there's one and assign it to this object

@param array $heroVidData JSON data from Hail
Match the hero video if there s one and assign it to this object