/** * Make changes to the database. * * @return void */ public function up() { Schema::create('users', function ($table) { $table->increments('id'); $table->string('email')->unique(); $table->string('password'); $table->string('name'); $table->integer('age'); $table->timestamps(); }); User::create(array('id' => 1, 'email' => '*****@*****.**', 'password' => Hash::make('test'), 'name' => 'I am Administrator', 'age' => 40)); User::create(array('id' => 2, 'email' => '*****@*****.**', 'password' => Hash::make('test'), 'name' => 'I am Staff', 'age' => 30)); User::create(array('id' => 3, 'email' => '*****@*****.**', 'password' => Hash::make('test'), 'name' => 'I am Member', 'age' => 25)); User::create(array('id' => 4, 'email' => '*****@*****.**', 'password' => Hash::make('test'), 'name' => 'I am Member and Staff', 'age' => 17)); Schema::create('roles', function ($table) { $table->increments('id'); $table->string('name'); $table->timestamps(); }); Role::create(array('id' => 1, 'name' => 'Admin')); Role::create(array('id' => 2, 'name' => 'Staff')); Role::create(array('id' => 3, 'name' => 'Member')); Schema::create('rules', function ($table) { $table->increments('id'); $table->string('group'); $table->string('action'); $table->string('description'); $table->timestamps(); }); Rule::create(array('id' => 1, 'group' => 'demo', 'action' => '*', 'description' => 'Can access Demo all actions.')); Rule::create(array('id' => 2, 'group' => 'demo', 'action' => 'view', 'description' => 'Can view Demo.')); Rule::create(array('id' => 3, 'group' => 'demo', 'action' => 'create', 'description' => 'Can create Demo.')); Rule::create(array('id' => 4, 'group' => 'demo', 'action' => 'edit', 'description' => 'Can edit Demo.')); Rule::create(array('id' => 5, 'group' => 'demo', 'action' => 'revise', 'description' => 'Can revise Demo.')); Rule::create(array('id' => 6, 'group' => 'demo', 'action' => 'publish', 'description' => 'Can publish Demo.')); Rule::create(array('id' => 7, 'group' => 'demo', 'action' => 'delete', 'description' => 'Can delete Demo.')); Schema::create('role_rule', function ($table) { $table->increments('id'); $table->integer('role_id'); $table->integer('rule_id'); $table->timestamps(); }); Role::find(1)->rules()->sync(array(1)); Role::find(2)->rules()->sync(array(2, 5, 6, 7)); Role::find(3)->rules()->sync(array(2, 4, 3)); Schema::create('role_user', function ($table) { $table->increments('id'); $table->integer('user_id'); $table->integer('role_id'); $table->timestamps(); }); User::find(1)->roles()->attach(1); User::find(2)->roles()->attach(2); User::find(3)->roles()->attach(3); User::find(4)->roles()->sync(array(2, 3)); }
function doExecute() { $rule = Rule::create($this->get('rule')); if ($rule->group === '') { $rule->group = null; } $this->beforeSave($rule); $ret = $rule->save($rule); if ($ret) { return $this->success($ret); } else { return $this->error(ErrorInfo::ERROR_NO_DB_OPERATION_ERROR, 'modify failed'); } }
private function saveRule() { $data = array('url' => '/add', 'res' => array('errno' => '0', 'data' => array('name' => 'hehe'))); $rc1 = new RuleCondition(); $rc1->condId = ObjectUtil::guid(); $rc1->logicType = RuleCondition::LOGIC_TYPE_AND; $rce1 = new RuleConditionExpression(); $rce1->contextType = RuleConditionExpressionOperand::CONTEXT_TYPE_REQUEST; $rce1->key = 'name'; $rce1->value = 'Lily'; $rce1->operator = RuleConditionExpression::OPERATOR_EQUAL; $rce2 = new RuleConditionExpression(); $rce2->contextType = RuleConditionExpressionOperand::CONTEXT_TYPE_REQUEST; $rce2->key = 'age'; $rce2->value = 10; $rce2->operator = RuleConditionExpression::OPERATOR_GRATER; $rc1->expressions = array($rce1, $rce2); $rc2 = new RuleCondition(); $rc2->condId = ObjectUtil::guid(); $rc2->logicType = RuleCondition::LOGIC_TYPE_OR; $rce3 = new RuleConditionExpression(); $rce3->contextType = RuleConditionExpressionOperand::CONTEXT_TYPE_HEADER; $rce3->key = 'WITH_XML_HTTP_REQUEST'; $rce3->operator = RuleConditionExpression::OPERATOR_IS_SET; $rce4 = new RuleConditionExpression(); $rce4->contextType = RuleConditionExpressionOperand::CONTEXT_TYPE_REQUEST; $rce4->key = 'agent'; $rce4->value = "MSIE"; $rce4->operator = RuleConditionExpression::OPERATOR_NOT_CONTAIN; $rc2->expressions = array($rce3, $rce4); $data['conditions'] = array($rc1, $rc2); $rule = Rule::create($data); // return $this->success($rule); $ret = $rule->save(); if ($ret) { return $this->success($ret); } else { return $this->error(ErrorInfo::ERROR_NO_DB_OPERATION_ERROR, 'save failed'); } }
public function run() { Eloquent::unguard(); $formular_insta = Formular::create(array('name' => 'insta')); $insta = Inputrule::create(array('formular_id' => $formular_insta->id, 'name' => 'installNr')); $rules = Rule::create(array('inputrule_id' => $insta->id, 'rule' => 'required')); $rules = Rule::create(array('inputrule_id' => $insta->id, 'rule' => 'digits:8')); $insta = Inputrule::create(array('formular_id' => $formular_insta->id, 'name' => 'firmenName')); $rules = Rule::create(array('inputrule_id' => $insta->id, 'rule' => 'required')); $rules = Rule::create(array('inputrule_id' => $insta->id, 'rule' => 'max:40')); $insta = Inputrule::create(array('formular_id' => $formular_insta->id, 'name' => 'ort')); $rules = Rule::create(array('inputrule_id' => $insta->id, 'rule' => 'required')); $rules = Rule::create(array('inputrule_id' => $insta->id, 'rule' => 'max:40')); $insta = Inputrule::create(array('formular_id' => $formular_insta->id, 'name' => 'strasse')); $rules = Rule::create(array('inputrule_id' => $insta->id, 'rule' => 'required')); $rules = Rule::create(array('inputrule_id' => $insta->id, 'rule' => 'max:40')); $insta = Inputrule::create(array('formular_id' => $formular_insta->id, 'name' => 'strNr')); $rules = Rule::create(array('inputrule_id' => $insta->id, 'rule' => 'required')); $rules = Rule::create(array('inputrule_id' => $insta->id, 'rule' => 'regex:/^\\d+\\s*[a-zA-Z]*$/')); $rules = Rule::create(array('inputrule_id' => $insta->id, 'rule' => 'max:10')); $insta = Inputrule::create(array('formular_id' => $formular_insta->id, 'name' => 'plz')); $rules = Rule::create(array('inputrule_id' => $insta->id, 'rule' => 'required')); $rules = Rule::create(array('inputrule_id' => $insta->id, 'rule' => 'digits:5')); $insta = Inputrule::create(array('formular_id' => $formular_insta->id, 'name' => 'telefon')); $rules = Rule::create(array('inputrule_id' => $insta->id, 'rule' => 'alpha_dash')); $rules = Rule::create(array('inputrule_id' => $insta->id, 'rule' => 'max:30')); $insta = Inputrule::create(array('formular_id' => $formular_insta->id, 'name' => 'fax')); $rules = Rule::create(array('inputrule_id' => $insta->id, 'rule' => 'alpha_dash')); $rules = Rule::create(array('inputrule_id' => $insta->id, 'rule' => 'max:30')); $insta = Inputrule::create(array('formular_id' => $formular_insta->id, 'name' => 'vorname')); $rules = Rule::create(array('inputrule_id' => $insta->id, 'rule' => 'required')); $rules = Rule::create(array('inputrule_id' => $insta->id, 'rule' => 'alpha_dash')); $rules = Rule::create(array('inputrule_id' => $insta->id, 'rule' => 'max:40')); $insta = Inputrule::create(array('formular_id' => $formular_insta->id, 'name' => 'nachname')); $rules = Rule::create(array('inputrule_id' => $insta->id, 'rule' => 'required')); $rules = Rule::create(array('inputrule_id' => $insta->id, 'rule' => 'alpha_dash')); $rules = Rule::create(array('inputrule_id' => $insta->id, 'rule' => 'max:40')); //AnschlussFormular $formular_ansch = Formular::create(array('name' => 'ansch')); //Kundendaten $ansch = Inputrule::create(array('formular_id' => $formular_ansch->id, 'name' => 'KdnFirmenNam')); $rules = Rule::create(array('inputrule_id' => $ansch->id, 'rule' => 'required')); $rules = Rule::create(array('inputrule_id' => $ansch->id, 'rule' => 'max:40')); $ansch = Inputrule::create(array('formular_id' => $formular_ansch->id, 'name' => 'KdnVorNam')); $rules = Rule::create(array('inputrule_id' => $ansch->id, 'rule' => 'required')); $rules = Rule::create(array('inputrule_id' => $ansch->id, 'rule' => 'max:40')); $ansch = Inputrule::create(array('formular_id' => $formular_ansch->id, 'name' => 'KdnNachNam')); $rules = Rule::create(array('inputrule_id' => $ansch->id, 'rule' => 'required')); $rules = Rule::create(array('inputrule_id' => $ansch->id, 'rule' => 'max:40')); $ansch = Inputrule::create(array('formular_id' => $formular_ansch->id, 'name' => 'KdnPlz')); $rules = Rule::create(array('inputrule_id' => $ansch->id, 'rule' => 'required')); $rules = Rule::create(array('inputrule_id' => $ansch->id, 'rule' => 'digits:5')); $ansch = Inputrule::create(array('formular_id' => $formular_ansch->id, 'name' => 'KdnOrt')); $rules = Rule::create(array('inputrule_id' => $ansch->id, 'rule' => 'required')); $rules = Rule::create(array('inputrule_id' => $ansch->id, 'rule' => 'max:40')); $ansch = Inputrule::create(array('formular_id' => $formular_ansch->id, 'name' => 'KdnStr')); $rules = Rule::create(array('inputrule_id' => $ansch->id, 'rule' => 'required')); $rules = Rule::create(array('inputrule_id' => $ansch->id, 'rule' => 'max:40')); $ansch = Inputrule::create(array('formular_id' => $formular_ansch->id, 'name' => 'KdnHausNr')); $rules = Rule::create(array('inputrule_id' => $ansch->id, 'rule' => 'required')); $rules = Rule::create(array('inputrule_id' => $ansch->id, 'rule' => 'regex:/^\\d+\\s*[a-zA-Z]*$/')); $rules = Rule::create(array('inputrule_id' => $ansch->id, 'rule' => 'max:10')); $ansch = Inputrule::create(array('formular_id' => $formular_ansch->id, 'name' => 'KdnTel')); $rules = Rule::create(array('inputrule_id' => $ansch->id, 'rule' => 'alpha_dash')); $rules = Rule::create(array('inputrule_id' => $ansch->id, 'rule' => 'max:30')); //Kundendaten_eigentuemer $ansch = Inputrule::create(array('formular_id' => $formular_ansch->id, 'name' => 'EigtFirmenNam')); $rules = Rule::create(array('inputrule_id' => $ansch->id, 'rule' => 'required')); $rules = Rule::create(array('inputrule_id' => $ansch->id, 'rule' => 'max:40')); $ansch = Inputrule::create(array('formular_id' => $formular_ansch->id, 'name' => 'EigtVorNam')); $rules = Rule::create(array('inputrule_id' => $ansch->id, 'rule' => 'required')); $rules = Rule::create(array('inputrule_id' => $ansch->id, 'rule' => 'max:40')); $ansch = Inputrule::create(array('formular_id' => $formular_ansch->id, 'name' => 'EigtNachNam')); $rules = Rule::create(array('inputrule_id' => $ansch->id, 'rule' => 'required')); $rules = Rule::create(array('inputrule_id' => $ansch->id, 'rule' => 'max:40')); $ansch = Inputrule::create(array('formular_id' => $formular_ansch->id, 'name' => 'EigtPlz')); $rules = Rule::create(array('inputrule_id' => $ansch->id, 'rule' => 'required')); $rules = Rule::create(array('inputrule_id' => $ansch->id, 'rule' => 'digits:5')); $ansch = Inputrule::create(array('formular_id' => $formular_ansch->id, 'name' => 'EigtOrt')); $rules = Rule::create(array('inputrule_id' => $ansch->id, 'rule' => 'required')); $rules = Rule::create(array('inputrule_id' => $ansch->id, 'rule' => 'max:40')); $ansch = Inputrule::create(array('formular_id' => $formular_ansch->id, 'name' => 'EigtStr')); $rules = Rule::create(array('inputrule_id' => $ansch->id, 'rule' => 'required')); $rules = Rule::create(array('inputrule_id' => $ansch->id, 'rule' => 'max:40')); $ansch = Inputrule::create(array('formular_id' => $formular_ansch->id, 'name' => 'EigtHausNr')); $rules = Rule::create(array('inputrule_id' => $ansch->id, 'rule' => 'required')); $rules = Rule::create(array('inputrule_id' => $ansch->id, 'rule' => 'regex:/^\\d+\\s*[a-zA-Z]*$/')); $rules = Rule::create(array('inputrule_id' => $ansch->id, 'rule' => 'max:10')); $ansch = Inputrule::create(array('formular_id' => $formular_ansch->id, 'name' => 'EigtTel')); $rules = Rule::create(array('inputrule_id' => $ansch->id, 'rule' => 'alpha_dash')); $rules = Rule::create(array('inputrule_id' => $ansch->id, 'rule' => 'max:30')); // objektdaten $ansch = Inputrule::create(array('formular_id' => $formular_ansch->id, 'name' => 'bedarfsart')); $rules = Rule::create(array('inputrule_id' => $ansch->id, 'rule' => 'required')); $rules = Rule::create(array('inputrule_id' => $ansch->id, 'rule' => 'digits:1')); $ansch = Inputrule::create(array('formular_id' => $formular_ansch->id, 'name' => 'ObjAdrPlz')); $rules = Rule::create(array('inputrule_id' => $ansch->id, 'rule' => 'required')); $rules = Rule::create(array('inputrule_id' => $ansch->id, 'rule' => 'digits:5')); $ansch = Inputrule::create(array('formular_id' => $formular_ansch->id, 'name' => 'ObjAdrOrt')); $rules = Rule::create(array('inputrule_id' => $ansch->id, 'rule' => 'required')); $rules = Rule::create(array('inputrule_id' => $ansch->id, 'rule' => 'max:40')); $ansch = Inputrule::create(array('formular_id' => $formular_ansch->id, 'name' => 'ObjAdrStr')); $rules = Rule::create(array('inputrule_id' => $ansch->id, 'rule' => 'required')); $rules = Rule::create(array('inputrule_id' => $ansch->id, 'rule' => 'max:40')); $ansch = Inputrule::create(array('formular_id' => $formular_ansch->id, 'name' => 'ObjAdrNr')); $rules = Rule::create(array('inputrule_id' => $ansch->id, 'rule' => 'required')); $rules = Rule::create(array('inputrule_id' => $ansch->id, 'rule' => 'regex:/^\\d+\\s*[a-zA-Z]*$/')); $rules = Rule::create(array('inputrule_id' => $ansch->id, 'rule' => 'max:10')); $ansch = Inputrule::create(array('formular_id' => $formular_ansch->id, 'name' => 'ObjAdrWe')); $rules = Rule::create(array('inputrule_id' => $ansch->id, 'rule' => 'max:30')); $ansch = Inputrule::create(array('formular_id' => $formular_ansch->id, 'name' => 'ObjAdrFlur')); $rules = Rule::create(array('inputrule_id' => $ansch->id, 'rule' => 'max:30')); //sparten $ansch = Inputrule::create(array('formular_id' => $formular_ansch->id, 'name' => 'stromAnzahlZaehler')); $rules = Rule::create(array('inputrule_id' => $ansch->id, 'rule' => 'required')); $rules = Rule::create(array('inputrule_id' => $ansch->id, 'rule' => 'digits_between:0,4')); $ansch = Inputrule::create(array('formular_id' => $formular_ansch->id, 'name' => 'stromArtZaehler')); $rules = Rule::create(array('inputrule_id' => $ansch->id, 'rule' => 'required')); $ansch = Inputrule::create(array('formular_id' => $formular_ansch->id, 'name' => 'stromGesamtleistung')); $rules = Rule::create(array('inputrule_id' => $ansch->id, 'rule' => 'required')); $rules = Rule::create(array('inputrule_id' => $ansch->id, 'rule' => 'digits_between:0,11')); $ansch = Inputrule::create(array('formular_id' => $formular_ansch->id, 'name' => 'wassernzahlZaehler')); $rules = Rule::create(array('inputrule_id' => $ansch->id, 'rule' => 'required')); $rules = Rule::create(array('inputrule_id' => $ansch->id, 'rule' => 'digits_between:0,4')); $ansch = Inputrule::create(array('formular_id' => $formular_ansch->id, 'name' => 'wasserGesamtleistung')); $rules = Rule::create(array('inputrule_id' => $ansch->id, 'rule' => 'required')); $rules = Rule::create(array('inputrule_id' => $ansch->id, 'rule' => 'digits_between:0,11')); $ansch = Inputrule::create(array('formular_id' => $formular_ansch->id, 'name' => 'gasAnzahlZaehler')); $rules = Rule::create(array('inputrule_id' => $ansch->id, 'rule' => 'required')); $rules = Rule::create(array('inputrule_id' => $ansch->id, 'rule' => 'digits_between:0,4')); $ansch = Inputrule::create(array('formular_id' => $formular_ansch->id, 'name' => 'gasGesamtleistung')); $rules = Rule::create(array('inputrule_id' => $ansch->id, 'rule' => 'required')); $rules = Rule::create(array('inputrule_id' => $ansch->id, 'rule' => 'digits_between:0,11')); $ansch = Inputrule::create(array('formular_id' => $formular_ansch->id, 'name' => 'sparreq')); $rules = Rule::create(array('inputrule_id' => $ansch->id, 'rule' => 'required')); //anlagen $formular_inbet = Formular::create(array('name' => 'inbet')); //Kundendaten $inbet = Inputrule::create(array('formular_id' => $formular_inbet->id, 'name' => 'KdnFirmenNam')); $rules = Rule::create(array('inputrule_id' => $inbet->id, 'rule' => 'required')); $rules = Rule::create(array('inputrule_id' => $inbet->id, 'rule' => 'max:40')); $inbet = Inputrule::create(array('formular_id' => $formular_inbet->id, 'name' => 'KdnVorNam')); $rules = Rule::create(array('inputrule_id' => $inbet->id, 'rule' => 'required')); $rules = Rule::create(array('inputrule_id' => $inbet->id, 'rule' => 'max:40')); $inbet = Inputrule::create(array('formular_id' => $formular_inbet->id, 'name' => 'KdnNachNam')); $rules = Rule::create(array('inputrule_id' => $inbet->id, 'rule' => 'required')); $rules = Rule::create(array('inputrule_id' => $inbet->id, 'rule' => 'max:40')); $inbet = Inputrule::create(array('formular_id' => $formular_inbet->id, 'name' => 'KdnPlz')); $rules = Rule::create(array('inputrule_id' => $inbet->id, 'rule' => 'required')); $rules = Rule::create(array('inputrule_id' => $inbet->id, 'rule' => 'digits:5')); $inbet = Inputrule::create(array('formular_id' => $formular_inbet->id, 'name' => 'KdnOrt')); $rules = Rule::create(array('inputrule_id' => $inbet->id, 'rule' => 'required')); $rules = Rule::create(array('inputrule_id' => $inbet->id, 'rule' => 'max:40')); $inbet = Inputrule::create(array('formular_id' => $formular_inbet->id, 'name' => 'KdnStr')); $rules = Rule::create(array('inputrule_id' => $inbet->id, 'rule' => 'required')); $rules = Rule::create(array('inputrule_id' => $inbet->id, 'rule' => 'max:40')); $inbet = Inputrule::create(array('formular_id' => $formular_inbet->id, 'name' => 'KdnHausNr')); $rules = Rule::create(array('inputrule_id' => $inbet->id, 'rule' => 'required')); $rules = Rule::create(array('inputrule_id' => $inbet->id, 'rule' => 'regex:/^\\d+\\s*[a-zA-Z]*$/')); $rules = Rule::create(array('inputrule_id' => $inbet->id, 'rule' => 'max:10')); $inbet = Inputrule::create(array('formular_id' => $formular_inbet->id, 'name' => 'KdnTel')); $rules = Rule::create(array('inputrule_id' => $inbet->id, 'rule' => 'alpha_dash')); $rules = Rule::create(array('inputrule_id' => $inbet->id, 'rule' => 'max:30')); //Kundendaten_eigentuemer $inbet = Inputrule::create(array('formular_id' => $formular_inbet->id, 'name' => 'EigtFirmenNam')); $rules = Rule::create(array('inputrule_id' => $inbet->id, 'rule' => 'required')); $rules = Rule::create(array('inputrule_id' => $inbet->id, 'rule' => 'max:40')); $inbet = Inputrule::create(array('formular_id' => $formular_inbet->id, 'name' => 'EigtVorNam')); $rules = Rule::create(array('inputrule_id' => $inbet->id, 'rule' => 'required')); $rules = Rule::create(array('inputrule_id' => $inbet->id, 'rule' => 'max:40')); $inbet = Inputrule::create(array('formular_id' => $formular_inbet->id, 'name' => 'EigtNachNam')); $rules = Rule::create(array('inputrule_id' => $inbet->id, 'rule' => 'required')); $rules = Rule::create(array('inputrule_id' => $inbet->id, 'rule' => 'max:40')); $inbet = Inputrule::create(array('formular_id' => $formular_inbet->id, 'name' => 'EigtPlz')); $rules = Rule::create(array('inputrule_id' => $inbet->id, 'rule' => 'required')); $rules = Rule::create(array('inputrule_id' => $inbet->id, 'rule' => 'digits:5')); $inbet = Inputrule::create(array('formular_id' => $formular_inbet->id, 'name' => 'EigtOrt')); $rules = Rule::create(array('inputrule_id' => $inbet->id, 'rule' => 'required')); $rules = Rule::create(array('inputrule_id' => $inbet->id, 'rule' => 'max:40')); $inbet = Inputrule::create(array('formular_id' => $formular_inbet->id, 'name' => 'EigtStr')); $rules = Rule::create(array('inputrule_id' => $inbet->id, 'rule' => 'required')); $rules = Rule::create(array('inputrule_id' => $inbet->id, 'rule' => 'max:40')); $inbet = Inputrule::create(array('formular_id' => $formular_inbet->id, 'name' => 'EigtHausNr')); $rules = Rule::create(array('inputrule_id' => $inbet->id, 'rule' => 'required')); $rules = Rule::create(array('inputrule_id' => $inbet->id, 'rule' => 'regex:/^\\d+\\s*[a-zA-Z]*$/')); $rules = Rule::create(array('inputrule_id' => $inbet->id, 'rule' => 'max:10')); $inbet = Inputrule::create(array('formular_id' => $formular_inbet->id, 'name' => 'EigtTel')); $rules = Rule::create(array('inputrule_id' => $inbet->id, 'rule' => 'alpha_dash')); $rules = Rule::create(array('inputrule_id' => $inbet->id, 'rule' => 'max:30')); // objektdaten $inbet = Inputrule::create(array('formular_id' => $formular_inbet->id, 'name' => 'bedarfsart')); $rules = Rule::create(array('inputrule_id' => $inbet->id, 'rule' => 'required')); $rules = Rule::create(array('inputrule_id' => $inbet->id, 'rule' => 'digits:1')); $inbet = Inputrule::create(array('formular_id' => $formular_inbet->id, 'name' => 'ObjAdrPlz')); $rules = Rule::create(array('inputrule_id' => $inbet->id, 'rule' => 'required')); $rules = Rule::create(array('inputrule_id' => $inbet->id, 'rule' => 'digits:5')); $inbet = Inputrule::create(array('formular_id' => $formular_inbet->id, 'name' => 'ObjAdrOrt')); $rules = Rule::create(array('inputrule_id' => $inbet->id, 'rule' => 'required')); $rules = Rule::create(array('inputrule_id' => $inbet->id, 'rule' => 'max:40')); $inbet = Inputrule::create(array('formular_id' => $formular_inbet->id, 'name' => 'ObjAdrStr')); $rules = Rule::create(array('inputrule_id' => $inbet->id, 'rule' => 'required')); $rules = Rule::create(array('inputrule_id' => $inbet->id, 'rule' => 'max:40')); $inbet = Inputrule::create(array('formular_id' => $formular_inbet->id, 'name' => 'ObjAdrNr')); $rules = Rule::create(array('inputrule_id' => $inbet->id, 'rule' => 'required')); $rules = Rule::create(array('inputrule_id' => $inbet->id, 'rule' => 'regex:/^\\d+\\s*[a-zA-Z]*$/')); $rules = Rule::create(array('inputrule_id' => $inbet->id, 'rule' => 'max:10')); $inbet = Inputrule::create(array('formular_id' => $formular_inbet->id, 'name' => 'ObjAdrWe')); $rules = Rule::create(array('inputrule_id' => $inbet->id, 'rule' => 'max:30')); $inbet = Inputrule::create(array('formular_id' => $formular_inbet->id, 'name' => 'ObjAdrFlur')); $rules = Rule::create(array('inputrule_id' => $inbet->id, 'rule' => 'max:30')); //sparten $inbet = Inputrule::create(array('formular_id' => $formular_inbet->id, 'name' => 'stromAnzahlZaehler')); $rules = Rule::create(array('inputrule_id' => $inbet->id, 'rule' => 'required')); $rules = Rule::create(array('inputrule_id' => $inbet->id, 'rule' => 'digits_between:0,4')); $inbet = Inputrule::create(array('formular_id' => $formular_inbet->id, 'name' => 'stromArtZaehler')); $rules = Rule::create(array('inputrule_id' => $inbet->id, 'rule' => 'required')); $inbet = Inputrule::create(array('formular_id' => $formular_inbet->id, 'name' => 'stromGesamtleistung')); $rules = Rule::create(array('inputrule_id' => $inbet->id, 'rule' => 'required')); $rules = Rule::create(array('inputrule_id' => $inbet->id, 'rule' => 'digits_between:0,11')); $inbet = Inputrule::create(array('formular_id' => $formular_inbet->id, 'name' => 'wassernzahlZaehler')); $rules = Rule::create(array('inputrule_id' => $inbet->id, 'rule' => 'required')); $rules = Rule::create(array('inputrule_id' => $inbet->id, 'rule' => 'digits_between:0,4')); $inbet = Inputrule::create(array('formular_id' => $formular_inbet->id, 'name' => 'wasserGesamtleistung')); $rules = Rule::create(array('inputrule_id' => $inbet->id, 'rule' => 'required')); $rules = Rule::create(array('inputrule_id' => $inbet->id, 'rule' => 'digits_between:0,11')); $inbet = Inputrule::create(array('formular_id' => $formular_inbet->id, 'name' => 'gasAnzahlZaehler')); $rules = Rule::create(array('inputrule_id' => $inbet->id, 'rule' => 'required')); $rules = Rule::create(array('inputrule_id' => $inbet->id, 'rule' => 'digits_between:0,4')); $inbet = Inputrule::create(array('formular_id' => $formular_inbet->id, 'name' => 'sparreq')); $rules = Rule::create(array('inputrule_id' => $inbet->id, 'rule' => 'required')); //anlagen }
public function testCreateThrowsException() { $this->setExpectedException('Exception', 'All Rule class extensions should implement the Rule::create() method'); Rule::create(); }
/** * @param $fields * @return mixed * @throws Sentry\SentryException */ public function create_base_rules($fields) { $rule = Rule::create($fields); if ($rule === false) { throw new Sentry\SentryException(); } return $rule->id; }