コード例 #1
0
 /**
  * @return array | null
  */
 private function _getSavedData()
 {
     if (!$this->_file->isExists()) {
         return array();
     }
     return \WS\Migrations\jsonToArray($this->_file->getContents());
 }
コード例 #2
0
 protected static function modifyFromDb($data)
 {
     $result = array();
     foreach ($data as $name => $value) {
         if ($name == 'date') {
             if ($value instanceof DateTime) {
                 $value = new \DateTime();
                 $value->setTimestamp($value->getTimestamp());
             } else {
                 $value = new \DateTime($value);
             }
         }
         if (in_array($name, array('originalData', 'updateData'))) {
             $value = \WS\Migrations\jsonToArray($value);
         }
         $result[$name] = $value;
     }
     return $result;
 }