不要怂,就是干,撸起袖子干!

Commit 5c567796 by Sascha Depold

added possibility to define the relevant attribute of getDAO

1 parent d863a5fd
Showing with 5 additions and 2 deletions
......@@ -16,9 +16,12 @@ module.exports = (function() {
})
}
DAOFactoryManager.prototype.getDAO = function(daoName) {
DAOFactoryManager.prototype.getDAO = function(daoName, options) {
options = options || {}
options.attribute = options.attribute || 'name'
var dao = this.daos.filter(function(dao) {
return dao.name == daoName
return dao[options.attribute] === daoName
})
return !!dao ? dao[0] : null
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!