Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions src/org/swizframework/core/BeanFactory.as
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,7 @@ package org.swizframework.core
bean = null;
}

public function getBeanByName( name:String ):Bean
public function getBeanByName( name:String, discovery:Boolean = true ):Bean
{
var foundBean:Bean = null;

Expand All @@ -275,13 +275,13 @@ package org.swizframework.core

if( foundBean != null && !( foundBean is Prototype ) && !foundBean.initialized )
setUpBean( foundBean );
else if( foundBean == null && parentBeanFactory != null )
else if( foundBean == null && parentBeanFactory != null && discovery )
foundBean = parentBeanFactory.getBeanByName( name );

return foundBean;
}

public function getBeanByType( beanType:Class ):Bean
public function getBeanByType( beanType:Class, discovery:Boolean = true ):Bean
{
var foundBean:Bean;

Expand All @@ -302,7 +302,7 @@ package org.swizframework.core

if( foundBean != null && !( foundBean is Prototype ) && !foundBean.initialized )
setUpBean( foundBean );
else if( foundBean == null && parentBeanFactory != null )
else if( foundBean == null && parentBeanFactory != null && discovery )
foundBean = parentBeanFactory.getBeanByType( beanType );

return foundBean;
Expand Down
6 changes: 3 additions & 3 deletions src/org/swizframework/core/IBeanFactory.as
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,13 @@ package org.swizframework.core
function removeBeanProvider( beanProvider:IBeanProvider ):void;

function get beans():Array;
function getBeanByName( name:String ):Bean;
function getBeanByType( type:Class ):Bean;
function getBeanByName( name:String, discovery:Boolean = true ):Bean;
function getBeanByType( type:Class, discovery:Boolean = true ):Bean;

/**
* Parent Swiz instance, for nesting and modules
*/
function get parentBeanFactory():IBeanFactory;
function set parentBeanFactory( parentBeanFactory:IBeanFactory ):void;
}
}
}