コード例 #1
0
 protected function _decode($model, $values, $id)
 {
     switch (get_class($model)) {
         case 'Api\\Model\\Languageforge\\Lexicon\\LexMultiParagraph':
             $html = '';
             if (array_key_exists('paragraphsHtml', $values)) {
                 $html = $values['paragraphsHtml'];
             }
             /** @var LexMultiParagraph $model */
             $model->fromHtml($html);
             break;
         default:
             parent::_decode($model, $values, $id);
     }
 }
コード例 #2
0
 /**
  * Sets the public properties of $model to values from $values[propertyName]
  * @param object $model
  * @param array $values A mixed array of JSON (like) data.
  * @param string $id
  */
 public static function decode($model, $values, $id = '')
 {
     $decoder = new JsonDecoder();
     $decoder->_decode($model, $values, $id);
 }