コード例 #1
0
 protected function setData($data, $datasource = '', $isActionBoundDatasource = false)
 {
     if (empty($datasource) && !empty($this->currentDatasource)) {
         $datasource = $this->currentDatasource;
     }
     if (!is_array($data) && !empty($data)) {
         $data = array($data);
     }
     if ($isActionBoundDatasource) {
         self::$actionBoundDatasource = $datasource;
         // NOTE: referenceData always overrides data
         if (count($refData = (array) $this->referenceData()) > 0) {
             $data = ArrayUtils::arrayMultiMergeKeys($data, $refData);
         }
     }
     self::$data[$datasource] = $data;
 }