pinia-orm
Version:
The Pinia plugin to enable Object-Relational Mapping access to the Pinia Store.
61 lines (59 loc) • 1.01 kB
JavaScript
class CastAttribute {
/**
* The model instance.
*/
static attributes;
/**
* Cast parameters
*/
static parameters;
/**
* Default parameters
*/
$parameters = {};
/**
* Create a new Attribute instance.
*/
constructor(attributes) {
this.$self().attributes = attributes;
this.$parameters = {
...this.$parameters,
...this.$self().parameters
};
}
/**
* Get the value for return.
*/
get(value) {
return value;
}
/**
* Set the value for the store.
*/
set(value) {
return value;
}
static withParameters(parameters) {
this.parameters = parameters;
return this;
}
/**
* Get the cast parameters
*/
getParameters() {
return this.$parameters;
}
/**
* Get the constructor for this cast.
*/
$self() {
return this.constructor;
}
/**
* Generate new instance of cast
*/
static newRawInstance(attributes) {
return new this(attributes);
}
}
export { CastAttribute as C };