/**
  * Returns the changes partitioned by change type.
  *
  * @return array An array of type => array of changes.
  */
 protected function _partitionByType()
 {
     $types = Change::types();
     $result = array_combine(array_keys($types), array_fill(0, count($types), []));
     foreach ($this->_changes as $change) {
         $result[$change->getType()][] = $change;
     }
     return array_filter($result);
 }