Se agregan los campos por segmento

This commit is contained in:
2020-06-03 21:59:11 -04:00
parent 2d2eccb600
commit 080ed4553e
14 changed files with 486 additions and 174 deletions

View File

@ -47,9 +47,14 @@ abstract class Model implements \JsonSerializable {
protected function getFilename(): string {
$data = explode("\\", get_called_class());
$folder = $this->factory->getFolder();
$class = array_pop($data);
$productos = ['Bodega', 'Oficina', 'Retail', 'Terreno'];
if (array_search($class, $productos) !== false) {
$class = 'Producto';
}
return implode(DIRECTORY_SEPARATOR, [
$folder,
str_replace(' ', '_', mb_strtolower(array_pop($data))) . 's.json'
str_replace(' ', '_', mb_strtolower($class)) . 's.json'
]);
}
}