['name' => 'riskmngmt_risk_object_id', 'type' => 'int', 'internal' => 'id'], 'riskmngmt_risk_object_name' => ['name' => 'riskmngmt_risk_object_name', 'type' => 'string', 'internal' => 'title'], 'riskmngmt_risk_object_description' => ['name' => 'riskmngmt_risk_object_description', 'type' => 'string', 'internal' => 'description'], 'riskmngmt_risk_object_descriptionraw' => ['name' => 'riskmngmt_risk_object_descriptionraw', 'type' => 'string', 'internal' => 'descriptionRaw'], 'riskmngmt_risk_object_risk' => ['name' => 'riskmngmt_risk_object_risk', 'type' => 'int', 'internal' => 'risk'], ]; protected static $belongsTo = [ 'unit' => [ 'mapper' => RiskMapper::class, 'dest' => 'riskmngmt_risk_object_risk', ], ]; /** * Primary table. * * @var string * @since 1.0.0 */ protected static $table = 'riskmngmt_risk_object'; /** * Primary field name. * * @var string * @since 1.0.0 */ protected static $primaryField = 'riskmngmt_risk_object_id'; /** * Create object. * * @param mixed $obj Object * @param int $relations Behavior for relations creation * * @return mixed * * @since 1.0.0 */ public static function create($obj, int $relations = RelationType::ALL) { try { $objId = parent::create($obj, $relations); if($objId === null || !is_scalar($objId)) { return $objId; } } catch (\Exception $e) { var_dump($e->getMessage()); return false; } return $objId; } /** * Get object. * * @param mixed $primaryKey Key * @param int $relations Load relations * @param mixed $fill Object to fill * * @return Cause * * @since 1.0.0 */ public static function get($primaryKey, int $relations = RelationType::ALL, $fill = null) { return parent::get($primaryKey, $relations, $fill); } }