__('Type 1'), '2' => __('Type 2'), '3' => __('Type 3')]; } public function getStatusList() { return ['1' => __('Status 1'), '2' => __('Status 2'), '3' => __('Status 3'), '4' => __('Status 4'), '5' => __('Status 5'), '6' => __('Status 6')]; } public function getDeliveryTimeTextAttr($value, $data) { $value = $value ? $value : (isset($data['delivery_time']) ? $data['delivery_time'] : ''); return is_numeric($value) ? date("Y-m-d H:i:s", $value) : $value; } public function getTypeTextAttr($value, $data) { $value = $value ? $value : (isset($data['type']) ? $data['type'] : ''); $list = $this->getTypeList(); return isset($list[$value]) ? $list[$value] : ''; } public function getBillingTimeTextAttr($value, $data) { $value = $value ? $value : (isset($data['billing_time']) ? $data['billing_time'] : ''); return is_numeric($value) ? date("Y-m-d H:i:s", $value) : $value; } public function getStatusTextAttr($value, $data) { $value = $value ? $value : (isset($data['status']) ? $data['status'] : ''); $list = $this->getStatusList(); return isset($list[$value]) ? $list[$value] : ''; } protected function setDeliveryTimeAttr($value) { return $value === '' ? null : ($value && !is_numeric($value) ? strtotime($value) : $value); } protected function setBillingTimeAttr($value) { return $value === '' ? null : ($value && !is_numeric($value) ? strtotime($value) : $value); } public function object_array($array) { if (is_object($array)) { $array = (array) $array; } if (is_array($array)) { foreach ($array as $key => $value) { $array[$key] = $this->object_array($value); } } return $array; } }