Changeset 5033 for branches/1.1/lib/Doctrine/Record/Abstract.php
- Timestamp:
- 10/02/08 03:07:08 (18 months ago)
- Files:
-
- 1 modified
-
branches/1.1/lib/Doctrine/Record/Abstract.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
branches/1.1/lib/Doctrine/Record/Abstract.php
r5030 r5033 113 113 } 114 114 } 115 116 /** 117 * Specify an array of fields that are unique and will be validated as such 118 * 119 * @return void 120 */ 121 public function unique() 122 { 123 $args = func_get_args(); 124 125 if (count($args) == 1) { 126 $fields = (array) $args[0]; 127 } else if (count($args) > 1) { 128 $fields = $args; 129 } else { 130 throw new Doctrine_Record_Exception('You must specify the fields to make a unique constraint on.'); 131 } 132 133 return $this->_table->unique($fields); 134 } 135 115 136 public function setAttribute($attr, $value) 116 137 {