How to use the ember-flexberry-data/query/predicate.StringPredicate function in ember-flexberry-data

To help you get started, we’ve selected a few ember-flexberry-data examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github Flexberry / ember-flexberry-designer / addon / routes / fd-all-projects / index.js View on Github external
model(params) {
    let store = this.get('store');
    let modelName = 'fd-dev-stage';
    let projectionName = 'ListFormView';

    let builder = new Builder(store)
      .from(modelName)
      .selectByProjection(projectionName)
      .orderBy('changeDate desc');

    if (params.search) {
      let predicate = new ComplexPredicate(Condition.Or,
        new StringPredicate('name').contains(params.search),
        new StringPredicate('description').contains(params.search));

      builder.where(predicate);
    }

    return hash({
      projects: store.query(modelName, builder.build()),
    });
  },
github Flexberry / ember-flexberry-designer / addon / routes / fd-all-projects / index.js View on Github external
model(params) {
    let store = this.get('store');
    let modelName = 'fd-dev-stage';
    let projectionName = 'ListFormView';

    let builder = new Builder(store)
      .from(modelName)
      .selectByProjection(projectionName)
      .orderBy('changeDate desc');

    if (params.search) {
      let predicate = new ComplexPredicate(Condition.Or,
        new StringPredicate('name').contains(params.search),
        new StringPredicate('description').contains(params.search));

      builder.where(predicate);
    }

    return hash({
      projects: store.query(modelName, builder.build()),
    });
  },