Beispiel #1
0
 public function ObjectDataSource($option = null)
 {
     if ($option != null && is_array($option)) {
         $sourceData = ["IntObjectType" => (object) ['CODE' => $option['IntObjectType']["name"], 'ID' => $option['IntObjectType']["id"]]];
         $mdl = \Helper::getModelName("ObjectDataSource");
         return $mdl::loadBy($sourceData);
     }
     return null;
 }
Beispiel #2
0
 public static function loadBy($sourceData)
 {
     if ($sourceData != null && is_array($sourceData)) {
         $facility = $sourceData['Facility'];
         $facility_id = $facility->ID;
         $phaseType = $sourceData['CodeProductType'];
         $phaseTypeId = $phaseType->ID;
         $objectType = $sourceData['IntObjectType'];
         $mdlName = $objectType->CODE;
         $mdl = \Helper::getModelName($mdlName);
         return $mdl::getEntries($facility_id, $phaseTypeId);
     }
     return null;
 }