src/AppBundle/EventListener/ObjectBehaviourListener.php line 49

Open in your IDE?
  1. <?php
  2. namespace AppBundle\EventListener;
  3.   
  4. use Pimcore\Event\Model\ElementEventInterface;
  5. use Pimcore\Event\Model\DataObjectEvent;
  6. use \Pimcore\Model\DataObject;
  7. use \Pimcore\Model\DataObject\Attribute;
  8. use \Pimcore\Model\DataObject\Brand;
  9. use \Pimcore\Model\DataObject\Buyer;
  10. use \Pimcore\Model\DataObject\Color;
  11. use \Pimcore\Model\DataObject\ExtdClass;
  12. use \Pimcore\Model\DataObject\Season;
  13. use \Pimcore\Model\DataObject\Size;
  14. use \Pimcore\Model\DataObject\SubBrand;
  15. use \Pimcore\Model\DataObject\Vendor;
  16. use \Pimcore\Model\DataObject\UnitOfMeasure;
  17. use \Pimcore\Model\DataObject\TermCode;
  18. use \Pimcore\Model\DataObject\PriceEvent;
  19. use \Pimcore\Model\DataObject\ItemMaster;
  20. use \Pimcore\Model\DataObject\MasterItemStatus;
  21. use \Pimcore\Model\DataObject\SKUType;
  22. use Pimcore\Db;
  23. use Pimcore\Log\ApplicationLogger;
  24. use Carbon\Carbon;
  25. class ObjectBehaviourListener 
  26. {
  27.      
  28.       public function onPostUpdate (ElementEventInterface $e
  29.       {
  30.       }
  31.     
  32.      public function onPreAdd(ElementEventInterface $e)
  33.     {
  34.     }
  35.  public function onPreUpdateOLD (ElementEventInterface $e
  36.      {
  37.      }
  38.  public function onPreUpdate (ElementEventInterface $e
  39.      {
  40.         
  41.        
  42.         if($e instanceof AssetEvent
  43.         {
  44.             $foo $e->getAsset(); 
  45.         }
  46.          else if ($e instanceof DocumentEvent)
  47.         {
  48.             $foo $e->getDocument(); 
  49.         } 
  50.         else if ($e instanceof DataObjectEvent
  51.         {
  52.             $foo $e->getObject();          
  53.             $pid =  $foo->getId();   
  54.            // $foo->setInJDAProcess('no');
  55.           //  $foo->save();    
  56.             $claname '';
  57.             $otype $foo->geto_type();
  58.             if(($otype == 'object' || $otype == 'variant'))
  59.             {
  60.               $o_published =$foo->geto_published();
  61.             }
  62.               
  63.               $user = \Pimcore\Tool\Admin::getCurrentUser();
  64.              // throw new \Pimcore\Model\Element\ValidationException($o_published, 1234);
  65.             if(($otype == 'object' || $otype == 'variant') && $o_published == && $user != null)
  66.             {
  67.                 $claname $foo->geto_className();      
  68.             }   
  69.              if($claname == 'ItemMaster' || $claname == 'itemMaster' || $claname == 'TermCode' || $claname == 'termCode' || $claname == 'Vendor' || $claname == 'vendor' || $claname == 'MasterItemStatus' || $claname == 'masterItemStatus' || $claname == 'sKUType' || $claname == 'SKUType' || $claname == 'brand' || $claname == 'Brand' || $claname == 'SubBrand' || $claname == 'subBrand' || $claname == 'Buyer' || $claname == 'buyer' || $claname == 'Season' || $claname == 'season' || $claname == 'Color' || $claname == 'color' || $claname == 'Size' || $claname == 'size' || $claname == 'ExtdClass' || $claname == 'extdClass' || $claname == 'Attribute' || $claname == 'attribute' || $claname == 'UnitOfMeasure' || $claname == 'unitOfMeasure' || $claname == 'Hierarchy' || $claname == 'hierarchy' || $claname == 'BundleItem' || $claname == 'bundleItem' || $claname == 'priceEvent' || $claname == 'PriceEvent' )
  70.             {
  71.     
  72.   $objectData DataObject::getById($pid);
  73.   $tablename "object_".$objectData->geto_classId();
  74.                  $sql "select * from ".$tablename." where  o_id = '".$pid."' ";
  75.                            $stmt Db::get()->prepare($sql);
  76.                          $stmt->execute();
  77.                     $dataI =$stmt->fetchAll();
  78.             $updateJdaData=$dataI[0]['InJDAProcess'];
  79.             $className=$dataI[0]['oo_className'];
  80.             $dateTimeCreatedJDA $foo->getdateTimeCreatedJDA();
  81.             //row new \Pimcore\Model\Element\ValidationException($className, 1234);
  82.   if($claname == 'ItemMaster' || $claname == 'itemMaster')
  83. {
  84.    $statusCodedata  $dataI[0]['statusCode'];
  85.             $statusCodedata  $dataI[0]['statusCode'];
  86.             $stauscodesnew1 explode(',',$statusCodedata);
  87.             $statusCode1 $foo->getstatusCode();
  88.             $x=0;
  89.             $y=0;
  90.             while($x<count($stauscodesnew1))
  91.             {
  92.               if($stauscodesnew1 != '')
  93.               {
  94.                 $stauscodesnew[$y] = $stauscodesnew1[$x];
  95.                 $y++;
  96.               }
  97.    
  98.               $x++;
  99.             }
  100.             if(in_array($statusCode1$stauscodesnew))
  101.             {
  102.             }
  103.             else{
  104.                 //throw new \Pimcore\Model\Element\ValidationException($statusCode1.'hi', 1234);
  105.             }
  106.           //  print_r($stauscodesnew);
  107.            // $newd = implode('@',$stauscodesnew);
  108.            // throw new \Pimcore\Model\Element\ValidationException($stauscodesnew[0], 1234);
  109. }
  110.             if($className == 'attribute' || $className == 'Attribute')
  111.                 {
  112.                     $attCodeNew $foo->getattCode();
  113. $attCode $dataI[0]['attCode'];
  114.                     if($dateTimeCreatedJDA != '')
  115.                     {
  116.                         
  117.                         if($attCode != $attCodeNew)
  118.                         {
  119.                           throw new \Pimcore\Model\Element\ValidationException("You are not authorised to update the Attribute Code. "1234);
  120.                         }
  121.                     }
  122.                 }
  123.  if($className == 'buyer' || $className == 'Buyer')
  124.                 {
  125.                     $buyerCDNew $foo->getbuyerCD();
  126. $buyerCD $dataI[0]['buyerCD'];
  127.                     if($dateTimeCreatedJDA != '')
  128.                     {
  129.                         
  130.                         if($buyerCD != $buyerCDNew)
  131.                         {
  132.                           throw new \Pimcore\Model\Element\ValidationException("You are not authorised to update the Buyer Code. "1234);
  133.                         }
  134.                     }
  135.                 }
  136. if($className == 'brand' || $className == 'Brand')
  137.                 {
  138.                     $brandCDNew $foo->getbrandCD();
  139. $brandCD $dataI[0]['brandCD'];
  140.                     if($dateTimeCreatedJDA != '')
  141.                     {
  142.                         
  143.                         if($brandCD != $brandCDNew)
  144.                         {
  145.                           throw new \Pimcore\Model\Element\ValidationException("You are not authorised to update the Brand Code. "1234);
  146.                         }
  147.                     }
  148.                 }
  149. if($className == 'color' || $className == 'Color')
  150.                 {
  151.                     $colorCDNew $foo->getcolorCD();
  152. $colorCD $dataI[0]['colorCD'];
  153.                     if($dateTimeCreatedJDA != '')
  154.                     {
  155.                         
  156.                         if($colorCD != $colorCDNew)
  157.                         {
  158.                           throw new \Pimcore\Model\Element\ValidationException("You are not authorised to update the Color Code. "1234);
  159.                         }
  160.                     }
  161.                 }
  162. if($className == 'ExtdClass' || $className == 'extdClass')
  163.                 {
  164.                     $extdClassCDNew $foo->getextdClassCD();
  165. $extdClassCD $dataI[0]['extdClassCD'];
  166.                     if($dateTimeCreatedJDA != '')
  167.                     {
  168.                         
  169.                         if($extdClassCD != $extdClassCDNew)
  170.                         {
  171.                           throw new \Pimcore\Model\Element\ValidationException("You are not authorised to update the Extended Classification Code. "1234);
  172.                         }
  173.                     }
  174.                 }
  175. if($className == 'MasterItemStatus' || $className == 'masterItemStatus')
  176.                 {
  177.                     $itemStatusNew $foo->getitemStatus();
  178. $itemStatus $dataI[0]['itemStatus'];
  179.                     if($dateTimeCreatedJDA != '')
  180.                     {
  181.                         
  182.                         if($itemStatus != $itemStatusNew)
  183.                         {
  184.                           throw new \Pimcore\Model\Element\ValidationException("You are not authorised to update the Item Status. "1234);
  185.                         }
  186.                     }
  187.                 }
  188.                 if($className == 'Season' || $className == 'season')
  189.                 {
  190.                     $seasonCodeNew $foo->getseasonCode();
  191. $seasonCode $dataI[0]['seasonCode'];
  192.                     if($dateTimeCreatedJDA != '')
  193.                     {
  194.                         
  195.                         if($seasonCode != $seasonCodeNew)
  196.                         {
  197.                           throw new \Pimcore\Model\Element\ValidationException("You are not authorised to update the Season Code. "1234);
  198.                         }
  199.                     }
  200.                 }
  201.    if($className == 'Size' || $className == 'size')
  202.                 {
  203.                     $sizeCodeNew $foo->getsizeCode();
  204. $sizeCode $dataI[0]['sizeCode'];
  205.                     if($dateTimeCreatedJDA != '')
  206.                     {
  207.                         
  208.                         if($sizeCode != $sizeCodeNew)
  209.                         {
  210.                           throw new \Pimcore\Model\Element\ValidationException("You are not authorised to update the Size Code. "1234);
  211.                         }
  212.                     }
  213.                 }
  214.                 if($className == 'SKUType' || $className == 'sKUType')
  215.                 {
  216.                     $SKUTypeNew $foo->getSKUType();
  217. $SKUType $dataI[0]['SKUType'];
  218.                     if($dateTimeCreatedJDA != '')
  219.                     {
  220.                         
  221.                         if($SKUType != $SKUTypeNew)
  222.                         {
  223.                           throw new \Pimcore\Model\Element\ValidationException("You are not authorised to update the SKU Type. "1234);
  224.                         }
  225.                     }
  226.                 }
  227.   if($className == 'SubBrand' || $className == 'subBrand')
  228.                 {
  229.                     $subbrandCodeNew $foo->getsubbrandCode();
  230. $subbrandCode $dataI[0]['subbrandCode'];
  231.                     if($dateTimeCreatedJDA != '')
  232.                     {
  233.                         
  234.                         if($subbrandCode != $subbrandCodeNew)
  235.                         {
  236.                           throw new \Pimcore\Model\Element\ValidationException("You are not authorised to update the Subbrand Code. "1234);
  237.                         }
  238.                     }
  239.                 }
  240.  if($className == 'TermCode' || $className == 'termCode')
  241.                 {
  242.                     $paymentTermsCDNew $foo->getpaymentTermsCD();
  243. $paymentTermsCD $dataI[0]['paymentTermsCD'];
  244.                     if($dateTimeCreatedJDA != '')
  245.                     {
  246.                         
  247.                         if($paymentTermsCD != $paymentTermsCDNew)
  248.                         {
  249.                           throw new \Pimcore\Model\Element\ValidationException("You are not authorised to update the Payment Terms Code. "1234);
  250.                         }
  251.                     }
  252.                 }
  253. if($className == 'unitOfMeasure' || $className == 'UnitOfMeasure')
  254.                 {
  255.                     $UMCDNew $foo->getUMCD();
  256. $UMCD $dataI[0]['UMCD'];
  257.                     if($dateTimeCreatedJDA != '')
  258.                     {
  259.                         
  260.                         if($UMCD != $UMCDNew)
  261.                         {
  262.                           throw new \Pimcore\Model\Element\ValidationException("You are not authorised to update the UM Code. "1234);
  263.                         }
  264.                     }
  265.                 }
  266. if($className == 'vendor' || $className == 'Vendor')
  267.                 {
  268.                     $vendorCodeNew $foo->getvendorCode();
  269. $vendorCode $dataI[0]['vendorCode'];
  270.                     if($dateTimeCreatedJDA != '')
  271.                     {
  272.                         
  273.                         if($vendorCode != $vendorCodeNew)
  274.                         {
  275.                           throw new \Pimcore\Model\Element\ValidationException("You are not authorised to update the Vendor Code. "1234);
  276.                         }
  277.                     }
  278.                 }
  279. if($className == 'hierarchy' || $className == 'Hierarchy')
  280.                 {
  281.                     $deptCodeNew $foo->getdeptCode();
  282.                     $subdeptCodeNew $foo->getsubdeptCode();
  283.                     $clCodeNew $foo->getclCode();
  284.                     $subClassCodeNew $foo->getsubClassCode();
  285. $deptCode $dataI[0]['deptCode'];
  286. $subdeptCode $dataI[0]['subdeptCode'];
  287. $clCode $dataI[0]['clCode'];
  288. $subClassCode $dataI[0]['subClassCode'];
  289.                     if($dateTimeCreatedJDA != '')
  290.                     {
  291.                         
  292.                         if($deptCode != $deptCodeNew)
  293.                         {
  294.                           throw new \Pimcore\Model\Element\ValidationException("You are not authorised to update the Department Code. "1234);
  295.                         }
  296.                         if($subdeptCode != $subdeptCodeNew)
  297.                         {
  298.                           throw new \Pimcore\Model\Element\ValidationException("You are not authorised to update the Sub Department Code. "1234);
  299.                         }
  300.                         if($clCode != $clCodeNew)
  301.                         {
  302.                           throw new \Pimcore\Model\Element\ValidationException("You are not authorised to update the Class Code. "1234);
  303.                         }
  304.                         if($subClassCode != $subClassCodeNew)
  305.                         {
  306.                           throw new \Pimcore\Model\Element\ValidationException("You are not authorised to update the Sub Class Code. "1234);
  307.                         }
  308.                     }
  309.                 }
  310.                        if($updateJdaData == "yes")
  311.                         {
  312.                             //validation msg for object in update procedure so object not able to add
  313.                             throw new \Pimcore\Model\Element\ValidationException"This object is currently in process JDA system.Please wait for few minutes. "1234);
  314.                         }
  315.             }
  316.             // for item mater 
  317.             if($claname == 'ItemMaster' || $claname == 'itemMaster' )
  318.             {
  319.  $upcNumber $foo->getupcNumber();
  320.                 $itemDesc =$foo->getitemDesc();
  321.                 $styleNum =$foo->getstyleNum();
  322.                 $mfrNum =$foo->getmfrNum();
  323.                 $vendorPartNum =$foo->getvendorPartNum();
  324.                 $innerPack =$foo->getinnerPack();
  325.                 $casePack $foo->getcasePack();
  326.                 $dateTimeCreatedJDA $foo->getdateTimeCreatedJDA();
  327.                       if($foo->getSalesInformation())
  328.  {
  329.     if($foo->getSalesInformation()->getsaleInformation())
  330.     {
  331.  $cost $foo->getsalesInformation()->getSaleInformation()->getcost();
  332.    $originalSalePrice $foo->getsalesInformation()->getSaleInformation()->getoriginalSalePrice();
  333.                         //  else
  334.                           //  $cost= 0;
  335. if(ctype_space($cost))
  336. {
  337. throw new \Pimcore\Model\Element\ValidationException("Please remove blank space from cost."1234);     
  338. }
  339. if(ctype_space($originalSalePrice))
  340. {
  341. throw new \Pimcore\Model\Element\ValidationException("Please remove blank space from Original Sale Price."1234);     
  342. }
  343. if(strpos($cost',') !== false){
  344.     throw new \Pimcore\Model\Element\ValidationException("Please remove commas from cost."1234);     
  345. if(strpos($originalSalePrice',') !== false){
  346.   throw new \Pimcore\Model\Element\ValidationException("Please remove commas from Original Sale Price."1234);     
  347.         if(!is_numeric($cost)) {   
  348.  throw new \Pimcore\Model\Element\ValidationException("Please enter the valid cost."1234); 
  349. }
  350.         if(!is_numeric($originalSalePrice)) {   
  351.  throw new \Pimcore\Model\Element\ValidationException("Please enter the valid Original Sale Price."1234); 
  352. }
  353. //                           //  $cost= 0;
  354. //
  355. /* if (!preg_match("/^(?:100|\d{1,2})(?:\.\d{1,2})?$/",$cost)) {
  356.  throw new \Pimcore\Model\Element\ValidationException("Please enter the valid cost.", 1234); 
  357. }
  358. if (!preg_match("/^(?:100|\d{1,2})(?:\.\d{1,2})?$/",$originalSalePrice)) {
  359.  throw new \Pimcore\Model\Element\ValidationException("Please enter the valid Original Sale Price.", 1234); 
  360. } */
  361.   
  362.              if($cost <= 0)
  363.              {
  364.                throw new \Pimcore\Model\Element\ValidationException("Please enter the cost."1234); 
  365.              }
  366.              if($originalSalePrice <= 0)
  367.              {
  368.                throw new \Pimcore\Model\Element\ValidationException("Please enter the originalSalePrice."1234); 
  369.              }
  370.              if($dateTimeCreatedJDA)
  371. {
  372. $subqty11 "select * from object_brick_query_SaleInformation_masterItem where o_id='".$pid."' and fieldname = 'salesInformation'";
  373.                                $subqty12 Db::get()->prepare($subqty11);
  374.                                  $subqty12->execute();
  375.                                $subqty12data =$subqty12->fetchAll();
  376.                                $originalSalePriceDB =  $subqty12data[0]['originalSalePrice'];
  377. // $myObject = DataObject::getById($pid);
  378. // $originalSalePriceDB = $myObject->getsalesInformation()->getSaleInformation()->getoriginalSalePrice();
  379.                                 if($originalSalePriceDB 0)
  380.                                 {
  381. if($originalSalePriceDB != $originalSalePrice)
  382.                                 {
  383.           throw new \Pimcore\Model\Element\ValidationException("You are not authorised to update the originalSalePrice."1234); 
  384.                                     }
  385.                                 }
  386.                                
  387. }
  388.           
  389.     }
  390.       else
  391.       {
  392.          throw new \Pimcore\Model\Element\ValidationException("Please enter the cost."1234);
  393.       }
  394.   }
  395.   else
  396.   {
  397.      throw new \Pimcore\Model\Element\ValidationException("Please enter the cost."1234);
  398.   }
  399. if($upcNumber)
  400. {
  401.     if(!is_numeric($upcNumber)) {
  402.     throw new \Pimcore\Model\Element\ValidationException("UPC number should be numeric."1234);
  403. } else if(strlen($upcNumber) > 18) {
  404.   throw new \Pimcore\Model\Element\ValidationException("UPC number should not be more than 18 digits."1234); 
  405. } else {
  406.     /* Success */
  407. }
  408.  
  409. }
  410.               
  411. if(strlen($itemDesc) > 30) {
  412.   throw new \Pimcore\Model\Element\ValidationException("Item Description should not be more than 30 characters."1234); 
  413. }
  414. if(strlen($styleNum) > 15) {
  415.   throw new \Pimcore\Model\Element\ValidationException("Style number should not be more than 15 characters."1234); 
  416. }
  417. if(strlen($mfrNum) > 15) {
  418.   throw new \Pimcore\Model\Element\ValidationException("Manufacturer number should not be more than 15 characters."1234); 
  419. }
  420. if(strlen($vendorPartNum) > 15) {
  421.   throw new \Pimcore\Model\Element\ValidationException("Vendor Part number should not be more than 15 characters."1234); 
  422. }
  423. if(empty($innerPack)) {
  424.                 throw new \Pimcore\Model\Element\ValidationException("Please enter inner pack."1234);
  425. } else if(!is_numeric($innerPack)) {
  426.     throw new \Pimcore\Model\Element\ValidationException("Inner pack should be numeric."1234);
  427. } else if(strlen($innerPack) > 9) {
  428.   throw new \Pimcore\Model\Element\ValidationException("Inner pack should not be more than 9 digits."1234); 
  429. } else {
  430.     /* Success */
  431. }
  432. if(empty($casePack)) {
  433.                 throw new \Pimcore\Model\Element\ValidationException("Please enter case pack."1234);
  434. } else if(!is_numeric($casePack)) {
  435.     throw new \Pimcore\Model\Element\ValidationException("Case pack should be numeric."1234);
  436. } else if(strlen($casePack) > 9) {
  437.   throw new \Pimcore\Model\Element\ValidationException("Case pack should not be more than 9 digits."1234); 
  438. } else {
  439.     /* Success */
  440. }
  441.                 $statusCodeDetails=$foo->getstatusCode();
  442.                 $skuTypeDetails=$foo->getskuType();
  443.                 $vendorDetails=$foo->getvendorDetails();
  444.                 $brandDetails=$foo->getbrandDetails();
  445.                 $subbrandDetails=$foo->getsubbrandDetails();
  446.                 $buyerDetails=$foo->getbuyerDetails();
  447.                 $seasonDetails=$foo->getseasonDetails();
  448.                 $colorDetails=$foo->getcolorDetails();
  449.                 $sizeDetails=$foo->getsizeDetails();
  450.                 $hierarchyDetails=$foo->gethierarchyDetails();
  451.                 $extdClassification=$foo->getextdClassification();
  452.                 $attDetails1=$foo->getattDetails1();
  453.                 $attDetails2=$foo->getattDetails2();
  454.                 $attDetails3=$foo->getattDetails3();
  455.                 $attDetails4=$foo->getattDetails4();
  456.                 $attDetails5=$foo->getattDetails5();
  457.                 $buyUMCDDetails=$foo->getbuyUMCD();
  458.                 $sellUMCDDetails=$foo->getsellUMCD();
  459.                 $totalStatusCodeDetails count($statusCodeDetails);
  460.                 $totalSkuTypeDetails count($skuTypeDetails);
  461.                 $totalVendorDetails count($vendorDetails);
  462.                 $totalBrandDetails count($brandDetails);
  463.                 $totalSubbrandDetails count($subbrandDetails);
  464.                 $totalSeasonDetails count($seasonDetails);
  465.                 $totalBuyerDetails count($buyerDetails); 
  466.                 $totalColorDetails count($colorDetails);
  467.                 $totalSizeDetails count($sizeDetails); 
  468.                 $totalHierarchyDetails count($hierarchyDetails);
  469.                 $totalextdClassification count($extdClassification); 
  470.                 $totalattDetails1 count($attDetails1);
  471.                 $totalattDetails2 count($attDetails2); 
  472.                 $totalattDetails3 count($attDetails3);
  473.                 $totalattDetails4 count($attDetails4);
  474.                 $totalattDetails5 count($attDetails5); 
  475.  $totalbuyUMCDDetails count($buyUMCDDetails);
  476.                 $totalsellUMCDDetails count($sellUMCDDetails); 
  477.             //     if($totalattDetails1 < 1)
  478.             //     {
  479.             // throw new \Pimcore\Model\Element\ValidationException("Please select Attribute Details 1.", 1234);
  480.             //     }
  481.             //      if($totalattDetails2 < 1)
  482.             //     {
  483.             // throw new \Pimcore\Model\Element\ValidationException("Please select Attribute Details 2.", 1234);
  484.             //     }
  485.             //      if($totalattDetails3 < 1)
  486.             //     {
  487.             // throw new \Pimcore\Model\Element\ValidationException("Please select Attribute Details 3.", 1234);
  488.             //     }
  489.             //      if($totalattDetails4 < 1)
  490.             //     {
  491.             // throw new \Pimcore\Model\Element\ValidationException("Please select Attribute Details 4.", 1234);
  492.             //     }
  493.             //      if($totalattDetails5 < 1)
  494.             //     {
  495.             // throw new \Pimcore\Model\Element\ValidationException("Please select Attribute Details 5.", 1234);
  496.             //     }
  497.                 if($totalHierarchyDetails 1)
  498.                 {
  499.             throw new \Pimcore\Model\Element\ValidationException("Please select Hierarchy Details."1234);
  500.                 }
  501. if($totalBuyerDetails 1)
  502.                 {
  503.             throw new \Pimcore\Model\Element\ValidationException("Please select buyer Details."1234);
  504.                 }
  505.                 if($totalBrandDetails 1)
  506.                 {
  507.             throw new \Pimcore\Model\Element\ValidationException("Please select brand Details."1234);
  508.                 }
  509.                 if($totalVendorDetails 1)
  510.                 {
  511.             throw new \Pimcore\Model\Element\ValidationException("Please select vendor Details."1234);
  512.                 }
  513.  if($totalStatusCodeDetails 1)
  514.                 {
  515.             throw new \Pimcore\Model\Element\ValidationException("Please select status code Details."1234);
  516.                 }
  517.                  if($totalSkuTypeDetails 1)
  518.                 {
  519.             throw new \Pimcore\Model\Element\ValidationException("Please select sku type  Details."1234);
  520.                 }
  521.                  if($totalVendorDetails 1)
  522.                 {
  523.             throw new \Pimcore\Model\Element\ValidationException("Please select vendor Details."1234);
  524.                 }
  525.                  if($totalbuyUMCDDetails 1)
  526.                 {
  527.             throw new \Pimcore\Model\Element\ValidationException("Please select Buy UM Code  Details."1234);
  528.                 }
  529.                  if($totalsellUMCDDetails 1)
  530.                 {
  531.             throw new \Pimcore\Model\Element\ValidationException("Please select Sell UM Code Details."1234);
  532.                 }
  533.                 
  534.                
  535.                  if($totalStatusCodeDetails 0)
  536.                 {     
  537.                     $i=1;
  538.                     foreach ($statusCodeDetails as $statusCodeList
  539.                     {
  540.                         $vId=$statusCodeList->getId();
  541.                         $deleteReuest=$statusCodeList->getdeleteRequest();
  542.                         $createdJdaDate=$statusCodeList->getdateTimeCreatedJDA();
  543.                         $updateJdaData=$statusCodeList->getInJDAProcess();
  544.                         $publishData=$statusCodeList->getPublished(true);
  545.                         if($publishData == 0)
  546.                         {
  547.                             //validation msg for unpublished object
  548.                             throw new \Pimcore\Model\Element\ValidationException("Please select valid records for status sku."1234);
  549.                         }
  550.                         elseif($updateJdaData == "yes")
  551.                         {
  552.                             //validation msg for object in update procedure so object not able to add
  553.                             throw new \Pimcore\Model\Element\ValidationException("Please select valid records for status sku."1234);
  554.                         }
  555.                         elseif($deleteReuest == true)
  556.                         {
  557.                             //validation msg for delete request object
  558.                             //validation msg for delete request object
  559.                             throw new \Pimcore\Model\Element\ValidationException("Please select valid records for status sku"1234);
  560.                         }
  561.                         elseif ($createdJdaDate == Null
  562.                         {
  563.                              //validation msg for not created jda object
  564.                             throw new \Pimcore\Model\Element\ValidationException("Please select valid records for status code details."1234);
  565.                         }
  566.                         $i++;
  567.                         //$myObject = DataObject\Myclassname::getById($vId);
  568.                     }
  569.                 }
  570.                  if($totalSkuTypeDetails 0)
  571.                 {     
  572.                     $i=1;
  573.                     foreach ($skuTypeDetails as $skuTypeList
  574.                     {
  575.                         $vId=$skuTypeList->getId();
  576.                         $deleteReuest=$skuTypeList->getdeleteRequest();
  577.                         $createdJdaDate=$skuTypeList->getdateTimeCreatedJDA();
  578.                         $updateJdaData=$skuTypeList->getInJDAProcess();
  579.                         $publishData=$skuTypeList->getPublished(true);
  580.                         if($publishData == 0)
  581.                         {
  582.                            //validation msg for unpublished object
  583.                             throw new \Pimcore\Model\Element\ValidationException("Please select valid records for sku type."1234);
  584.                         }
  585.                         elseif($updateJdaData == "yes")
  586.                         {
  587.                             //validation msg for object in update procedure so object not able to add
  588.                             throw new \Pimcore\Model\Element\ValidationException("Please select valid records for sku type."1234);
  589.                         }
  590.                         elseif($deleteReuest == true)
  591.                         {
  592.                             //validation msg for delete request object
  593.                             throw new \Pimcore\Model\Element\ValidationException("Please select valid records for sku type"1234);
  594.                         }
  595.                         elseif ($createdJdaDate == Null
  596.                         {
  597.                              //validation msg for not created jda object
  598.                             throw new \Pimcore\Model\Element\ValidationException("Please select valid records for sku type details."1234);
  599.                         }
  600.                         $i++;
  601.                         //$myObject = DataObject\Myclassname::getById($vId);
  602.                     }
  603.                 }
  604.                 // vendor details
  605.                 if($totalVendorDetails 0)
  606.                 {     
  607.                     $i=1;
  608.                     foreach ($vendorDetails as $vendorList
  609.                     {
  610.                         $vId=$vendorList->getId();
  611.                         $deleteReuest=$vendorList->getdeleteRequest();
  612.                         $createdJdaDate=$vendorList->getdateTimeCreatedJDA();
  613.                         $updateJdaData=$vendorList->getInJDAProcess();
  614.                         $publishData=$vendorList->getPublished(true);
  615.                         if($publishData == 0)
  616.                         {
  617.                             //validation msg for unpublished object
  618.                             throw new \Pimcore\Model\Element\ValidationException("Please select valid records for vendor details."1234);
  619.                         }
  620.                         elseif($updateJdaData == "yes")
  621.                         {
  622.                             //validation msg for object in update procedure so object not able to add
  623.                             throw new \Pimcore\Model\Element\ValidationException("Please select valid records for vendor details."1234);
  624.                         }
  625.                         elseif($deleteReuest == true)
  626.                         {
  627.                             //validation msg for delete request object
  628.                             throw new \Pimcore\Model\Element\ValidationException("Please select valid records for vendor details."1234);
  629.                         }
  630.                         elseif ($createdJdaDate == Null
  631.                         {
  632.                             //validation msg for not created jda object
  633.                             throw new \Pimcore\Model\Element\ValidationException("Please select valid records for vendor details."1234);
  634.                         }
  635.                         $i++;
  636.                         //$myObject = DataObject\Myclassname::getById($vId);
  637.                     }
  638.                 }
  639.                 if($totalBrandDetails 0
  640.                 {
  641.                    $i=1;
  642.                     foreach ($brandDetails as $brandList
  643.                     {
  644.                         $brId=$brandList->getId();
  645.                         $deleteReuest=$brandList->getdeleteRequest();
  646.                         $createdJdaDate=$brandList->getdateTimeCreatedJDA();
  647.                         $updateJdaData=$brandList->getInJDAProcess();
  648.                         $publishData=$brandList->getPublished(true);
  649.                         if($publishData == 0)
  650.                         {
  651.                             //validation msg for unpublished object 
  652.                             //echo "yes";
  653.                             throw new \Pimcore\Model\Element\ValidationException("Please select valid records for brand details."1234);
  654.                         }
  655.                         elseif($updateJdaData == "yes")
  656.                         {
  657.                             //validation msg for object in update procedure so object not able to add
  658.                             throw new \Pimcore\Model\Element\ValidationException("Please select valid records for brand details."1234);
  659.                         }
  660.                         elseif($deleteReuest == true)
  661.                         {
  662.                             //validation msg for delete request object
  663.                             throw new \Pimcore\Model\Element\ValidationException("Please select valid records for brand details."1234);
  664.                         }
  665.                         elseif ($createdJdaDate == Null
  666.                         {
  667.                             //validation msg for not created jda object
  668.                             throw new \Pimcore\Model\Element\ValidationException("Please select valid records for brand details."1234);
  669.                         }
  670.                         $i++;
  671.                         //$myObject = DataObject\Myclassname::getById($vId);
  672.                     }
  673.                 }
  674.                 if($totalSubbrandDetails 0
  675.                 {
  676.                    $i=1;
  677.                     foreach ($subbrandDetails as $subbrandList
  678.                     {
  679.                         $subId=$subbrandList->getId();
  680.                         $deleteReuest=$subbrandList->getdeleteRequest();
  681.                         $createdJdaDate=$subbrandList->getdateTimeCreatedJDA();
  682.                         $updateJdaData=$subbrandList->getInJDAProcess();
  683.                         $publishData=$subbrandList->getPublished(true);
  684.                         if($publishData == 0)
  685.                         {
  686.                             //validation msg for unpublished object 
  687.                             //echo "yes";
  688.                             throw new \Pimcore\Model\Element\ValidationException("Please select valid records for subbrand details."1234);
  689.                         }
  690.                         elseif($updateJdaData == "yes")
  691.                         {
  692.                             //validation msg for object in update procedure so object not able to add
  693.                             throw new \Pimcore\Model\Element\ValidationException("Please select valid records for subbrand details."1234);
  694.                         }
  695.                         elseif($deleteReuest == true)
  696.                         {
  697.                             //validation msg for delete request object
  698.                             throw new \Pimcore\Model\Element\ValidationException("Please select valid records for subbrand details."1234);
  699.                         }
  700.                         elseif($createdJdaDate == Null
  701.                         {
  702.                             //validation msg for not created jda object
  703.                             throw new \Pimcore\Model\Element\ValidationException("Please select valid records for subbrand details."1234);
  704.                         }
  705.                         $i++;
  706.                         //$myObject = DataObject\Myclassname::getById($vId);
  707.                     }
  708.                 }
  709.                 if($totalBuyerDetails 0
  710.                 {
  711.                    $i=1;
  712.                     foreach ($buyerDetails as $buyerList
  713.                     {
  714.                         $buId=$buyerList->getId();
  715.                         $deleteReuest=$buyerList->getdeleteRequest();
  716.                         $createdJdaDate=$buyerList->getdateTimeCreatedJDA();
  717.                         $updateJdaData=$buyerList->getInJDAProcess();
  718.                         $publishData=$buyerList->getPublished(true);
  719.                         if($publishData == 0)
  720.                         {
  721.                             //validation msg for unpublished object 
  722.                             //echo "yes";
  723.                             throw new \Pimcore\Model\Element\ValidationException("Please select valid records for buyer details."1234);
  724.                         }
  725.                         elseif($updateJdaData == "yes")
  726.                         {
  727.                             //validation msg for object in update procedure so object not able to add
  728.                             throw new \Pimcore\Model\Element\ValidationException("Please select valid records for buyer details."1234);
  729.                         }
  730.                         else if($deleteReuest == true)
  731.                         {
  732.                             //validation msg for delete request object
  733.                             throw new \Pimcore\Model\Element\ValidationException("Please select valid records for buyer details."1234);
  734.                         }
  735.                         elseif($createdJdaDate == Null
  736.                         {
  737.                             //validation msg for not created jda object
  738.                             throw new \Pimcore\Model\Element\ValidationException("Please select valid records for buyer details."1234);
  739.                         }
  740.                         $i++;
  741.                         //$myObject = DataObject\Myclassname::getById($buId);
  742.                     }
  743.                 }
  744.                 if($totalSeasonDetails 0
  745.                 {
  746.                    $i=1;
  747.                     foreach ($seasonDetails as $seaList
  748.                     {
  749.                         $seaId=$seaList->getId();
  750.                         $deleteReuest=$seaList->getdeleteRequest();
  751.                         $createdJdaDate=$seaList->getdateTimeCreatedJDA();
  752.                         $updateJdaData=$seaList->getInJDAProcess();
  753.                         $publishData=$buyerList->getPublished(true);
  754.                         if($publishData == 0)
  755.                         {
  756.                             //validation msg for unpublished object 
  757.                             //echo "yes";
  758.                             throw new \Pimcore\Model\Element\ValidationException("Please select valid records for season details."1234);
  759.                         }
  760.                          elseif($updateJdaData == "yes")
  761.                         {
  762.                             //validation msg for object in update procedure so object not able to add
  763.                             throw new \Pimcore\Model\Element\ValidationException("Please select valid records for season details."1234);
  764.                         }
  765.                         elseif($deleteReuest == true)
  766.                         {
  767.                             //validation msg for delete request object
  768.                             throw new \Pimcore\Model\Element\ValidationException("Please select valid records for season details."1234);
  769.                         }
  770.                         elseif ($createdJdaDate == Null
  771.                         {
  772.                             //validation msg for not created jda object
  773.                             throw new \Pimcore\Model\Element\ValidationException("Please select valid records for season details."1234);
  774.                         }
  775.                         $i++;
  776.                         //$myObject = DataObject\Myclassname::getById($buId);
  777.                     }
  778.                 }
  779.                 if($totalColorDetails 0
  780.                 {
  781.                    $i=1;
  782.                     foreach ($colorDetails as $colorList
  783.                     {
  784.                         $colId=$colorList->getId();
  785.                         $deleteReuest=$colorList->getdeleteRequest();
  786.                         $createdJdaDate=$colorList->getdateTimeCreatedJDA();
  787.                         $updateJdaData=$colorList->getInJDAProcess();
  788.                         $publishData=$colorList->getPublished(true);
  789.                         if($publishData == 0)
  790.                         {
  791.                             //validation msg for unpublished object 
  792.                             //echo "yes";
  793.                             throw new \Pimcore\Model\Element\ValidationException("Please select valid records for color details."1234);
  794.                         }
  795.                         elseif($updateJdaData == "yes")
  796.                         {
  797.                             //validation msg for object in update procedure so object not able to add
  798.                             throw new \Pimcore\Model\Element\ValidationException("Please select valid records for color details."1234);
  799.                         }
  800.                         elseif($deleteReuest == true)
  801.                         {
  802.                             //validation msg for delete request object
  803.                             throw new \Pimcore\Model\Element\ValidationException("Please select valid records for color details."1234);
  804.                         }
  805.                         elseif ($createdJdaDate == Null
  806.                         {
  807.                             //validation msg for not created jda object
  808.                             throw new \Pimcore\Model\Element\ValidationException("Please select valid records for color details."1234);
  809.                         }
  810.                         $i++;
  811.                         //$myObject = DataObject\Myclassname::getById($vId);
  812.                     }
  813.                 }
  814.                 if($totalSizeDetails 0
  815.                 {
  816.                    $i=1;
  817.                     foreach ($sizeDetails as $sizeList
  818.                     {
  819.                         $siId=$sizeList->getId();
  820.                         $deleteReuest=$sizeList->getdeleteRequest();
  821.                         $createdJdaDate=$sizeList->getdateTimeCreatedJDA();
  822.                         $updateJdaData=$sizeList->getInJDAProcess();
  823.                         $publishData=$sizeList->getPublished(true);
  824.                         if($publishData == 0)
  825.                         {
  826.                             //validation msg for unpublished object 
  827.                             //echo "yes";
  828.                             throw new \Pimcore\Model\Element\ValidationException("Please select valid records for size details."1234);
  829.                         }
  830.                          elseif($updateJdaData == "yes")
  831.                         {
  832.                             //validation msg for object in update procedure so object not able to add
  833.                             throw new \Pimcore\Model\Element\ValidationException("Please select valid records for size details."1234);
  834.                         }
  835.                         elseif($deleteReuest == true)
  836.                         {
  837.                             //validation msg for delete request object
  838.                             throw new \Pimcore\Model\Element\ValidationException("Please select valid records for size details."1234);
  839.                         }
  840.                         elseif($createdJdaDate == Null
  841.                         {
  842.                             //validation msg for not created jda object
  843.                             throw new \Pimcore\Model\Element\ValidationException("Please select valid records for size details."1234);
  844.                         }
  845.                         $i++;
  846.                         //$myObject = DataObject\Myclassname::getById($vId);
  847.                     }
  848.                 }
  849.                 //
  850.                 if($totalextdClassification 0
  851.                 {
  852.                    $i=1;
  853.                     foreach ($extdClassification as $List
  854.                     {
  855.                         $extId=$List->getId();
  856.                         $deleteReuest=$List->getdeleteRequest();
  857.                         $createdJdaDate=$List->getdateTimeCreatedJDA();
  858.                         $updateJdaData=$List->getInJDAProcess();
  859.                         $publishData=$List->getPublished(true);
  860.                         if($publishData == 0)
  861.                         {
  862.                             //validation msg for unpublished object 
  863.                             //echo "yes";
  864.                             throw new \Pimcore\Model\Element\ValidationException("Please select valid records for extened classification details."1234);
  865.                         }
  866.                         elseif($updateJdaData == "yes")
  867.                         {
  868.                             //validation msg for object in update procedure so object not able to add
  869.                             throw new \Pimcore\Model\Element\ValidationException("Please select valid records for extened classification details."1234);
  870.                         }
  871.                         elseif($deleteReuest == true)
  872.                         {
  873.                             throw new \Pimcore\Model\Element\ValidationException("Please select valid records for extened classification details."1234);
  874.                         }
  875.                         elseif($createdJdaDate == Null
  876.                         {
  877.                             //validation msg for not created jda object
  878.                             throw new \Pimcore\Model\Element\ValidationException("Please select valid records for extened classification details."1234);
  879.                         }
  880.                         $i++;
  881.                         //$myObject = DataObject\Myclassname::getById($vId);
  882.                     }
  883.                 }
  884.                 if($totalattDetails1 0
  885.                 {
  886.                    $i=1;
  887.                     foreach ($attDetails1 as $attrOneList
  888.                     {
  889.                         $att1Id=$attrOneList->getId();
  890.                         $deleteReuest=$attrOneList->getdeleteRequest();
  891.                         $createdJdaDate=$attrOneList->getdateTimeCreatedJDA();
  892.                         $updateJdaData=$attrOneList->getInJDAProcess();
  893.                         $attr1=$attrOneList->getattNum();
  894.                         $publishData=$attrOneList->getPublished(true);
  895.                         if($attr1 != 'IATRB1')
  896.                         {
  897.                             //echo "yes";
  898.                             throw new \Pimcore\Model\Element\ValidationException("Please select valid records for attribute 1 details."1234);
  899.                         }
  900.                         elseif($publishData == 0)
  901.                         {
  902.                             //validation msg for unpublished object 
  903.                             throw new \Pimcore\Model\Element\ValidationException("Please select valid records for attribute 1."1234);
  904.                         }
  905.                          elseif($updateJdaData == "yes")
  906.                         {
  907.                             //validation msg for object in update procedure so object not able to add
  908.                             throw new \Pimcore\Model\Element\ValidationException("Please select valid records for attribute 1."1234);
  909.                         }
  910.                         elseif($deleteReuest == true)
  911.                         {
  912.                             //validation msg for delete request object
  913.                             throw new \Pimcore\Model\Element\ValidationException("Please select valid records for attribute 1 details."1234);
  914.                         }
  915.                         elseif ($createdJdaDate == Null
  916.                         {
  917.                             //validation msg for not created jda object
  918.                             throw new \Pimcore\Model\Element\ValidationException("Please select valid records for attribute 1 details."1234);
  919.                         }
  920.                         $i++;
  921.                         //$myObject = DataObject\Myclassname::getById($vId);
  922.                     }
  923.                 }
  924.                 if($totalattDetails2 0
  925.                 {
  926.                    $i=1;
  927.                     foreach ($attDetails2 as $attTwoList
  928.                     {
  929.                         $att2Id=$attTwoList->getId();
  930.                         $deleteReuest=$attTwoList->getdeleteRequest();
  931.                         $createdJdaDate=$attTwoList->getdateTimeCreatedJDA();
  932.                         $updateJdaData=$attTwoList->getInJDAProcess();
  933.                         $attr2=$attTwoList->getattNum();
  934.                         $publishData=$attTwoList->getPublished(true);
  935.                         if($attr2 != 'IATRB2')
  936.                         {
  937.                             //echo "yes";
  938.                             throw new \Pimcore\Model\Element\ValidationException("Please select valid records for attribute 2 details."1234);
  939.                         }
  940.                         elseif($publishData == 0)
  941.                         {
  942.                             //validation msg for unpublished object 
  943.                             throw new \Pimcore\Model\Element\ValidationException("Please select valid records for attribute 2."1234);
  944.                         }
  945.                         elseif($updateJdaData == "yes")
  946.                         {
  947.                             //validation msg for object in update procedure so object not able to add
  948.                             throw new \Pimcore\Model\Element\ValidationException("Please select valid records for attribute 2."1234);
  949.                         }
  950.                         elseif($deleteReuest == true)
  951.                         {
  952.                             //validation msg for delete request object
  953.                             throw new \Pimcore\Model\Element\ValidationException("Please select valid records for attribute 2 details."1234);
  954.                         }
  955.                         elseif ($createdJdaDate == Null
  956.                         {
  957.                             //validation msg for not created jda object
  958.                             throw new \Pimcore\Model\Element\ValidationException("Please select valid records for attribute 2 details."1234);
  959.                         }
  960.                         $i++;
  961.                         //$myObject = DataObject\Myclassname::getById($vId);
  962.                     }
  963.                 }
  964.                 if($totalattDetails3 0
  965.                 {
  966.                    $i=1;
  967.                     foreach ($attDetails3 as $attThreeList
  968.                     {
  969.                         $att3Id=$attThreeList->getId();
  970.                         $deleteReuest=$attThreeList->getdeleteRequest();
  971.                         $createdJdaDate=$attThreeList->getdateTimeCreatedJDA();
  972.                         $updateJdaData=$attThreeList->getInJDAProcess();
  973.                         $attr3=$attThreeList->getattNum();
  974.                         $publishData=$attThreeList->getPublished(true);
  975.                         if($attr3 != 'IATRB3')
  976.                         {
  977.                             //echo "yes";
  978.                             throw new \Pimcore\Model\Element\ValidationException("Please select valid records for attribute 3 details."1234);
  979.                         }
  980.                         elseif($publishData == 0)
  981.                         {
  982.                             //validation msg for unpublished object 
  983.                             throw new \Pimcore\Model\Element\ValidationException("Please select valid records for attribute 3."1234);
  984.                         }
  985.                          elseif($updateJdaData == "yes")
  986.                         {
  987.                             //validation msg for object in update procedure so object not able to add
  988.                             throw new \Pimcore\Model\Element\ValidationException("Please select valid records for attribute 3."1234);
  989.                         }
  990.                         elseif($deleteReuest == true)
  991.                         {
  992.                             //validation msg for delete request object
  993.                            throw new \Pimcore\Model\Element\ValidationException("Please select valid records for attribute 3 details."1234);
  994.                         }
  995.                         elseif ($createdJdaDate == Null
  996.                         {
  997.                             //validation msg for not created jda object
  998.                             throw new \Pimcore\Model\Element\ValidationException("Please select valid records for attribute 3 details."1234);
  999.                         }
  1000.                         $i++;
  1001.                         //$myObject = DataObject\Myclassname::getById($vId);
  1002.                     }
  1003.                 }
  1004.                 if($totalattDetails4 0
  1005.                 {
  1006.                    $i=1;
  1007.                     foreach ($attDetails4 as $attFourList
  1008.                     {
  1009.                         $att4Id=$attFourList->getId();
  1010.                         $deleteReuest=$attFourList->getdeleteRequest();
  1011.                         $createdJdaDate=$attFourList->getdateTimeCreatedJDA();
  1012.                         $updateJdaData=$attFourList->getInJDAProcess();
  1013.                         $attr4=$attFourList->getattNum();
  1014.                         $publishData=$attFourList->getPublished(true);
  1015.                         if($attr4 != 'IATRB4')
  1016.                         {
  1017.                             //echo "yes";
  1018.                             throw new \Pimcore\Model\Element\ValidationException("Please select valid records for attribute 4 details."1234);
  1019.                         }
  1020.                         elseif($publishData == 0)
  1021.                         {
  1022.                             //validation msg for unpublished object 
  1023.                             throw new \Pimcore\Model\Element\ValidationException("Please select valid records for attribute 4."1234);
  1024.                         }
  1025.                          elseif($updateJdaData == "yes")
  1026.                         {
  1027.                             //validation msg for object in update procedure so object not able to add
  1028.                             throw new \Pimcore\Model\Element\ValidationException("Please select valid records for sku type."1234);
  1029.                         }
  1030.                         elseif($deleteReuest == true)
  1031.                         {
  1032.                             //validation msg for delete request object
  1033.                             throw new \Pimcore\Model\Element\ValidationException("Please select valid records for attribute 4 details."1234);
  1034.                         }
  1035.                         elseif ($createdJdaDate == Null
  1036.                         {
  1037.                             //validation msg for not created jda object
  1038.                             throw new \Pimcore\Model\Element\ValidationException("Please select valid records for attribute 4 details."1234);
  1039.                         }
  1040.                         $i++;
  1041.                         //$myObject = DataObject\Myclassname::getById($vId);
  1042.                     }
  1043.                 }
  1044.                 if($totalattDetails5 0
  1045.                 {
  1046.                    $i=1;
  1047.                     foreach ($attDetails5 as $attFiveList
  1048.                     {
  1049.                         $att5Id=$attFiveList->getId();
  1050.                         $deleteReuest=$attFiveList->getdeleteRequest();
  1051.                         $createdJdaDate=$attFiveList->getdateTimeCreatedJDA();
  1052.                         $updateJdaData=$attFiveList->getInJDAProcess();
  1053.                         $attr5=$attFiveList->getattNum();
  1054.                         $publishData=$attFiveList->getPublished(true);
  1055.                         if($attr5 != 'IATRB5')
  1056.                         {
  1057.                             //echo "yes";
  1058.                             throw new \Pimcore\Model\Element\ValidationException("Please select valid records for attribute 5 details."1234);
  1059.                         }
  1060.                         elseif($publishData == 0)
  1061.                         {
  1062.                             //validation msg for unpublished object 
  1063.                             throw new \Pimcore\Model\Element\ValidationException("Please select valid records for attribute 5."1234);
  1064.                         }
  1065.                          elseif($updateJdaData == "yes")
  1066.                         {
  1067.                             //validation msg for object in update procedure so object not able to add
  1068.                             throw new \Pimcore\Model\Element\ValidationException("Please select valid records for attribute 5."1234);
  1069.                         }
  1070.                         elseif($deleteReuest == true)
  1071.                         {
  1072.                             //validation msg for delete request object
  1073.                             throw new \Pimcore\Model\Element\ValidationException("Please select valid records for attribute 5 details."1234);
  1074.                         }
  1075.                         elseif ($createdJdaDate == Null
  1076.                         {
  1077.                             //validation msg for not created jda object
  1078.                             throw new \Pimcore\Model\Element\ValidationException("Please select valid records for attribute 5 details."1234);
  1079.                         }
  1080.                         $i++;
  1081.                         //$myObject = DataObject\Myclassname::getById($vId);
  1082.                     }
  1083.                 }
  1084.                 if($totalbuyUMCDDetails 0
  1085.                 {
  1086.                    $i=1;
  1087.                     foreach ($buyUMCDDetails as $buyCodeList
  1088.                     {
  1089.                         $att5Id=$buyCodeList->getId();
  1090.                         $deleteReuest=$buyCodeList->getdeleteRequest();
  1091.                         $createdJdaDate=$buyCodeList->getdateTimeCreatedJDA();
  1092.                         $updateJdaData=$buyCodeList->getInJDAProcess();
  1093.                         $publishData=$buyCodeList->getPublished(true);
  1094.                         if($publishData == 0)
  1095.                         {
  1096.                             //validation msg for unpublished object 
  1097.                             //echo "yes";
  1098.                             throw new \Pimcore\Model\Element\ValidationException("Please select valid records for buy umcd details."1234);
  1099.                         }
  1100.                          elseif($updateJdaData == "yes")
  1101.                         {
  1102.                             //validation msg for object in update procedure so object not able to add
  1103.                             throw new \Pimcore\Model\Element\ValidationException("Please select valid records for buy umcd details."1234);
  1104.                         }
  1105.                         elseif($deleteReuest == true)
  1106.                         {
  1107.                             //validation msg for delete request object
  1108.                             throw new \Pimcore\Model\Element\ValidationException("Please select valid records for buy umcd details."1234);
  1109.                         }
  1110.                         elseif ($createdJdaDate == Null
  1111.                         {
  1112.                             //validation msg for not created jda object
  1113.                             throw new \Pimcore\Model\Element\ValidationException("Please select valid records for buy umcd details."1234);
  1114.                         }
  1115.                         $i++;
  1116.                         //$myObject = DataObject\Myclassname::getById($vId);
  1117.                     }
  1118.                 }
  1119.                 if($totalsellUMCDDetails 0
  1120.                 {
  1121.                    $i=1;
  1122.                     foreach ($sellUMCDDetails as $sellCodeList
  1123.                     {
  1124.                         $att5Id=$sellCodeList->getId();
  1125.                         $deleteReuest=$sellCodeList->getdeleteRequest();
  1126.                         $createdJdaDate=$sellCodeList->getdateTimeCreatedJDA();
  1127.                         $updateJdaData=$sellCodeList->getInJDAProcess();
  1128.                         $publishData=$sellCodeList->getPublished(true);
  1129.                         if($publishData == 0)
  1130.                         {
  1131.                             //validation msg for unpublished object 
  1132.                             //echo "yes";
  1133.                             throw new \Pimcore\Model\Element\ValidationException("Please select valid records for sell umcd details."1234);
  1134.                         }
  1135.                          elseif($updateJdaData == "yes")
  1136.                         {
  1137.                             //validation msg for object in update procedure so object not able to add
  1138.                             throw new \Pimcore\Model\Element\ValidationException("Please select valid records for sell umcd details."1234);
  1139.                         }
  1140.                         elseif($deleteReuest == true)
  1141.                         {
  1142.                             //validation msg for delete request object
  1143.                             throw new \Pimcore\Model\Element\ValidationException("Please select valid records for sell umcd details."1234);
  1144.                         }
  1145.                         elseif ($createdJdaDate == Null
  1146.                         {
  1147.                             //validation msg for not created jda object
  1148.                             throw new \Pimcore\Model\Element\ValidationException("Please select valid records for sell umcd details."1234);
  1149.                         }
  1150.                         $i++;
  1151.                         //$myObject = DataObject\Myclassname::getById($vId);
  1152.                     }
  1153.                 }
  1154.                  if($totalHierarchyDetails 0
  1155.                 {
  1156.                    $i=1;
  1157.                     foreach ($hierarchyDetails as $hierchyList
  1158.                     {
  1159.                         $hieId=$hierchyList->getId();
  1160.                         $deleteReuest=$hierchyList->getdeleteRequest();
  1161.                         $createdJdaDate=$hierchyList->getdateTimeCreatedJDA();
  1162.                         $updateJdaData=$hierchyList->getInJDAProcess();
  1163.                         $subClassCode $hierchyList->getsubClassCode();
  1164.                         $publishData=$hierchyList->getPublished(true);
  1165.                         if($subClassCode == '')
  1166.                         {
  1167.                             //validation msg for unpublished object 
  1168.                             //echo "yes";
  1169.                             throw new \Pimcore\Model\Element\ValidationException("Please select valid records for hierarchy details."1234);
  1170.                         }
  1171.                         if($publishData == 0)
  1172.                         {
  1173.                             //validation msg for unpublished object 
  1174.                             //echo "yes";
  1175.                             throw new \Pimcore\Model\Element\ValidationException("Please select valid records for hierarchy details."1234);
  1176.                         }
  1177.                          elseif($updateJdaData == "yes")
  1178.                         {
  1179.                             //validation msg for object in update procedure so object not able to add
  1180.                             throw new \Pimcore\Model\Element\ValidationException("Please select valid records for hierarchy details."1234);
  1181.                         }
  1182.                         elseif($deleteReuest == true)
  1183.                         {
  1184.                             //validation msg for delete request object
  1185.                             throw new \Pimcore\Model\Element\ValidationException("Please select valid records for hierarchy details."1234);
  1186.                         }
  1187.                         elseif($createdJdaDate == Null
  1188.                         {
  1189.                             //validation msg for not creaed jda object   
  1190.                             throw new \Pimcore\Model\Element\ValidationException("Please select valid records for hierarchy details."1234);
  1191.                         }
  1192.                         $i++;
  1193.                         //$myObject = DataObject\Myclassname::getById($vId);
  1194.                     }
  1195.                 }
  1196.             }      
  1197.            
  1198.             // for vendor class
  1199.             if($claname == 'Vendor' || $claname == 'vendor' )
  1200.             {   
  1201.               $vendorCode $foo->getvendorCode();
  1202.               $vendorName $foo->getvendorName();
  1203.               $addLine1 =$foo->getaddLine1();
  1204.               $addLine2 =$foo->getaddLine2();
  1205.               $addLine3 =$foo->getaddLine3();
  1206.               $city $foo->getcity();
  1207.               $zipCD =$foo->getzipCD();
  1208.               $phoneNum =$foo->getphoneNum();
  1209.               $faxNum =$foo->getfaxNum();
  1210.               $telNum $foo->gettelNum();
  1211.               $contactName =$foo->getcontactName();
  1212.               $email $foo->getemail();
  1213.               $termsCode $foo->gettermsCode();
  1214.               $webAddress $foo->getwebAddress();
  1215.                 $vc is_int($vendorCode);
  1216. //throw new \Pimcore\Model\Element\ValidationException("Vendor code should be numeric 111.", 1234);
  1217.             if(empty($vendorCode)) {
  1218.                 throw new \Pimcore\Model\Element\ValidationException("Please enter vendor code."1234);
  1219. } else if (!filter_var($vendorCodeFILTER_VALIDATE_INT)){
  1220.     throw new \Pimcore\Model\Element\ValidationException("Vendor code should be numeric."1234);
  1221. } else if(strlen($vendorCode) > 6) {
  1222.   throw new \Pimcore\Model\Element\ValidationException("Vendor code should not be more than 6 digits."1234); 
  1223. } else {
  1224.     /* Success */
  1225. }
  1226. if(strlen($vendorName) > 35) {
  1227.   throw new \Pimcore\Model\Element\ValidationException("Vendor name should not be more than 35 characters."1234); 
  1228. }
  1229. if(strlen($addLine1) > 35) {
  1230.   throw new \Pimcore\Model\Element\ValidationException("Address line 1 should not be more than 35 characters."1234); 
  1231. }
  1232. if(strlen($addLine2) > 35) {
  1233.   throw new \Pimcore\Model\Element\ValidationException("Address line 2 should not be more than 35 characters."1234); 
  1234. }
  1235. if(strlen($addLine3) > 35) {
  1236.   throw new \Pimcore\Model\Element\ValidationException("Address line 3 should not be more than 35 characters."1234); 
  1237. }
  1238. if(strlen($city) > 20) {
  1239.   throw new \Pimcore\Model\Element\ValidationException("City should not be more than 20 characters."1234); 
  1240. }
  1241. if(strlen($zipCD) > 10) {
  1242.   throw new \Pimcore\Model\Element\ValidationException("Zip code should not be more than 10 characters."1234); 
  1243. }
  1244. if(strlen($phoneNum) > 18) {
  1245.   throw new \Pimcore\Model\Element\ValidationException("Phione number should not be more than 18 characters."1234); 
  1246. }
  1247. if(strlen($faxNum) > 18) {
  1248.   throw new \Pimcore\Model\Element\ValidationException("Fax number should not be more than 18 characters."1234); 
  1249. }
  1250. if(strlen($telNum) > 18) {
  1251.   throw new \Pimcore\Model\Element\ValidationException("Telex number should not be more than 18 characters."1234); 
  1252. }
  1253. if(strlen($contactName) > 20) {
  1254.   throw new \Pimcore\Model\Element\ValidationException("Contact name should not be more than 20 characters."1234); 
  1255. }
  1256. if(strlen($email) > 40) {
  1257.   throw new \Pimcore\Model\Element\ValidationException("Email should not be more than 40 characters."1234);  
  1258. }
  1259. if(strlen($webAddress) > 40) {
  1260.   throw new \Pimcore\Model\Element\ValidationException("Web Address should not be more than 40 characters."1234); 
  1261. }
  1262.        if(count($termsCode) < 1)
  1263.        {
  1264.         throw new \Pimcore\Model\Element\ValidationException("Please select terms code."1234); 
  1265.        }  
  1266.                 $table "object_relations_masterItem";
  1267.                 $sql "select * from ".$table." where dest_id='".$pid."' and fieldname= 'vendorDetails' ";
  1268.                 $stmt Db::get()->prepare($sql);
  1269.                 $stmt->execute();
  1270.                 $data =$stmt->fetchAll();
  1271.                 $totalrecord count($data);
  1272.                  if($totalrecord 0)
  1273.                 {
  1274.                     $venDelReq $foo->getdeleteRequest();
  1275.                     if($venDelReq == true)
  1276.                     {
  1277.                         throw new \Pimcore\Model\Element\ValidationException("Not perform delete operation for this vendor object."1234);
  1278.                     }
  1279.                 
  1280.                 }
  1281.                 //get term code
  1282.                 $termDetails=$foo->gettermsCode();
  1283.                 $totaltermDetails count($termDetails);
  1284.                 if($totaltermDetails 0)
  1285.                 {     
  1286.                     $i=1;
  1287.                     foreach ($termDetails as $termCodeList
  1288.                     {
  1289.                         $vId=$termCodeList->getId();
  1290.                         $deleteReuest=$termCodeList->getdeleteRequest();
  1291.                         $createdJdaDate=$termCodeList->getdateTimeCreatedJDA();
  1292.                         $updateJdaData=$termCodeList->getInJDAProcess();
  1293.                         $publishData=$termCodeList->getPublished(true);
  1294.                         if($publishData == 0)
  1295.                         {
  1296.                             //validation msg for unpublished object
  1297.                             throw new \Pimcore\Model\Element\ValidationException("Please select valid records for term code."1234);
  1298.                         }
  1299.                         elseif($updateJdaData == "yes")
  1300.                         {
  1301.                             //validation msg for object in update procedure so object not able to add
  1302.                            throw new \Pimcore\Model\Element\ValidationException("Please select valid records for term code."1234);
  1303.                         }
  1304.                         if($deleteReuest == true)
  1305.                         {
  1306.                             //validation msg for deleteReuest object
  1307.                             throw new \Pimcore\Model\Element\ValidationException("Please select valid records for term code."1234);
  1308.                         }
  1309.                         elseif ($createdJdaDate == Null
  1310.                         {
  1311.                             //validation msg for not created jda object
  1312.                             throw new \Pimcore\Model\Element\ValidationException("Please select valid records for term code."1234);
  1313.                         }
  1314.                         $i++;
  1315.                         //$myObject = DataObject\Myclassname::getById($vId);
  1316.                     }
  1317.                 }
  1318.             }
  1319.             // for status code class
  1320.             if($claname == 'MasterItemStatus' || $claname == 'MasterItemStatus' )
  1321.             {  
  1322.               $itemStatus $foo->getitemStatus();
  1323.               $description $foo->getdescription();
  1324.            if(strlen($itemStatus) > 1) {
  1325.   throw new \Pimcore\Model\Element\ValidationException("Item Status should not be more than 1 character."1234); 
  1326. if(strlen($description) > 35) {
  1327.   throw new \Pimcore\Model\Element\ValidationException("Description should not be more than 35 characters."1234); 
  1328.                 $table "object_relations_vendor";
  1329.                 $sql "select * from ".$table." where dest_id='".$pid."' and fieldname= 'statusCode' ";
  1330.                 $stmt Db::get()->prepare($sql);
  1331.                 $stmt->execute();
  1332.                 $data =$stmt->fetchAll();
  1333.                 $totalrecord count($data);
  1334.                 if($totalrecord 0)
  1335.                 {
  1336.                     $termCodeDelete $foo->getdeleteRequest();
  1337.                     if($termCodeDelete == true)
  1338.                     {
  1339.                         throw new \Pimcore\Model\Element\ValidationException("Not perform delete operation for this object."1234);
  1340.                     }
  1341.                 
  1342.                 }
  1343.             }
  1344.              // for SKUType class
  1345.             if($claname == 'SKUType' || $claname == 'sKUType' )
  1346.             {  
  1347.                 $description $foo->getdescription();
  1348.               $SKUType $foo->getSKUType();
  1349.            if(strlen($SKUType) > 2) {
  1350.   throw new \Pimcore\Model\Element\ValidationException("SKU Type  should not be more than 2 characters."1234); 
  1351. if(strlen($description) > 20) {
  1352.   throw new \Pimcore\Model\Element\ValidationException("Description should not be more than 20 characters."1234); 
  1353.                 $table "object_relations_masterItem";
  1354.                 $sql "select * from ".$table." where dest_id='".$pid."' and fieldname= 'skuType' ";
  1355.                 $stmt Db::get()->prepare($sql);
  1356.                 $stmt->execute();
  1357.                 $data =$stmt->fetchAll();
  1358.                 $totalrecord count($data);
  1359.                 if($totalrecord 0)
  1360.                 {
  1361.                     $venDelReq $foo->getdeleteRequest();
  1362.                     if($venDelReq == true)
  1363.                     {
  1364.                         throw new \Pimcore\Model\Element\ValidationException("Not perform delete operation for this skuType object."1234);
  1365.                     }
  1366.                 
  1367.                 }
  1368.             }
  1369.             // for brand class
  1370.             if($claname == 'brand' || $claname == 'Brand' )
  1371.             {    
  1372.             $brandCD $foo->getbrandCD();
  1373.                 $brandName $foo->getbrandName();
  1374.             if(empty($brandCD)) {
  1375.                 throw new \Pimcore\Model\Element\ValidationException("Please enter brand code."1234);
  1376. } else if (!filter_var($brandCDFILTER_VALIDATE_INT)){
  1377.     throw new \Pimcore\Model\Element\ValidationException("Brand code should be numeric."1234);
  1378. } else if(strlen($brandCD) > 6) {
  1379.   throw new \Pimcore\Model\Element\ValidationException("Brand should not be more than 6 digits."1234); 
  1380. } else {
  1381.     /* Success */
  1382. }
  1383. if(empty($brandName)) {
  1384.                 throw new \Pimcore\Model\Element\ValidationException("Please enter brand name."1234);
  1385. }
  1386. else if(strlen($brandName) > 30) {
  1387.   throw new \Pimcore\Model\Element\ValidationException("Brand name should not be more than 30 characters."1234); 
  1388. }
  1389.         
  1390.                 $table "object_relations_masterItem";
  1391.                 $sql "select * from ".$table." where dest_id='".$pid."' and fieldname= 'brandDetails' ";
  1392.                 $stmt Db::get()->prepare($sql);
  1393.                 $stmt->execute();
  1394.                 $data =$stmt->fetchAll();
  1395.                 $totalrecord count($data);
  1396.                 //extend check
  1397.                 $tableExt "object_relations_exclassification";
  1398.                 $sqlExt "select * from ".$tableExt." where dest_id='".$pid."' and fieldname= 'brandCode' ";
  1399.                 $stmtExt Db::get()->prepare($sqlExt);
  1400.                 $stmtExt->execute();
  1401.                 $dataExt =$stmtExt->fetchAll();
  1402.                 $totalrecordExt count($dataExt);
  1403.                 if($totalrecord || $totalrecordExt 0)
  1404.                 {
  1405.                     $venDelReq $foo->getdeleteRequest();
  1406.                     if($venDelReq == true)
  1407.                     {
  1408.                         throw new \Pimcore\Model\Element\ValidationException("Not perform delete operation for this object."1234);
  1409.                     }
  1410.                 
  1411.                 }
  1412.             }
  1413.             // for sunbrand class
  1414.             if($claname == 'SubBrand' || $claname == 'subBrand' )
  1415.             {      
  1416.              $subbrandCode $foo->getsubbrandCode();
  1417.               $subbrandName $foo->getsubbrandName();
  1418.             if(empty($subbrandCode)) {
  1419.                 throw new \Pimcore\Model\Element\ValidationException("Please enter sub brand code."1234);
  1420. } else if (!filter_var($subbrandCodeFILTER_VALIDATE_INT)){
  1421.     throw new \Pimcore\Model\Element\ValidationException("Sub brand code should be numeric."1234);
  1422. } else if(strlen($subbrandCode) > 5) {
  1423.   throw new \Pimcore\Model\Element\ValidationException("Sub brand code should not be more than 5 digits."1234); 
  1424. } else {
  1425.     /* Success */
  1426. }
  1427. if(strlen($subbrandName) > 35) {
  1428.   throw new \Pimcore\Model\Element\ValidationException("Sub brand name should not be more than 35 digits."1234); 
  1429. }
  1430.       
  1431.                 $table "object_relations_masterItem";
  1432.                 $sql "select * from ".$table." where dest_id='".$pid."' and fieldname= 'subbrandDetails' ";
  1433.                 $stmt Db::get()->prepare($sql);
  1434.                 $stmt->execute();
  1435.                 $data =$stmt->fetchAll();
  1436.                 $totalrecord count($data);
  1437.                 if($totalrecord 0)
  1438.                 {
  1439.                     $venDelReq $foo->getdeleteRequest();
  1440.                     if($venDelReq == true)
  1441.                     {
  1442.                         throw new \Pimcore\Model\Element\ValidationException("Not perform delete operation for this object."1234);
  1443.                     }
  1444.                 
  1445.                 }
  1446.             }
  1447.             // for buyer class
  1448.             if($claname == 'Buyer' || $claname == 'buyer' )
  1449.             {  
  1450.              $buyerCD $foo->getbuyerCD();
  1451.              $buyerName $foo->getbuyerName();
  1452.              $telexNum $foo->gettelexNum();
  1453.              $email $foo->getemail();
  1454.             if(empty($buyerCD)) {
  1455.                 throw new \Pimcore\Model\Element\ValidationException("Please enter buyer code."1234);
  1456.             }
  1457. else if(strlen($buyerCD) > 3) {
  1458.   throw new \Pimcore\Model\Element\ValidationException("Buyer code should not be more than 3 characters."1234); 
  1459. } else {
  1460.     /* Success */
  1461. }
  1462. if(empty($buyerName)) {
  1463.                 throw new \Pimcore\Model\Element\ValidationException("Please enter buyer name."1234);
  1464.             }
  1465. else if(strlen($buyerName) > 20) {
  1466.   throw new \Pimcore\Model\Element\ValidationException("Buyer name should not be more than 20 characters."1234); 
  1467. } else {
  1468.     /* Success */
  1469. }
  1470.  if(strlen($email) > 40) {
  1471.   throw new \Pimcore\Model\Element\ValidationException("Email address should not be more than 40 characters."1234); 
  1472. } else {
  1473.     /* Success */
  1474. }
  1475.  if(strlen($telexNum) > 4) {
  1476.   throw new \Pimcore\Model\Element\ValidationException("Telephone Extension Number should not be more than 4 characters."1234); 
  1477. } else {
  1478.     /* Success */
  1479. }
  1480.                 $table "object_relations_masterItem";
  1481.                 $sql "select * from ".$table." where dest_id='".$pid."' and fieldname= 'buyerDetails' ";
  1482.                 $stmt Db::get()->prepare($sql);
  1483.                 $stmt->execute();
  1484.                 $data =$stmt->fetchAll();
  1485.                 $totalrecord count($data);
  1486.                 if($totalrecord 0)
  1487.                 {
  1488.                     $venDelReq $foo->getdeleteRequest();
  1489.                     if($venDelReq == true)
  1490.                     {
  1491.                         throw new \Pimcore\Model\Element\ValidationException("Not perform delete operation for this object."1234);
  1492.                     }
  1493.                 
  1494.                 }
  1495.             }
  1496.             // for season class
  1497.             if($claname == 'season' || $claname == 'Season' )
  1498.             {  
  1499.              $seasonCode $foo->getseasonCode();
  1500.               $description $foo->getdescription();
  1501.            if(strlen($seasonCode) > 3) {
  1502.   throw new \Pimcore\Model\Element\ValidationException("Season code  should not be more than 3 characters."1234); 
  1503. if(strlen($description) > 25) {
  1504.   throw new \Pimcore\Model\Element\ValidationException("Description should not be more than 25 characters."1234); 
  1505.                 $table "object_relations_masterItem";
  1506.                 $sql "select * from ".$table." where dest_id='".$pid."' and fieldname= 'seasonDetails' ";
  1507.                 $stmt Db::get()->prepare($sql);
  1508.                 $stmt->execute();
  1509.                 $data =$stmt->fetchAll();
  1510.                 $totalrecord count($data);
  1511.                 if($totalrecord 0)
  1512.                 {
  1513.                     $venDelReq $foo->getdeleteRequest();
  1514.                     if($venDelReq == true)
  1515.                     {
  1516.                         throw new \Pimcore\Model\Element\ValidationException("Not perform delete operation for this season object."1234);
  1517.                     }
  1518.                 
  1519.                 }
  1520.             }
  1521.             // for color class
  1522.             if($claname == 'color' || $claname == 'Color' )
  1523.             {   
  1524.  $colorCD $foo->getcolorCD();
  1525.  $desc $foo->getdesc();
  1526. $shortDesc $foo->getshortDesc();
  1527. if(empty($colorCD)) {
  1528.                 throw new \Pimcore\Model\Element\ValidationException("Please enter color code."1234);
  1529. } else if (!filter_var($colorCDFILTER_VALIDATE_INT)){
  1530.     throw new \Pimcore\Model\Element\ValidationException("Color code should be numeric."1234);
  1531. } else if(strlen($colorCD) > 4) {
  1532.   throw new \Pimcore\Model\Element\ValidationException("Color code should not be more than 4 digits."1234); 
  1533. } else {
  1534.     /* Success */
  1535. }
  1536. if(strlen($desc) > 25) {
  1537.   throw new \Pimcore\Model\Element\ValidationException("Short description should not be more than 25 characters."1234); 
  1538. }
  1539. if(strlen($shortDesc) > 5) {
  1540.   throw new \Pimcore\Model\Element\ValidationException("Short description should not be more than 5 characters."1234); 
  1541. }
  1542.                 $table "object_relations_masterItem";
  1543.                 $sql "select * from ".$table." where dest_id='".$pid."' and fieldname= 'colorDetails' ";
  1544.                 $stmt Db::get()->prepare($sql);
  1545.                 $stmt->execute();
  1546.                 $data =$stmt->fetchAll();
  1547.                 $totalrecord count($data);
  1548.                 if($totalrecord 0)
  1549.                 {
  1550.                     $venDelReq $foo->getdeleteRequest();
  1551.                     if($venDelReq == true)
  1552.                     {
  1553.                         throw new \Pimcore\Model\Element\ValidationException("Not perform delete operation for this color object."1234);
  1554.                     }
  1555.                 
  1556.                 }
  1557.             }
  1558.              // for size class
  1559.             if($claname == 'size' || $claname == 'Size' )
  1560.             {   
  1561.              $sizeCode $foo->getsizeCode();
  1562.               $description $foo->getdescription();
  1563.               $shortDesc $foo->getshortDesc();
  1564.            if(strlen($sizeCode) > 4) {
  1565.   throw new \Pimcore\Model\Element\ValidationException("Size code  should not be more than 4 characters."1234); 
  1566. if(strlen($description) > 25) {
  1567.   throw new \Pimcore\Model\Element\ValidationException("Description should not be more than 25 characters."1234); 
  1568. if(strlen($shortDesc) > 5) {
  1569.   throw new \Pimcore\Model\Element\ValidationException("Short description should not be more than 5 characters."1234); 
  1570. }
  1571.                 $table "object_relations_masterItem";
  1572.                 $sql "select * from ".$table." where dest_id='".$pid."' and fieldname= 'sizeDetails' ";
  1573.                 $stmt Db::get()->prepare($sql);
  1574.                 $stmt->execute();
  1575.                 $data =$stmt->fetchAll();
  1576.                 $totalrecord count($data);
  1577.                 if($totalrecord 0)
  1578.                 {
  1579.                     $venDelReq $foo->getdeleteRequest();
  1580.                     if($venDelReq == true)
  1581.                     {
  1582.                         throw new \Pimcore\Model\Element\ValidationException("Not perform delete operation for this size object."1234);
  1583.                     }
  1584.                 
  1585.                 }
  1586.             }
  1587.             // for ExtdClass class
  1588.             if($claname == 'ExtdClass' || $claname == 'extdClass' )
  1589.             { 
  1590.  $brandCodeDetails=$foo->getbrandCode();
  1591.             $id=$foo->getId();
  1592.                 $extdClassCD $foo->getextdClassCD();
  1593.                 $brandCode $foo->getbrandCode();
  1594.  $extdClassName $foo->getextdClassName();
  1595. if(empty($extdClassCD)) {
  1596.                 throw new \Pimcore\Model\Element\ValidationException("Please enter Extended Classification Code."1234);
  1597. } else if (!filter_var($extdClassCDFILTER_VALIDATE_INT)){
  1598.     throw new \Pimcore\Model\Element\ValidationException("Extended Classification Code should be numeric."1234);
  1599. } else if(strlen($extdClassCD) > 3) {
  1600.   throw new \Pimcore\Model\Element\ValidationException("Extended Classification Code should not be more than 3 digits."1234); 
  1601. } else {
  1602.     /* Success */
  1603. }
  1604. if(strlen($extdClassName) > 25) {
  1605.   throw new \Pimcore\Model\Element\ValidationException("Extended Classification Name should not be more than 25 characters."1234); 
  1606. }
  1607.            
  1608. if(count($brandCode) < 1)
  1609.        {
  1610.         throw new \Pimcore\Model\Element\ValidationException("Please select brand code."1234); 
  1611.        } 
  1612.                 $table "object_relations_masterItem";
  1613.                 $sql "select * from ".$table." where dest_id='".$pid."' and fieldname= 'extdClassification' ";
  1614.                 $stmt Db::get()->prepare($sql);
  1615.                 $stmt->execute();
  1616.                 $data =$stmt->fetchAll();
  1617.                 $totalrecord count($data);
  1618.                 if($totalrecord 0)
  1619.                 {
  1620.                     $venDelReq $foo->getdeleteRequest();
  1621.                     if($venDelReq == true)
  1622.                     {
  1623.                         throw new \Pimcore\Model\Element\ValidationException("Not perform delete operation for this extended classification object."1234);
  1624.                     }
  1625.                 
  1626.                 }
  1627.                 // brand code check
  1628.                 $brandCodeDetails=$foo->getbrandCode();
  1629.                 $totalbrandCodeDetails count($brandCodeDetails);
  1630.                 if($totalbrandCodeDetails 0)
  1631.                 {     
  1632.                     $i=1;
  1633.                     foreach ($brandCodeDetails as $brandCodeList
  1634.                     {
  1635.                         $vId=$brandCodeList->getId();
  1636.                         $deleteReuest=$brandCodeList->getdeleteRequest();
  1637.                         $createdJdaDate=$brandCodeList->getdateTimeCreatedJDA();
  1638.                         $updateJdaData=$brandCodeList->getInJDAProcess();
  1639.                         $publishData=$brandCodeList->getPublished(true);
  1640.                         if($publishData == 0)
  1641.                         {
  1642.                             //validation msg for unpublished object
  1643.                             throw new \Pimcore\Model\Element\ValidationException("Please select valid records for brand code."1234);
  1644.                         }
  1645.                         elseif($updateJdaData == "yes")
  1646.                         {
  1647.                             //validation msg for object in update procedure so object not able to add
  1648.                             throw new \Pimcore\Model\Element\ValidationException("Please select valid records for brand code."1234);
  1649.                         }
  1650.                         if($deleteReuest == true)
  1651.                         {
  1652.                             //validation msg for deleteReuest object
  1653.                             throw new \Pimcore\Model\Element\ValidationException("Please select valid records for brand code."1234);
  1654.                         }
  1655.                         elseif ($createdJdaDate == Null
  1656.                         {
  1657.                             //validation msg for not created jda object
  1658.                             throw new \Pimcore\Model\Element\ValidationException("Please select valid records for brand code."1234);
  1659.                         }
  1660.                         $i++;
  1661.                         //$myObject = DataObject\Myclassname::getById($vId);
  1662.                     }
  1663.                     //$c $vId
  1664.  //                                            $peObject = new DataObject\ExtdClass\Listing();
  1665.  //                                            $peObject->setCondition("extdClassCD = ? and o_id != :id", [$extdClassCD,$id]);
  1666.  //                                            $peObject->load();
  1667.  //                                            $peId = array();
  1668.  //                                            foreach ($peObject as $entry) {
  1669.  //                                                  $ecId = $entry->getId();
  1670.  //                                                  $ecobjectData = DataObject::getById($ecId);
  1671.  //                                                  $ecbrandCodeDetails=$ecobjectData->getbrandCode();
  1672.  //                                                  $totalecbrandCodeDetails = count($ecbrandCodeDetails);
  1673.  //                                                if($totalecbrandCodeDetails > 0)
  1674.  //                                                {     
  1675.  //                                                    $i=1;
  1676.  //                                                    foreach ($ecbrandCodeDetails as $brandCodeList) 
  1677.  //                                                    {
  1678.  //                                                        $ecvId=$brandCodeList->getId();
  1679.  //                                                        if($vId == $ecvId)
  1680.  //                                                        {
  1681.  // throw new \Pimcore\Model\Element\ValidationException("Extended Classification Code is already exists for Brand 'X'.", 1234);
  1682.  //                                                        }
  1683.  //                                                    }
  1684.  //                                                }
  1685.  //                                              }
  1686.                 }
  1687.             }
  1688.             // for attibute class
  1689.             if($claname == 'Attribute' || $claname == 'attribute' )
  1690.             {
  1691. $attCode $foo->getattCode();
  1692. $description $foo->getdescription();
  1693.             if(empty($attCode)) {
  1694.                 throw new \Pimcore\Model\Element\ValidationException("Please enter attribute code."1234);
  1695. }
  1696. else if(strlen($attCode) > 2) {
  1697.   throw new \Pimcore\Model\Element\ValidationException("Attribute code should not be more than 2 characters."1234); 
  1698. }
  1699.  if(strlen($description) > 35) {
  1700.   throw new \Pimcore\Model\Element\ValidationException("Attribute description should not be more than 35 characters."1234); 
  1701. }
  1702.                 $table "object_relations_masterItem";
  1703.                 $sql "select * from ".$table." where dest_id='".$pid."' and ( fieldname= 'attDetails1' or fieldname= 'attDetails2' or fieldname= 'attDetails3' or fieldname = 'attDetails4' or fieldname= 'attDetails5' ) ";
  1704.                 $stmt Db::get()->prepare($sql);
  1705.                 $stmt->execute();
  1706.                 $data =$stmt->fetchAll();
  1707.                 $totalAtt1 count($data);
  1708.                 if($totalAtt1 0)
  1709.                 {
  1710.                     $venDelReq $foo->getdeleteRequest();
  1711.                     if($venDelReq == true)
  1712.                     {
  1713.                         throw new \Pimcore\Model\Element\ValidationException("Not perform delete operation for this attibute object."1234);
  1714.                     }
  1715.                 
  1716.                 }
  1717.              
  1718.             }
  1719.             // for UnitOfMeasure class
  1720.             if($claname == 'UnitOfMeasure' || $claname == 'UnitOfMeasure' )
  1721.             {   
  1722.             $numSellUnitsBuy $foo->getnumSellUnitsBuy();
  1723.   $description =$foo->getdescription();
  1724.   $UMCD $foo->getUMCD();
  1725.             if(empty($numSellUnitsBuy)) {
  1726.                 throw new \Pimcore\Model\Element\ValidationException("Please enter Number Sell Units Buy."1234);
  1727. } else if (!filter_var($numSellUnitsBuyFILTER_VALIDATE_INT)){
  1728.     throw new \Pimcore\Model\Element\ValidationException("Number Sell Units Buy should be numeric."1234);
  1729. } else if(strlen($numSellUnitsBuy) > 4) {
  1730.   throw new \Pimcore\Model\Element\ValidationException("Number Sell Units Buy should not be more than 4 digits."1234); 
  1731. } else {
  1732.     /* Success */
  1733. }
  1734. if(strlen($UMCD) > 3) {
  1735.   throw new \Pimcore\Model\Element\ValidationException("UM Code should not be more than 3 characters."1234); 
  1736. }
  1737. if(strlen($description) > 20) {
  1738.   throw new \Pimcore\Model\Element\ValidationException("Description should not be more than 20 characters."1234); 
  1739. }
  1740.                 $table "object_relations_masterItem";
  1741.                 $sql "select * from ".$table." where dest_id='".$pid."' and fieldname= 'buyUMCD' ";
  1742.                 $stmt Db::get()->prepare($sql);
  1743.                 $stmt->execute();
  1744.                 $data =$stmt->fetchAll();
  1745.                 $totalrecord count($data);
  1746.                 $table "object_relations_masterItem";
  1747.                 $sql "select * from ".$table." where dest_id='".$pid."' and fieldname= 'sellUMCD' ";
  1748.                 $stmt Db::get()->prepare($sql);
  1749.                 $stmt->execute();
  1750.                 $data =$stmt->fetchAll();
  1751.                 $totalrecordSell count($data);
  1752.                 if($totalrecord || $totalrecordSell 0)
  1753.                 {
  1754.                     $venDelReq $foo->getdeleteRequest();
  1755.                     if($venDelReq == true)
  1756.                     {
  1757.                         throw new \Pimcore\Model\Element\ValidationException("Not perform delete operation for this object."1234);
  1758.                     }
  1759.                 
  1760.                 }
  1761.             }
  1762. if($claname == 'BundleItem' || $claname == 'bundleItem' )
  1763.             { 
  1764.   $ComponentQty $foo->getComponentQty();
  1765.   $ParentSKU $foo->getParentSKU();
  1766.   $ChildSKUs $foo->getChildSKUs();
  1767. if(empty($ParentSKU)) {
  1768.                 throw new \Pimcore\Model\Element\ValidationException("Please select parent SKU."1234);
  1769. if(empty($ChildSKUs)) {
  1770.                 throw new \Pimcore\Model\Element\ValidationException("Please select child SKU."1234);
  1771.             if(empty($ComponentQty)) {
  1772.                 throw new \Pimcore\Model\Element\ValidationException("Please enter Component Quantity."1234);
  1773. } else if (!filter_var($ComponentQtyFILTER_VALIDATE_INT)){
  1774.     throw new \Pimcore\Model\Element\ValidationException("Component Quantity should be numeric."1234);
  1775. } else if(strlen($ComponentQty) > 9) {
  1776.   throw new \Pimcore\Model\Element\ValidationException("Component Quantity should not be more than 9 digits."1234); 
  1777. } else {
  1778.     /* Success */
  1779. }
  1780.             }
  1781.             if($claname == 'priceEvent' || $claname == 'PriceEvent' )
  1782.             { 
  1783.   $eventDesc $foo->geteventDesc();
  1784.   $CurrentPrice =$foo->getCurrentPrice();
  1785.   $eventSeason $foo->geteventSeason();
  1786.   $priceLevel $foo->getpriceLevel();
  1787.   $store $foo->getstore();
  1788.   $itemMasterSKU $foo->getitemMasterSKU();
  1789.   $changeByPercentValue $foo->getchangeByPercentValue();
  1790.   $changeByValue $foo->getchangeByValue();
  1791.  
  1792. //throw new \Pimcore\Model\Element\ValidationException(($CurrentPrice)." - ".$priceLevel." - ".$store."", 1234); 
  1793.  
  1794. if($changeByValue)
  1795. {
  1796.   if($changeByPercentValue == 'changeByPercentValue')
  1797. {
  1798.   if(!is_numeric($changeByValue)) {
  1799.     throw new \Pimcore\Model\Element\ValidationException("Change by percent should be numeric."1234);
  1800. } else if(strlen($changeByValue) > 12) {
  1801.   throw new \Pimcore\Model\Element\ValidationException("Change by percent should not be more than 12 digits."1234); 
  1802. } else {
  1803.     /* Success */
  1804. }
  1805. }
  1806.    
  1807. if($changeByPercentValue == 'changeByPrice')
  1808. {
  1809. //  if (!filter_var($changeByValue, FILTER_VALIDATE_INT)){
  1810. if(!is_numeric($changeByValue)) {
  1811.     throw new \Pimcore\Model\Element\ValidationException("Change by price should be numeric."1234);
  1812. } else if(strlen($changeByValue) > 12) {
  1813.   throw new \Pimcore\Model\Element\ValidationException("Change by price should not be more than 12 digits."1234); 
  1814. } else {
  1815.     /* Success */
  1816. }
  1817. }
  1818.   
  1819. }
  1820.           
  1821. if(strlen($eventDesc) > 30) {
  1822.   throw new \Pimcore\Model\Element\ValidationException("Description should not be more than 30 characters."1234); 
  1823. }
  1824. if(empty($eventSeason)) {
  1825.   throw new \Pimcore\Model\Element\ValidationException("Please select event season."1234); 
  1826. }
  1827. if(empty($priceLevel)) {
  1828.   throw new \Pimcore\Model\Element\ValidationException("Please select price level."1234); 
  1829. }
  1830. if(empty($store) &&  $store != 0) {
  1831.   throw new \Pimcore\Model\Element\ValidationException("Please select store."1234); 
  1832. }
  1833. if(empty($itemMasterSKU)) {
  1834.   throw new \Pimcore\Model\Element\ValidationException("Please select SKU."1234); 
  1835. }
  1836.             }
  1837.             if($claname == 'TermCode' || $claname == 'termCode' )
  1838.             { 
  1839.   $paymentTermsCD $foo->getpaymentTermsCD();
  1840.   $daysToDueDate $foo->getdaysToDueDate();
  1841.   $daysToDiscDate $foo->getdaysToDiscDate();
  1842. if($paymentTermsCD)
  1843. {
  1844.   if (!filter_var($paymentTermsCDFILTER_VALIDATE_INT)){
  1845.    
  1846.     throw new \Pimcore\Model\Element\ValidationException("Payment terms code should be numeric."1234);
  1847. } else if(strlen($paymentTermsCD) > 3) {
  1848.   throw new \Pimcore\Model\Element\ValidationException("Payment terms code should not be more than 3 digits."1234); 
  1849. } else {
  1850.     /* Success */
  1851. }
  1852.   
  1853. }
  1854.           
  1855. if($daysToDueDate)
  1856. {
  1857.    if (!filter_var($daysToDueDateFILTER_VALIDATE_INT)){
  1858.     throw new \Pimcore\Model\Element\ValidationException("Days to due date should be numeric."1234);
  1859. } else if(strlen($daysToDueDate) > 4) {
  1860.   throw new \Pimcore\Model\Element\ValidationException("Days to due date should not be more than 4 digits."1234); 
  1861. } else {
  1862.     /* Success */
  1863. }
  1864.   
  1865. }
  1866.   
  1867.   if($daysToDiscDate)
  1868. {
  1869.    if (!filter_var($daysToDiscDateFILTER_VALIDATE_INT)){
  1870.     throw new \Pimcore\Model\Element\ValidationException("Days to discount date should be numeric."1234);
  1871. } else if(strlen($daysToDiscDate) > 4) {
  1872.   throw new \Pimcore\Model\Element\ValidationException("Days to discount date should not be more than 4 digits."1234); 
  1873. } else {
  1874.     /* Success */
  1875. }
  1876.   
  1877. }
  1878.   
  1879.             }
  1880.             // for heirarchy class
  1881.             if($claname == 'hierarchy' || $claname == 'Hierarchy' )
  1882.             {   
  1883.   $deptCode $foo->getdeptCode();
  1884.   $subdeptCode $foo->getsubdeptCode();
  1885.   $clCode $foo->getclCode();
  1886.   $subClassCode $foo->getsubClassCode();
  1887.   $deptName $foo->getdeptName();
  1888.   $subdeptName $foo->getsubdeptName();
  1889.   $clName $foo->getclName();
  1890.   $subClassName $foo->getsubClassName();
  1891.   $deptShortName $foo->getdeptShortName();
  1892.   $subdeptShortName $foo->getsubdeptShortName();
  1893.   $clShortName $foo->getclShortName();
  1894.   $subClassShortName $foo->getsubClassShortName();
  1895. //             if(empty($deptCode)) {
  1896. //                 throw new \Pimcore\Model\Element\ValidationException("Please enter department code.", 1234);
  1897. // } else
  1898.  if (!filter_var($deptCodeFILTER_VALIDATE_INT)){
  1899.     throw new \Pimcore\Model\Element\ValidationException("Department code should be numeric."1234);
  1900. } else 
  1901. if(strlen($deptCode) > 3) {
  1902.   throw new \Pimcore\Model\Element\ValidationException("Department code should not be more than 3 digits."1234); 
  1903. } else {
  1904.     /* Success */
  1905. }
  1906. // if(empty($subdeptCode)) {
  1907. //                 throw new \Pimcore\Model\Element\ValidationException("Please enter sub department code.", 1234);
  1908. // } else
  1909. if($subdeptCode)
  1910. {
  1911.  if (!filter_var($subdeptCodeFILTER_VALIDATE_INT)){
  1912.     throw new \Pimcore\Model\Element\ValidationException("Sub department code should be numeric."1234);
  1913. }
  1914.  else if(strlen($subdeptCode) > 3) {
  1915.   throw new \Pimcore\Model\Element\ValidationException("Sub department code should not be more than 3 digits."1234); 
  1916. } else {
  1917.     /* Success */
  1918. }
  1919. }
  1920. // if(empty($clCode)) {
  1921. //                 throw new \Pimcore\Model\Element\ValidationException("Please enter class code.", 1234);
  1922. // } else 
  1923. if($clCode)
  1924. {
  1925. if (!filter_var($clCodeFILTER_VALIDATE_INT)){
  1926.     throw new \Pimcore\Model\Element\ValidationException("Classification code should be numeric."1234);
  1927. } else if(strlen($clCode) > 3) {
  1928.   throw new \Pimcore\Model\Element\ValidationException("Classification code should not be more than 3 digits."1234); 
  1929. } else {
  1930.     /* Success */
  1931. }
  1932. }
  1933. // if(empty($subClassCode)) {
  1934. //                 throw new \Pimcore\Model\Element\ValidationException("Please enter sub class code.", 1234);
  1935. // } else 
  1936. if($subClassCode)
  1937. {
  1938.   if (!filter_var($subClassCodeFILTER_VALIDATE_INT)){
  1939.     throw new \Pimcore\Model\Element\ValidationException("Sub class code should be numeric."1234);
  1940. } else if(strlen($subClassCode) > 3) {
  1941.   throw new \Pimcore\Model\Element\ValidationException("Sub class code should not be more than 3 digits."1234); 
  1942. } else {
  1943.     /* Success */
  1944. }
  1945. }
  1946. if(strlen($deptName) > 25) {
  1947.   throw new \Pimcore\Model\Element\ValidationException("Department name should not be more than 25 characters."1234); 
  1948. }
  1949. if(strlen($subdeptName) > 25) {
  1950.   throw new \Pimcore\Model\Element\ValidationException("Sub department name should not be more than 25 characters."1234); 
  1951. }
  1952. if(strlen($clName) > 25) {
  1953.   throw new \Pimcore\Model\Element\ValidationException("Classification name should not be more than 25 characters."1234); 
  1954. }
  1955. if(strlen($subClassName) > 25) {
  1956.   throw new \Pimcore\Model\Element\ValidationException("Sub class name should not be more than 25 characters."1234);  
  1957. }
  1958. if(strlen($deptShortName) > 8) {
  1959.   throw new \Pimcore\Model\Element\ValidationException("Department short name should not be more than 8 characters."1234); 
  1960. }
  1961. if(strlen($subdeptShortName) > 8) {
  1962.   throw new \Pimcore\Model\Element\ValidationException("Sub department short name should not be more than 8 characters."1234); 
  1963. }
  1964. if(strlen($clShortName) > 8) {
  1965.   throw new \Pimcore\Model\Element\ValidationException("Classification short name should not be more than 8 characters."1234); 
  1966. }
  1967. if(strlen($subClassShortName) > 8) {
  1968.   throw new \Pimcore\Model\Element\ValidationException("Sub class short name should not be more than 8 characters."1234); 
  1969. }
  1970.                 $table "object_relations_masterItem";
  1971.                 $sql "select * from ".$table." where dest_id='".$pid."' and fieldname= 'hierarchyDetails' ";
  1972.                 $stmt Db::get()->prepare($sql);
  1973.                 $stmt->execute();
  1974.                 $data =$stmt->fetchAll();
  1975.                 $totalrecord count($data);
  1976.                 if($totalrecord 0)
  1977.                 {
  1978.                     $venDelReq $foo->getdeleteRequest();
  1979.                     if($venDelReq == true)
  1980.                     {
  1981.                         throw new \Pimcore\Model\Element\ValidationException("Not perform delete operation for this heirarchy object."1234);
  1982.                     }
  1983.                 
  1984.                 }
  1985.             }
  1986.         }
  1987.                 
  1988.         
  1989.     }
  1990.    
  1991.         
  1992. }