I'm getting this error while trying to compare an object to a string I believe. But I can't find a way to get the data from the object to compare.
I'm getting
Call to a member function getStatus() on array
Which makes sense as I'm trying to compare the object to "1" but how do I pull out the object content in the foreach and compare it to 1?
$this->data['document_collection'] = $this->em->getRepository('Entities\Documents')->findAll();
$this->data['onboarding_data'] = $this->em->getRepository('Entities\Onboarding')->findBy(['user' => $this->session->user_id]);
<?php
foreach($document_collection as $onboarding):
?>
<tr>
<td>
<?php
echo $onboarding->getDocument();
?>
</td>
<td align="center">
<?php
echo anchor($onboarding->getUrl(), "Download");
?>
</td>
<td class="">
<label class="option block mn">
<input type="checkbox"
name="status" value="1"
<?php if($onboarding_data->getStatus() == "1" && $onboarding->getId() == $onboarding_data->getDocument_Id()->getId()):?>
checked="checked"
<?php endif;?>
>
</td>
</tr>
<?php endforeach;?>