Package com.dubture.symfony.core.model

Examples of com.dubture.symfony.core.model.EntityAlias


     
      if (parts.length != 2) {
        return null;
      }
     
      EntityAlias alias = new EntityAlias(entity);
     
      if (!alias.hasBundle())
        return null;
     
      IType type = SymfonyModelAccess.getDefault().findEntity(alias, input.getScriptProject());
     
      if (type == null)
View Full Code Here


        DoctrineModelAccess doctrineModel =  DoctrineModelAccess.getDefault();
        IModelAccessCache cache = null;
        if (context instanceof IModelCacheContext) {
          cache = ((IModelCacheContext) context).getCache();
        }
        EntityAlias alias = context.getAlias();
        String prefix = context.getPrefix();
       
        if (alias.hasBundle() == false) {
            List<Bundle> bundles = model.findBundles(project);
            for (Bundle b : bundles) {
                IType[] bundleTypes = EMPTY_TYPES;
                if (cache != null) {
                  Collection<IType> types = cache.getTypes(context.getSourceModule(), b.getElementName(), null, null);
                  if (types != null) {
                    bundleTypes = types.toArray(new IType[types.size()]);
                  }
                } else {
                  bundleTypes = PhpModelAccess.getDefault().findTypes(b.getElementName(), MatchRule.EXACT, 0, 0, projectScope, null);
                }
                if (bundleTypes.length == 1) {
                    ModelElement bType = (ModelElement) bundleTypes[0];
                    if (CodeAssistUtils.startsWithIgnoreCase(bType.getElementName(), prefix)) {
                        Bundle bundleType = new Bundle(bType, b.getElementName());
                        reporter.reportType(bundleType, ":", range);
                    }
                }
            }
        } else {
            List<Entity> entities = doctrineModel.getEntities(project);
            //TODO: cache the entities
            for (Entity entity : entities) {
                EntityAlias newAliase = new EntityAlias(alias.getBundleAlias(), entity.getElementName());
                IType type = model.findEntity(newAliase, project);

                if (type != null) {
                    reporter.reportType(new Entity((ModelElement) type, type.getElementName()), "", range);
                }
View Full Code Here

public class SymfonyEntityResolver implements IEntityResolver {

  @Override
  public IType resolve(String entity, IScriptProject project) {

    EntityAlias alias = new EntityAlias(entity);
   
    if (alias == null || alias.getBundleAlias() == null) {
      return null;
    }
   
    return SymfonyModelAccess.getDefault().findEntity(alias, project);
  }
View Full Code Here

            } else
              path = "";
          }

          if (path != null) {
            alias = new EntityAlias(path);
            return true;
          }

          // TODO: check if the containing class is implementing a
          // ContainerAware Interface
View Full Code Here

TOP

Related Classes of com.dubture.symfony.core.model.EntityAlias

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.