<?php
/**
 * Data manipulation for the docuemnts
 */
 class CustomersModel{
     /**
      * returns all the invoice processes existing in the application
      * @return Array   all the invoice processes from the application
      */
     public function getOrderTypes() {
        $orderType = new OrderType();

        return $orderType->getOrderTypes();
     }

     /**
      * get customers list linked to the commercial lead
      * @return Array    list of customers linked to a commercial lead
      */
     public function getComercialLeadCustomers(){
         $data = [];
         $clCustomers = new ClCustomers();
         $orderType = new OrderType();

         $data['customers'] = $clCustomers->getComercialLeadCustomers();
         $data['defaultIdOrderType'] = $orderType->getCLDefaultOrderType();
         return $data;
     }

     /**
      * save Default Order Type
      * @param  INT $defaultIdOrderType id for default order type
      * @return Array                    update message
      */
     public function saveDefaultOrderType($defaultIdOrderType){
         $orderType = new OrderType();

         return $orderType->saveDefaultOrderType($defaultIdOrderType);
     }

     /**
      *  save Customers Order Types
      * @param  Object $customers list of customers containg alos the id for order type
      * @return Array            update message
      */
     public function saveCustomersOrderTypes($customers){
         $orderType = new OrderType();

         return $orderType->saveCustomersOrderTypes($customers);
     }
 }
