diff --git a/src/Model/Table/BroodsTable.php b/src/Model/Table/BroodsTable.php index 41fb39d..ce783f4 100644 --- a/src/Model/Table/BroodsTable.php +++ b/src/Model/Table/BroodsTable.php @@ -27,10 +27,11 @@ class BroodsTable extends AppTable public function validationDefault(Validator $validator): Validator { return $validator - ->requirePresence(['name', 'url', 'organisation'], 'create') + ->requirePresence(['name', 'url', 'organisation_id'], 'create') ->notEmptyString('name') ->notEmptyString('url') - ->url('url'); + ->url('url', __('The provided value is not a valid URL')) + ->naturalNumber('organisation_id', false); } public function genHTTPClient(Object $brood, array $options=[]): Object