Exemplo n.º 1
0
 /**
  * Enter description here...
  *
  * @param unknown_type $mygood
  * @param unknown_type $mysource
  */
 function SetMain($mygood, $mysource, $maintype = 1)
 {
     $result = array();
     if ($this->User->IsAdmin()) {
         /* @var $entity kernel_entity_XMainGoodEntity */
         $entity = $this->EntityCache->getEntity("XMainGood", 0, array(), READ_MODE, COMMONENTITY);
         $entity->Enabled = 1;
         $entity->GoodID = $mygood;
         $entity->MainTypeID = $maintype;
         $entity->Position = 0;
         $entity->Source = $mysource;
         $entity->Save();
         $result['success'] = 1;
     } else {
         $result['success'] = 0;
         $result['message'] = 'not admin';
     }
     return $result;
 }