code: protected function mapEntity($form, $entity, $property)
      {
          if (false === $property) {
              return;
          }
  
          if (true === $property) {
              $mapEntity = $entity;
          } elseif ($entity->hasProperty($property) || is_callable([$entity, "get$property"])) {
              $getter = "get$property";
              $mapEntity = $entity->$getter();
          } else {
              return;
          }
          if ($form instanceof Container) {
              $form->setEntity($mapEntity);
          } else {
              $form->bind($mapEntity);
          }
      }
docs: Maps entity property to forms or child containers.
  
  @param \Zend\Form\FormInterface $form
  @param \Core\Entity\EntityInterface $entity
  @param string $property
  @return void