public function applyProfile(ProfileInterface $profile) {
		$this->profiles[] = $profile;
		
		if ($this->links === null) {
			$this->setLinksObject(new LinksObject());
		}
		
		$link = $profile->getAliasedLink();
		if ($link instanceof LinkObject) {
			$this->links->appendLinkObject('profile', $link);
		}
		else {
			$this->links->append('profile', $link);
		}
	}
public function applyProfile(ProfileInterface $profile) {
		$this->profiles[] = $profile;
		
		if ($this->links === null) {
			$this->setLinksObject(new LinksObject());
		}
		
		$link = $profile->getAliasedLink();
		if ($link instanceof LinkObject) {
			$this->links->appendLinkObject('profile', $link);
		}
		else {
			$this->links->append('profile', $link);
		}
	}
public function applyProfile ( ProfileInterface $ profile ) { $ this -> profiles [ ] = $ profile ; if ( $ this -> links === null ) { $ this -> setLinksObject ( new LinksObject ( ) ) ; } $ link = $ profile -> getAliasedLink ( ) ; if ( $ link instanceof LinkObject ) { $ this -> links -> appendLinkObject ( 'profile' , $ link ) ; } else { $ this -> links -> append ( 'profile' , $ link ) ; } }
apply a profile which adds the link and sets a correct content-type

note that the rules from the profile are not automatically enforced
applying the rules, and applying them correctly, is manual
however the $profile could have custom methods to help

@see https://jsonapi.org/format/1.1/#profiles

@param ProfileInterface $profile
apply a profile which adds the link and sets a correct content - type