getExperienceId
Learn how to read the ID of the experience.
This method gives you the ID of the experience.
Signature
This method has the following signature:
public function getExperienceId(): stringThis method returns the ID of the experience.
Example
Here is a basic example of how to use this method:
<?phpuse Croct\Plug\Croct;use Croct\Plug\FetchOptions;
$croct = Croct::fromDotenv();$options = FetchOptions::defaults()->withSchema();$experience = $croct->fetchContent('home-banner', $options)->getMetadata()->getExperience();$experienceId = $experience->getExperienceId();