/** * Returns rows which are structured for "Who has access" datagrid * * @param array $objects * * @return array */ protected function getRows($objects) { $rows = []; foreach ($objects as $object) { $rows[] = new ResultRecord(['id' => json_encode(['entityId' => (string) $this->propertyAccessor->getValue($object, 'id'), 'entityClass' => ClassUtils::getRealClass($object)]), 'entity' => $this->shareFormatter->getEntityDetails($object)]); } return $rows; }
/** * Returns rows which are structured for "oro_share_select" form type * * @param object[] $objects * * @return array */ protected function getRows($objects) { $rows = []; foreach ($objects as $object) { $details = $this->shareFormatter->getEntityDetails($object); $rows[] = ['id' => json_encode(['entityId' => (string) $this->propertyAccessor->getValue($object, 'id'), 'entityClass' => ClassUtils::getRealClass($object)]), 'text' => $details['label'], 'recordId' => $this->propertyAccessor->getValue($object, 'id'), 'classLabel' => $details['classLabel'], 'entityClass' => ClassUtils::getRealClass($object), 'entity' => $this->twig->render('OroSecurityBundle:Share:Property/entity.html.twig', ['value' => $details])]; } return $rows; }