original_string: public function hydrateEntity(EntityInterface $entity, array $values)
      {
          foreach ($values as $value) {
              if (!$this->_toolbox->propertyExists($entity, $value['property_name'])) {
                  $entity->set($value['property_name'], $value['value']);
                  $entity->dirty($value['property_name'], false);
              }
          }
  
          // force cache-columns to be of the proper type as they might be NULL if
          // entity has not been updated yet.
          if ($this->config('cacheMap')) {
              foreach ($this->config('cacheMap') as $column => $fields) {
                  if ($this->_toolbox->propertyExists($entity, $column) && !($entity->get($column) instanceof Entity)) {
                      $entity->set($column, new Entity);
                  }
              }
          }
  
          return $entity;
      }
code: public function hydrateEntity(EntityInterface $entity, array $values)
      {
          foreach ($values as $value) {
              if (!$this->_toolbox->propertyExists($entity, $value['property_name'])) {
                  $entity->set($value['property_name'], $value['value']);
                  $entity->dirty($value['property_name'], false);
              }
          }
  
          // force cache-columns to be of the proper type as they might be NULL if
          // entity has not been updated yet.
          if ($this->config('cacheMap')) {
              foreach ($this->config('cacheMap') as $column => $fields) {
                  if ($this->_toolbox->propertyExists($entity, $column) && !($entity->get($column) instanceof Entity)) {
                      $entity->set($column, new Entity);
                  }
              }
          }
  
          return $entity;
      }
code_tokens: public function hydrateEntity ( EntityInterface $ entity , array $ values ) { foreach ( $ values as $ value ) { if ( ! $ this -> _toolbox -> propertyExists ( $ entity , $ value [ 'property_name' ] ) ) { $ entity -> set ( $ value [ 'property_name' ] , $ value [ 'value' ] ) ; $ entity -> dirty ( $ value [ 'property_name' ] , false ) ; } } // force cache-columns to be of the proper type as they might be NULL if // entity has not been updated yet. if ( $ this -> config ( 'cacheMap' ) ) { foreach ( $ this -> config ( 'cacheMap' ) as $ column => $ fields ) { if ( $ this -> _toolbox -> propertyExists ( $ entity , $ column ) && ! ( $ entity -> get ( $ column ) instanceof Entity ) ) { $ entity -> set ( $ column , new Entity ) ; } } } return $ entity ; }
docstring: Hydrates a single entity and returns it.
  
  Returning NULL indicates the entity should be removed from the resulting
  collection.
  
  @param \Cake\Datasource\EntityInterface $entity The entity to hydrate
  @param array $values Holds stored virtual values for this particular entity
  @return bool|null|\Cake\Datasource\EntityInterface
docstring_tokens: Hydrates a single entity and returns it .