Hello guys i get my data from db with API i want to show data in frontend , i can do this
this is function, that return an array of data.
public function getComputerAttr($customerId) {
$computerData = $this->computerFactory->create()->getData();
$computers = [];
foreach ($computerData as $computer){
if( $computer['entity_id'] == $customerId) {
$data = [
"brand" => $computer['computer_brand'],
"id" => $computer['entity_id'],
"model" => $computer['computer_model']
];
array_push($computers,$data);
}
}
return $computers;
}