/**
  * Sets the default states of a content object.
  *
  * This function is called upon instantiating a content object with {@link eZContentClass::instantiate()}, so
  * should normally not be called by any other code.
  */
 function assignDefaultStates()
 {
     $db = eZDB::instance();
     $db->begin();
     $defaultStates = eZContentObjectState::defaults();
     $contentObjectID = $this->ID;
     foreach ( $defaultStates as $state )
     {
         $stateID = $state->attribute( 'id' );
         $db->query( "INSERT INTO ezcobj_state_link (contentobject_state_id, contentobject_id)
                      VALUES($stateID, $contentObjectID)" );
     }
     $db->commit();
 }