__('Type 1'), '2' => __('Type 2'), '3' => __('Type 3')]; } public function getStatusListList() { return ['1' => __('Status_list 1'), '2' => __('Status_list 2'), '3' => __('Status_list 3'), '4' => __('Status_list 4'), '5' => __('Status_list 5')]; } 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 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 getStatusListTextAttr($value, $data) { $value = $value ? $value : (isset($data['status_list']) ? $data['status_list'] : ''); $list = $this->getStatusListList(); return isset($list[$value]) ? $list[$value] : ''; } protected function setBillingTimeAttr($value) { return $value === '' ? null : ($value && !is_numeric($value) ? strtotime($value) : $value); } protected function setDeliveryTimeAttr($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; } }