@param \Reliese\Coders\Model\Model $model

@return bool
194563
public function needsUserFile(Model $model)
    {
        return ! $this->files->exists($this->modelPath($model)) && $model->usesBaseFiles();
    }
1314950
public function isEditable(Model $model)
    {
        if (! is_callable($this->getEdit())) {
            return false;
        }

        return $this->editable && parent::isEditable($model);
    }
1239234
public function is($model)
    {
        return ! is_null($model) &&
               $this->getKey() === $model->getKey() &&
               get_class($this) == get_class($model);
    }
1012670
public static function can(string $model) : bool {
		// load models
		if (!isset(self::$cached_models)) {
			$file = './Overrides/Class/Override_Object_ACL_Registered.php';
			if (file_exists($file)) {
				require($file);
				self::$cached_models = $object_override_blank_object;
			} else {
				self::$cached_models = [];
			}
		}
		return !empty(self::$cached_models[$model]);
	}
664757
protected function prepareModel(Model $model)
    {
        if (is_callable($this->prepareModel)) {
            call_user_func($this->prepareModel, $model);
        } else {
            foreach ($model->attributes() as $attribute) {
                $value = Yii::$app->settings->get($this->getSection($model), $attribute);

                if (!is_null($value)) {
                    $model->{$attribute} = $value;
                }
            }
        }
    }
247548
public function delete(Model $model)
    {
        $deleted = $model->delete();

        if ($deleted) {
            app('cache')->flush();
        }

        return $deleted;
    }
1030434
public function check(Model $model, array $parameters = [])
    {
        $this->model      = $model;
        $this->parameters = $parameters;

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

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

        return $this->model->language === $key;
    }
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;
    }
793767
public function isOwner(Model $Model) {
		if (!$Model->exists()) {
			return false;
		}

		if (!$owner = Hash::get($Model->data, $Model->alias . '.' . $this->settings[$Model->alias]['owner']['path'])) {
			$requireAuth = $Model->requireAuth;
			$Model->requireAuth = false;
			$owner = $Model->field(
				$this->settings[$Model->alias]['owner']['path'],
				array($Model->alias . '.' . $Model->primaryKey => $Model->getID())
			);
			$Model->requireAuth = $requireAuth;
		}

		return $this->getCurrentUser($Model, $this->settings[$Model->alias]['owner']['auth']) == $owner;
	}
919865
public function setModel(Model $model)
    {
        if (strpos($this->originalName, '.') !== false) {
            $parts = explode('.', $this->originalName);
            $name = array_pop($parts);

            while ($parts) {
                $part = array_shift($parts);
                $relation = $model->getAttribute($part);

                if ($relation instanceof Model) {
                    $model = $relation;
                    $this->setName($name);
                }
            }
        }

        return parent::setModel($model);
    }
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;
    }
883018
public function beforeDelete(Model $model, $cascade = true) {
		$runtime = $this->runtime[$model->alias];
		if ($runtime) {
			if ($model->beforeDelete($cascade)) {
				return $this->delete($model, $model->id);
			}
			return false;
		}
		return true;
	}
828375
public function link(Model $model)
    {
        if ( ! $this->routePrefix || ! $this->isPermitted) {
            return false;
        }

        return route($this->routePrefix . static::ROUTE_POSTFIX, [ $model->getKey() ]);
    }
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;
    }
225514
public function isDevice($model)
    {
        return (!empty($this->device->series) && $this->device->series == $model) || (!empty($this->device->model) && $this->device->model == $model);
    }
485273
public function save(Model $model)
    {
        $model->setAttribute($this->getForeignKeyName(), $this->getParentKey());

        return $model->save() ? $model : false;
    }