Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /**
- * Get list result periods
- *
- * @return array
- */
- public function getListResultPeriods()
- {
- return [
- 'Bad',
- 'Good',
- ];
- }
- /**
- * Get periods for products from request.
- *
- * @access private
- *
- * @param
- *
- * @return array
- */
- private function getProductPeriodsFromRequest($request)
- {
- $periods = [];
- $from = $request->get('period_from', []);
- $to = $request->get('period_to', []);
- $result = $request->get('allow', []);
- $comments = $request->get('comment', []);
- foreach ($from as $index => $data) {
- if (isset($to[ $index ]) && isset($result[ $index ])) {
- $md5 = md5($data . ' ' . $to[ $index]);
- $periods[ $md5 ] = [
- 'from' => $data,
- 'to' => $to[ $index ],
- 'allow' => $result[ $index ],
- 'comment' => $comments[ $index ],
- ];
- }
- }
- return $periods;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement