Order
extends Model
in package
Uses
Validation
Thiocyn\Orders\Models\Order
Tags
Table of Contents
- $ : Customer
- $belongsTo : mixed
- $billing_address : mixed|null
- $channel : string
- $created_at : Carbon|null
- $customer_id : int
- $dispatch_method : string|null
- $external_id : string
- $id : int
- $import_date : Carbon|null
- $invoice_amount : float
- $invoice_amount_net : float
- $invoice_date : string|null
- $invoice_shipping : float
- $invoice_shipping_net : float
- $invoice_shipping_tax_rate : float|null
- $json : mixed|null
- $number : string
- $ordertime : Carbon
- $payment_method : string|null
- $rules : array<string|int, mixed>
- $shipping_address : mixed|null
- $shipping_date : string|null
- $table : string
- $type : string
- $updated_at : Carbon|null
- $dates : mixed
- $jsonable : mixed
- $validationDefaultAttrNames : array<string|int, mixed>
- $validationErrors : MessageBag
- all() :
- bootValidation() : void
- Boot the validation trait for this model.
- errors() : MessageBag
- Get validation error message collection for the Model
- forceSave() : bool
- Force save the model even if validation fails.
- get() :
- getOrCreateFromNetsuiteByNumber() : Order|null
- isAttributeRequired() : bool
- Determines if an attribute is required based on the validation rules.
- loadAndSaveFromNetsuiteByNumber() : Order|null
- loadFromNetsuiteByNumber() : Order|null
- newModelQuery() :
- newQuery() :
- query() :
- setValidationAttributeName() : void
- Programatically sets the validation attribute names, will take lower priority to model defined attribute names found in `$attributeNames`.
- setValidationAttributeNames() : void
- Programatically sets multiple validation attribute names.
- updateInvoiceDate() : mixed
- updateShippingDate() : mixed
- validate() : bool
- Validate the model instance
- validated() : void
- Create a new native event for handling afterValidate().
- validating() : void
- Create a new native event for handling beforeValidate().
- whereBillingAddress() :
- whereChannel() :
- whereCreatedAt() :
- whereCustomerId() :
- whereDispatchMethod() :
- whereExternalId() :
- whereId() :
- whereImportDate() :
- whereInvoiceAmount() :
- whereInvoiceAmountNet() :
- whereInvoiceDate() :
- whereInvoiceShipping() :
- whereInvoiceShippingNet() :
- whereInvoiceShippingTaxRate() :
- whereJson() :
- whereNumber() :
- whereOrdertime() :
- wherePaymentMethod() :
- whereShippingAddress() :
- whereShippingDate() :
- whereType() :
- whereUpdatedAt() :
- getRelationValidationValue() : mixed
- Attachments validate differently to their simple values.
- getValidationAttributes() : array<string|int, mixed>
- Returns the model data used for validation.
- makeValidator() : Validator
- Instantiates the validator used by the validation process, depending if the class is being used inside or outside of Laravel. Optional connection string to make the validator use a different database connection than the default connection.
- processRuleFieldNames() : array<string|int, mixed>
- Processes field names in a rule array.
- processValidationRules() : mixed
- Process rules
- processValidationUniqueRule() : string
- Rebuilds the unique validation rule to force for the existing ID
Properties
$
public
Customer
$
customer
$belongsTo
public
mixed
$belongsTo
= ['customer' => ThiocynCustomersModelsCustomer::class]
$billing_address
public
mixed|null
$billing_address
$channel
public
string
$channel
$created_at
public
Carbon|null
$created_at
$customer_id
public
int
$customer_id
$dispatch_method
public
string|null
$dispatch_method
$external_id
public
string
$external_id
$id
public
int
$id
$import_date
public
Carbon|null
$import_date
$invoice_amount
public
float
$invoice_amount
$invoice_amount_net
public
float
$invoice_amount_net
$invoice_date
public
string|null
$invoice_date
$invoice_shipping
public
float
$invoice_shipping
$invoice_shipping_net
public
float
$invoice_shipping_net
$invoice_shipping_tax_rate
public
float|null
$invoice_shipping_tax_rate
$json
public
mixed|null
$json
$number
public
string
$number
$ordertime
public
Carbon
$ordertime
$payment_method
public
string|null
$payment_method
$rules
public
array<string|int, mixed>
$rules
= []
Validation rules
$shipping_address
public
mixed|null
$shipping_address
$shipping_date
public
string|null
$shipping_date
$table
public
string
$table
= 'thiocyn_orders'
The database table used by the model.
$type
public
string
$type
$updated_at
public
Carbon|null
$updated_at
$dates
protected
mixed
$dates
= ['ordertime', 'import_date']
$jsonable
protected
mixed
$jsonable
= ['billing_address', 'shipping_address', 'json']
$validationDefaultAttrNames
protected
array<string|int, mixed>
$validationDefaultAttrNames
= []
Default custom attribute names.
$validationErrors
protected
MessageBag
$validationErrors
The message bag instance containing validation error messages
Methods
all()
public
static all(mixed $columns) :
Parameters
- $columns : mixed
Return values
—bootValidation()
Boot the validation trait for this model.
public
static bootValidation() : void
Return values
void —errors()
Get validation error message collection for the Model
public
errors() : MessageBag
Return values
MessageBag —forceSave()
Force save the model even if validation fails.
public
forceSave([mixed $options = null ][, mixed $sessionKey = null ]) : bool
Parameters
- $options : mixed = null
- $sessionKey : mixed = null
Return values
bool —get()
public
static get(mixed $columns) :
Parameters
- $columns : mixed
Return values
—getOrCreateFromNetsuiteByNumber()
public
static getOrCreateFromNetsuiteByNumber( $number) : Order|null
Parameters
Return values
Order|null —isAttributeRequired()
Determines if an attribute is required based on the validation rules.
public
isAttributeRequired(string $attribute[, bool $checkDependencies = true ]) : bool
Parameters
- $attribute : string
- $checkDependencies : bool = true
-
Checks the attribute dependencies (for required_if & required_with rules). Note that it will only be checked up to the next level, if another dependent rule is found then it will just assume the field is required
Return values
bool —loadAndSaveFromNetsuiteByNumber()
public
static loadAndSaveFromNetsuiteByNumber( $number) : Order|null
Parameters
Tags
Return values
Order|null —loadFromNetsuiteByNumber()
public
static loadFromNetsuiteByNumber( $number) : Order|null
Parameters
Tags
Return values
Order|null —newModelQuery()
public
static newModelQuery() :
Return values
—newQuery()
public
static newQuery() :
Return values
—query()
public
static query() :
Return values
—setValidationAttributeName()
Programatically sets the validation attribute names, will take lower priority to model defined attribute names found in `$attributeNames`.
public
setValidationAttributeName(string $attr, string $name) : void
Parameters
- $attr : string
- $name : string
Return values
void —setValidationAttributeNames()
Programatically sets multiple validation attribute names.
public
setValidationAttributeNames(array<string|int, mixed> $attributeNames) : void
Parameters
- $attributeNames : array<string|int, mixed>
Return values
void —updateInvoiceDate()
public
updateInvoiceDate([mixed $force = false ]) : mixed
Parameters
- $force : mixed = false
Return values
mixed —updateShippingDate()
public
updateShippingDate([mixed $force = false ]) : mixed
Parameters
- $force : mixed = false
Return values
mixed —validate()
Validate the model instance
public
validate([mixed $rules = null ][, mixed $customMessages = null ][, mixed $attributeNames = null ]) : bool
Parameters
- $rules : mixed = null
- $customMessages : mixed = null
- $attributeNames : mixed = null
Return values
bool —validated()
Create a new native event for handling afterValidate().
public
static validated(Closure|string $callback) : void
Parameters
- $callback : Closure|string
Return values
void —validating()
Create a new native event for handling beforeValidate().
public
static validating(Closure|string $callback) : void
Parameters
- $callback : Closure|string
Return values
void —whereBillingAddress()
public
static whereBillingAddress(mixed $value) :
Parameters
- $value : mixed
Return values
—whereChannel()
public
static whereChannel(mixed $value) :
Parameters
- $value : mixed
Return values
—whereCreatedAt()
public
static whereCreatedAt(mixed $value) :
Parameters
- $value : mixed
Return values
—whereCustomerId()
public
static whereCustomerId(mixed $value) :
Parameters
- $value : mixed
Return values
—whereDispatchMethod()
public
static whereDispatchMethod(mixed $value) :
Parameters
- $value : mixed
Return values
—whereExternalId()
public
static whereExternalId(mixed $value) :
Parameters
- $value : mixed
Return values
—whereId()
public
static whereId(mixed $value) :
Parameters
- $value : mixed
Return values
—whereImportDate()
public
static whereImportDate(mixed $value) :
Parameters
- $value : mixed
Return values
—whereInvoiceAmount()
public
static whereInvoiceAmount(mixed $value) :
Parameters
- $value : mixed
Return values
—whereInvoiceAmountNet()
public
static whereInvoiceAmountNet(mixed $value) :
Parameters
- $value : mixed
Return values
—whereInvoiceDate()
public
static whereInvoiceDate(mixed $value) :
Parameters
- $value : mixed
Return values
—whereInvoiceShipping()
public
static whereInvoiceShipping(mixed $value) :
Parameters
- $value : mixed
Return values
—whereInvoiceShippingNet()
public
static whereInvoiceShippingNet(mixed $value) :
Parameters
- $value : mixed
Return values
—whereInvoiceShippingTaxRate()
public
static whereInvoiceShippingTaxRate(mixed $value) :
Parameters
- $value : mixed
Return values
—whereJson()
public
static whereJson(mixed $value) :
Parameters
- $value : mixed
Return values
—whereNumber()
public
static whereNumber(mixed $value) :
Parameters
- $value : mixed
Return values
—whereOrdertime()
public
static whereOrdertime(mixed $value) :
Parameters
- $value : mixed
Return values
—wherePaymentMethod()
public
static wherePaymentMethod(mixed $value) :
Parameters
- $value : mixed
Return values
—whereShippingAddress()
public
static whereShippingAddress(mixed $value) :
Parameters
- $value : mixed
Return values
—whereShippingDate()
public
static whereShippingDate(mixed $value) :
Parameters
- $value : mixed
Return values
—whereType()
public
static whereType(mixed $value) :
Parameters
- $value : mixed
Return values
—whereUpdatedAt()
public
static whereUpdatedAt(mixed $value) :
Parameters
- $value : mixed
Return values
—getRelationValidationValue()
Attachments validate differently to their simple values.
protected
getRelationValidationValue(mixed $relationName) : mixed
Parameters
- $relationName : mixed
Return values
mixed —getValidationAttributes()
Returns the model data used for validation.
protected
getValidationAttributes() : array<string|int, mixed>
Return values
array<string|int, mixed> —makeValidator()
Instantiates the validator used by the validation process, depending if the class is being used inside or outside of Laravel. Optional connection string to make the validator use a different database connection than the default connection.
protected
static makeValidator(mixed $data, mixed $rules, mixed $customMessages, mixed $attributeNames[, mixed $connection = null ]) : Validator
Parameters
- $data : mixed
- $rules : mixed
- $customMessages : mixed
- $attributeNames : mixed
- $connection : mixed = null
Return values
Validator —processRuleFieldNames()
Processes field names in a rule array.
protected
processRuleFieldNames(array<string|int, mixed> $rules) : array<string|int, mixed>
Converts any field names using array notation (ie. field[child]) into dot notation (ie. field.child)
Parameters
- $rules : array<string|int, mixed>
-
Rules array
Return values
array<string|int, mixed> —processValidationRules()
Process rules
protected
processValidationRules(mixed $rules) : mixed
Parameters
- $rules : mixed
Return values
mixed —processValidationUniqueRule()
Rebuilds the unique validation rule to force for the existing ID
protected
processValidationUniqueRule(string $definition, string $fieldName) : string
Parameters
- $definition : string
- $fieldName : string