@param $model

@return bool
518471
public function check($model)
    {
        list($min, $max) = $this->range;

        return $model->{$this->property} >= $min && $model->{$this->property} <= $max;
    }
712369
public function isPendingOrSaved($model)
    {
        return $this->store->isSaved($model) || $this->store->isPending($model);
    }
1281815
public function delete($model)
    {
        $this->fire($this->event('destroying'), [$model]);
        $model->delete();
        $this->fire($this->event('destroyed'), [$model]);
        return $model;
    }
1123434
public function search($model)
    {
        $method = 'search';

        $condition = $this->condition ?: [[]];

        $params = $this->buildParams('limit', 'offset');

        $result = $this->call($model, $method, $condition, $params);

        //Reset params for future queries.
        $this->resetParams('limit', 'offset', 'condition');

        return $this->makeResponse($result);
    }
131333
public function update(Record $model)
    {
        $query = $this->updateQuery($model);

        if ($query) {
            return $query->execute();
        }

        return false;
    }
454523
public function checkTableExists($model)
    {
        if (!in_array($model->table, $this->getAuditTables())) {
            $model->addError('table', Yii::t('app', "You've entered an invalid table name."));
            return false;
        }
        return true;
    }
1158126
public function hasRelatedKey($key, $model = false)
    {
        if (!$model) {
            $model = $this->model;
        }

        if (($methodBreaker = strpos($key, '.')) !== false) {
            $method = substr($key, 0, $methodBreaker);
            if (method_exists($model, $method)) {
                return true;
            }
        }

        return false;
    }
417785
public function modelHasLanguage($model, $key)
    {
        if ($this->isLanguage($key)) {
            return true;
        }

        if ($model->translations->get($key)) {
            return true;
        }

        return $this->model->language === $key;
    }
445416
protected function getValueFromModel($model)
    {
        if ( ! ($model instanceof Model)) {
            return null;
        }

        return get_class($model)
             . static::CLASS_AND_KEY_SEPARATOR
             . $model->getKey();
    }
485273
public function save(Model $model)
    {
        $model->setAttribute($this->getForeignKeyName(), $this->getParentKey());

        return $model->save() ? $model : false;
    }
784835
public function isEncodable($model)
    {
        if (!method_exists($model, 'getDirtyEncodableAttributes')) {
            return false;
        }

        if (is_a($model, 'Bkwld\Decoy\Models\Element') && $model->getAttribute('type') != 'video-encoder') {
            return false;
        }

        return true;
    }
1118071
public function creating(Model $model)
    {
        if (request()->hasFile('name')) {
            // delete prev image
            $file = $this->fileUploader->handle(request()->file('name'));
            $model->name = $file['filename'];
            $model->fill(Arr::except($file, 'filename'));
        } else {
            if ($model->type !== 'f') {
                return false;
            }
        }
    }
535650
public function save(Model $model)
    {
        $model->setAttribute($this->getPlainForeignKey(), $this->getParentKey());

        return $model->save() ? $model : false;
    }
939816
protected function isDeletedModel($model, $attribute)
    {
        $modelAttributes = $model->attributes;
        unset($modelAttributes[$model->primaryKey()[0]]);

        foreach ($this->relationalData[$attribute]['newModels'] as $newModel) {
            /** @var ActiveRecord $newModel */
            $newModelAttributes = $newModel->attributes;
            unset($newModelAttributes[$newModel->primaryKey()[0]]);

            if ($newModelAttributes == $modelAttributes) {
                return false;
            }
        }

        return true;
    }
769591
public function liked(Model $model): bool
    {
        return (bool) $this->likes()
                           ->where('liked_by_id', $model->id)
                           ->where('liked_by_type', get_class($model))
                           ->count();
    }
138588
public function delete($model) {
        if ($model) {
            if (!is_array($model)) {
                $model = array($model);
            }
            return parent::delete($model);
        }
        else {
            return parent::delete();
        }
        return $this;
    }
791590
public function contains($model)
    {
        $class = $this->getClassMetadata(get_class($model));

        foreach ($class->getFieldManagerNames() as $manager) {
            if (!$this->pool->getManager($manager)->contains($model->{'get' . ucfirst($manager)}())) {
                return false;
            }
        }

        return true;
    }