Browse Source

Add virtual field support to slug labels

Jad Bitar 10 years ago
parent
commit
bf6c1cbac1
1 changed files with 1 additions and 1 deletions
  1. 1 1
      src/Model/Behavior/SluggedBehavior.php

+ 1 - 1
src/Model/Behavior/SluggedBehavior.php

@@ -128,7 +128,7 @@ class SluggedBehavior extends Behavior {
 						throw new \Exception('(SluggedBehavior::setup) model ' . $this->_table->$alias->name . ' is missing the field ' . $field .
 							' (specified in the setup for model ' . $this->_table->name . ') ');
 					}
-				} elseif (!$this->_table->hasField($field)) {
+				} elseif (!$this->_table->hasField($field) && !method_exists($this->_table->entityClass(), '_get' . Inflector::classify($field))) {
 					throw new \Exception('(SluggedBehavior::setup) model ' . $this->_table->name . ' is missing the field ' . $field . ' specified in the setup.');
 				}
 			}