More repository/service/refactor changes

This commit is contained in:
Dane Everitt 2017-08-12 15:29:01 -05:00
parent 2c77d5c44d
commit b8d7d99096
No known key found for this signature in database
GPG key ID: EEA66103B3D71F53
44 changed files with 977 additions and 669 deletions

View file

@ -36,4 +36,31 @@ class ServiceOptionRepository extends EloquentRepository implements ServiceOptio
{
return ServiceOption::class;
}
/**
* {@inheritdoc}
*/
public function getWithVariables($id)
{
return $this->getBuilder()->with('variables')->find($id, $this->getColumns());
}
/**
* {@inheritdoc}
*/
public function getWithCopyFrom($id)
{
return $this->getBuilder()->with('copyFrom')->find($id, $this->getColumns());
}
/**
* {@inheritdoc}
*/
public function isCopiableScript($copyFromId, $service)
{
return $this->getBuilder()->whereNull('copy_script_from')
->where('id', '=', $copyFromId)
->where('service_id', '=', $service)
->exists();
}
}