protected function execute(ConduitAPIRequest $request) { $property = new DifferentialDiffProperty(); $property->setDiffID($request->getValue('diff_id')); $property->setName($request->getValue('name')); $property->setData(json_decode($request->getValue('data'), true)); $property->save(); return; }
private static function updateDiffProperty($diff_id, $name, $data) { $property = id(new DifferentialDiffProperty())->loadOneWhere('diffID = %d AND name = %s', $diff_id, $name); if (!$property) { $property = new DifferentialDiffProperty(); $property->setDiffID($diff_id); $property->setName($name); } $property->setData($data); $property->save(); return $property; }