/**
  * Validates all modified columns of given ObjectPermission object.
  * If parameter $columns is either a single column name or an array of column names
  * than only those columns are validated.
  *
  * NOTICE: This does not apply to primary or foreign keys for now.
  *
  * @param      ObjectPermission $obj The object to validate.
  * @param      mixed $cols Column name or array of column names.
  *
  * @return     mixed TRUE if all columns are valid or the error message of the first invalid column.
  */
 public static function doValidate(ObjectPermission $obj, $cols = null)
 {
     $columns = array();
     if ($cols) {
         $dbMap = Propel::getDatabaseMap(ObjectPermissionPeer::DATABASE_NAME);
         $tableMap = $dbMap->getTable(ObjectPermissionPeer::TABLE_NAME);
         if (!is_array($cols)) {
             $cols = array($cols);
         }
         foreach ($cols as $colName) {
             if ($tableMap->containsColumn($colName)) {
                 $get = 'get' . $tableMap->getColumn($colName)->getPhpName();
                 $columns[$colName] = $obj->{$get}();
             }
         }
     } else {
         if ($obj->isNew() || $obj->isColumnModified(ObjectPermissionPeer::OP_UID)) {
             $columns[ObjectPermissionPeer::OP_UID] = $obj->getOpUid();
         }
         if ($obj->isNew() || $obj->isColumnModified(ObjectPermissionPeer::PRO_UID)) {
             $columns[ObjectPermissionPeer::PRO_UID] = $obj->getProUid();
         }
         if ($obj->isNew() || $obj->isColumnModified(ObjectPermissionPeer::TAS_UID)) {
             $columns[ObjectPermissionPeer::TAS_UID] = $obj->getTasUid();
         }
         if ($obj->isNew() || $obj->isColumnModified(ObjectPermissionPeer::USR_UID)) {
             $columns[ObjectPermissionPeer::USR_UID] = $obj->getUsrUid();
         }
         if ($obj->isNew() || $obj->isColumnModified(ObjectPermissionPeer::OP_USER_RELATION)) {
             $columns[ObjectPermissionPeer::OP_USER_RELATION] = $obj->getOpUserRelation();
         }
         if ($obj->isNew() || $obj->isColumnModified(ObjectPermissionPeer::OP_TASK_SOURCE)) {
             $columns[ObjectPermissionPeer::OP_TASK_SOURCE] = $obj->getOpTaskSource();
         }
         if ($obj->isNew() || $obj->isColumnModified(ObjectPermissionPeer::OP_PARTICIPATE)) {
             $columns[ObjectPermissionPeer::OP_PARTICIPATE] = $obj->getOpParticipate();
         }
         if ($obj->isNew() || $obj->isColumnModified(ObjectPermissionPeer::OP_OBJ_TYPE)) {
             $columns[ObjectPermissionPeer::OP_OBJ_TYPE] = $obj->getOpObjType();
         }
         if ($obj->isNew() || $obj->isColumnModified(ObjectPermissionPeer::OP_OBJ_UID)) {
             $columns[ObjectPermissionPeer::OP_OBJ_UID] = $obj->getOpObjUid();
         }
         if ($obj->isNew() || $obj->isColumnModified(ObjectPermissionPeer::OP_ACTION)) {
             $columns[ObjectPermissionPeer::OP_ACTION] = $obj->getOpAction();
         }
     }
     return BasePeer::doValidate(ObjectPermissionPeer::DATABASE_NAME, ObjectPermissionPeer::TABLE_NAME, $columns);
 }