value] * $fields will be like [key=>array( 'type'=> '', 'value'=> '')] */ public static function sanitize($data, $fields) { } protected static function deepSanitize($value) { } public static function sanitizeTextAll($data = []) { } /** * to get dynamic select search by any query params for settings page */ public static function getSearchOptions($data) { } /** * * * @param array $val * @param array $stack * @param array|string $def * @return array|string[] */ // public static function getArrValWithinEnum(array $val, array $stack, $def = ''): array // { // $ret = []; // // if (empty($val)) { // // return []; // } // // foreach ($val as $item) { // if (in_array($item, $stack)) { // $ret[] = $item; // } // } // // if (empty($ret)) { // // if (is_array($def)) { // // return $def; // } // // return [$def]; // } // // return $ret; // } } } namespace FluentCart\Api\Invokable { class DummyProduct { public function __invoke($app, $params) { } } class ImageAttach { public function __invoke($app, $params) { } } } namespace FluentCart\Api { class Meta { /** * * @param $productId * @return array */ public static function getProductGallery($productId) { } /** * @param $productId * @param $data * @return mixed */ public static function updateProductGallery($productId, $data) { } /** * * @param $productId * @param $pic * @return mixed */ public static function setProductThumbnail($productId, $pic) { } /** * * @param $productId * @return string */ public static function getProductThumbnail($productId) { } public static function getProductVariationMedia($varId) { } public static function saveVariationMedia($varId, $val) { } public static function deleteVariationMedia($varId) { } } class ModuleSettings { const MODULE_SETTINGS_OPTION = 'fluent_cart_modules_settings'; public static function isActive($moduleName = '') { } public static function fileds() { } public static function saveSettings(array $data) { } public static function getAllSettings($cached = true) { } public static function getSettings($key = null) { } public static function validKeys(): array { } } trait SanitizerTrait { protected $rules = []; protected function sanitize($orderItem) { } } class OrderItems { use \FluentCart\Api\SanitizerTrait; public function __construct() { } public function setOtherInfoAttribute($value) { } public function getOtherInfoAttribute($value) { } public function setLineMetaAttribute($value) { } public function getLineMetaAttribute($value) { } /** * @param $orderId * @return array */ public function getItems($orderId) { } /** * * @param $orderId * @param $items * @return array * @throws \Exception */ public function updateOrInsertOrderItems($orderId, $items): array { } public static function getTopProductsSold($queryParams) { } } class OrderMetaApi { /** * * @param $orderId * @param $val * @return bool */ public static function updateDiscountMeta($orderId, $val): bool { } /** * * @param $orderId * @param $val * @return bool */ public static function updateShippingMeta($orderId, $val): bool { } /** * * @param $orderId * @return mixed|string */ public static function getDiscountMeta($orderId) { } /** * * @param $orderId * @return mixed|string */ public static function getShippingMeta($orderId) { } /** * Alias of all * @param $orderId * @return null */ protected function all($orderId) { } /** * * @param $orderId * @param $meta_key * @param $meta_value * @return bool */ public function update($orderId, $meta_key, $meta_value) { } /** * * @param $orderId * @return mixed */ public function getAll($orderId) { } /** * * @param $key * @param $orderId * @return mixed */ protected function getMetaByKey($key, $orderId, $def = '') { } /** * * @param $method * @param $arguments * @return mixed */ public static function __callStatic($method, $arguments) { } } class Orders { /** * @return array $orders * * It will return all order lists by query passed * */ public function get($params) { } public function getByHash($hash) { } /** * @param array $data array of order details * @return string ID of order created * * Will create order with blank order items */ public function create($data) { } /** * * @param \FluentCart\App\Models\Order $order * @param $orderData - will be the order updated data array * @param $deleteItems * @return array * @throws \Exception */ public function update($order, $orderData, $deleteItems = [], $discount = '', $shipping = '') { } public function getBy(string $column, $value) { } public function getById($id) { } } class PaymentMethods { /** * @return array * * All payment methods * @throws \Exception */ public function getAll(): array { } public static function getLogos(): array { } public static function getIcons(): array { } /** * @return array * * All active payment methods */ public static function getActiveMethodInstance($cart = null): array { } public static function getActiveMeta(): array { } /** * @param string $method name like stripe, PayPal etc * Get payment method to connect info if any method uses connecting * @return array * */ public function getConnectInfo($method) { } } } namespace FluentCart\Api\Resource { abstract class BaseResourceApi { /** * Request Instance * @var \FluentCart\Framework\Http\Response\Response $response */ protected $response = null; public static function __callStatic($method, $params) { } public function __construct() { } /* * @return mixed */ abstract public static function get(array $params = []); abstract public static function find($id, $params = []); private static function findUsing($query): \FluentCart\Framework\Database\Orm\Builder { } public static function search($query, ?callable $modifyQueryUsing = null, $asCollection = false) { } abstract public static function create($data, $params = []); abstract public static function update($data, $id, $params = []); abstract public static function delete($id, $params = []); abstract static function getQuery(): \FluentCart\Framework\Database\Orm\Builder; /** * @param $errors array|string = [ * [ * 'code' => string|int, * 'message' => string, * 'data' => Optional. Error data. Default empty string. * ], * string * ] * @return \WP_Error */ public static function makeErrorResponse($errors): \WP_Error { } /** * @param string $message * @param mixed $data * @return array */ public static function makeSuccessResponse($data, string $message): array { } } class ActivityResource extends \FluentCart\Api\Resource\BaseResourceApi { public static function get(array $params = []) { } public static function find($id, $params = []) { } public static function create($data, $params = []) { } public static function update($data, $id, $params = []) { } public static function delete($id, $params = []) { } static function getQuery(): \FluentCart\Framework\Database\Orm\Builder { } } /** * Class CouponResource * * @package FluentCart\Api\Resource */ class AppliedCouponResource extends \FluentCart\Api\Resource\BaseResourceApi { /** * Get the query builder instance for the Coupons model. * * @return \FluentCart\Framework\Database\Orm\Builder */ public static function getQuery(): \FluentCart\Framework\Database\Orm\Builder { } /** * Retrieve order meta based on the provided parameters. * * @param array $params Optional. Additional parameters for data retrieval. * [ * 'order_id' => ( int ) Required. The ID of the order to filter the data. * ] * */ public static function get(array $params = []) { } /** * Create order meta data with the provided information. * * @param array $data Required. Array containing the necessary parameters for data creation. * [ * // Include required parameters for creating the data. * ] * @param array $params Optional. Additional parameters for data creation. * [ * // Include optional parameters, if any. * ] * */ public static function find($id, $params = []) { } public static function create($data, $params = []) { } public static function createOrUpdate($data, $id) { } public static function update($data, $id = null, $params = []) { } public static function deleteRemovedCoupons($appliedCoupons, $orderId) { } public static function delete($id, $params = []) { } public static function bulkDeleteByOrderIds($ids, $params = []) { } } } namespace FluentCart\App\Helpers { /** * todo - need to consult with heera bhai regarding the approach of these common functions * */ trait HelperTrait { private static array $orderByEnum = ['ASC', 'DESC']; /** * * @param $val * @param $stack * @param $def * @return mixed|string */ private static function getValWithinEnum($val, $stack, $def = '') { } /** * * * @param array $val * @param array $stack * @param array|string $def * @return array|string[] */ private static function getArrValWithinEnum(array $val, array $stack, $def = ''): array { } } } namespace FluentCart\Api\Resource { class AttrGroupResource extends \FluentCart\Api\Resource\BaseResourceApi { use \FluentCart\App\Helpers\HelperTrait; public static function getQuery(): \FluentCart\Framework\Database\Orm\Builder { } public static function get(array $params = []) { } public static function find($id, $params = []) { } public static function create($data, $params = []) { } public static function update($data, $groupId, $params = []) { } /** * Generate a unique slug for a new group. Mirrors AttrTermResource::generateUniqueSlug() * but scoped to the groups table (global slug UNIQUE, not per-group). */ private static function generateUniqueSlug(string $title): string { } /** * MySQL/MariaDB UNIQUE constraint violation detector. SQLSTATE 23000 covers * duplicate-key errors on slug UNIQUE. Used so concurrent inserts/updates * return a clean 422 instead of leaking a generic 500. */ private static function isUniqueViolation(\Throwable $e): bool { } public static function delete($groupId, $params = []) { } /** * Persist the merchant's drag-reorder of attribute groups in the library. * Receives group IDs in the desired display order and writes a dense * serial (1-indexed) to each. Mirrors AttrTermResource::reorder, one level * up — the only difference is there's no parent group to scope ownership * to, so we just confirm every ID is a real group before writing. * * The sidebar paginates (Load More), so the submitted set is the loaded * prefix of the serial-ordered list; reassigning it to 1..k stays within * the prefix's own range and never collides with unloaded groups. */ public static function reorder($params = []) { } } class AttrTermResource extends \FluentCart\Api\Resource\BaseResourceApi { use \FluentCart\App\Helpers\HelperTrait; public static function getQuery(): \FluentCart\Framework\Database\Orm\Builder { } public static function get(array $params = []) { } public static function find($id, $params = []) { } public static function create($data, $params = []) { } public static function update($data, $termId, $params = []) { } public static function delete($termId, $params = []) { } public static function reorder($params = []) { } /** * MySQL/MariaDB UNIQUE constraint violation detector. SQLSTATE 23000 covers * duplicate-key on any UNIQUE index, including the composite (group_id, slug) * on terms and slug on groups. Used so concurrent inserts return a clean 422 * instead of leaking a generic 500. */ private static function isUniqueViolation(\Throwable $e): bool { } /** * Derive a unique slug from an in-memory set of already-taken slugs. * Used by createBulk() so multiple titles can be resolved in one pass * without a DB round-trip per title. */ private static function resolveUniqueSlugFromSet(string $slugBase, array $takenSlugs): string { } /** * Generate a unique slug within a group, ignoring a specific term id (for update). * Mirrors the auto-slug logic in create() so the two endpoints stay in sync. */ private static function generateUniqueSlug(string $title, int $groupId, ?int $ignoreId = null): string { } } /** * Class CouponResource * * @package FluentCart\Api\Resource */ class CouponResource extends \FluentCart\Api\Resource\BaseResourceApi { /** * Get the query builder instance for the Coupons model. * * @return \FluentCart\Framework\Database\Orm\Builder */ public static function getQuery(): \FluentCart\Framework\Database\Orm\Builder { } public static function get(array $params = []) { } public static function find($id, $params = []) { } public static function viewDetails($id) { } public static function create($data, $params = []) { } public static function listCoupon() { } public static function update($data, $id, $params = []) { } public static function delete($id, $params = []) { } private static function formatAmount($data) { } public static function applyCoupon($data, $returnCouponService = true) { } public static function cancelCoupon($data, $returnCouponService = true) { } public static function reapplyCoupon($data, $returnCouponService = true) { } private static function makeCouponFromAppliedCoupons($previouslyAppliedCouponCodes) { } } class CustomerAddressResource extends \FluentCart\Api\Resource\BaseResourceApi { public static function getQuery(): \FluentCart\Framework\Database\Orm\Builder { } /** * Get customer addresses with specified parameters. * * @param array $params Array containing the necessary parameters. * [ * 'customer_id' => (int) Required. The ID of the customer. * 'type' => (string) Optional. The type of address ('billing' by default). * ] * */ public static function get(array $params = []) { } /** * Find customer address based on the given ID and parameters. * * @param int $id Required. The ID of the customer. * @param array $params Optional. Array containing the necessary parameters. * [ * 'type' => (string) Optional. The type of address ('billing' by default). * ] * */ public static function find($id, $params = []) { } /*public static function find($id, $params = []) { return static::getQuery()->find($id); }*/ /** * Create customer address with the given data. * * @param array $data Required. Array containing the necessary parameters * [ * 'email' => (string) Optional. The email of the address. * 'name' => (string) Required. The name of the address. * 'phone' => (string) Required. The phone of the address. * 'address_1' => (string) Required. The primary address line. * 'address_2' => (string) Optional. The secondary address line. * 'city' => (string) Required. The city of the address. * 'country' => (string) Required. The country of the address. * 'postcode' => (string) Required. The postal code of the address. * 'state' => (string) Required. The state of the address. * 'type' => (string) Required. (e.g., 'billing', 'shipping'). * ] * @param array $params Required. Additional parameters for creating an address. * [ * 'id' => (int) Required. The ID of the customer. * ] * */ public static function create($data, $params = []) { } /** * Update the customer address with the given data. * * @param array $data Required. Array containing the necessary parameters * [ * 'Email' => (string) Optional. The email of the address. * 'Name' => (string) Required. The name of the address. * 'Phone' => (string) Required. The phone of the address. * 'Address_1' => (string) Required. The primary address line. * 'Address_2' => (string) Optional. The secondary address line. * 'City' => (string) Required. The city of the address. * 'Country' => (string) Required. The country of the address. * 'Postcode' => (string) Required. The postal code of the address. * 'State' => (string) Required. The state of the address. * 'Type' => (string) Required. (E.g., 'billing', 'shipping'). * ] * @param int $id Required. The ID of the customer address to be updated. * */ public static function update($data, $id, $params = []) { } public static function normalizeBusinessFields(array $data): array { } private static function mergeAddressMetaFields(array $data, ?\FluentCart\App\Models\CustomerAddresses $address = null): array { } /** * Delete an address based on the given ID and parameters. * * @param int $id Required. The ID of the customer address. * @param array $params Optional. Additional parameters for address deletion. * */ public static function delete($id, $params = []) { } /** * Make primary address for the specified customer. * * @param int $customerId Required. The ID of the customer. * @param array $params Optional. Additional parameters for making an address primary. * [ * 'address' => [ * 'id' => (int) Required. The ID of the address to be set as primary. * 'type' => (string) Required. The type of the address (e.g., 'billing', 'shipping'). * ], * ] */ public static function makePrimary($customerId, $addressId, $type) { } } class CustomerResource extends \FluentCart\Api\Resource\BaseResourceApi { /** * Per-request memo for getCurrentCustomer(). In production every HTTP * request runs in a fresh PHP process, so this lives exactly one * request. Long-running processes that simulate multiple requests * (test suites, CLI) must clear it between simulated requests via * resetCurrentCustomerRuntimeCache() — as a function-static it was * unreachable and leaked the first request's customer into every * subsequent one. * * @var object|null */ private static $currentCustomerRuntimeCache = null; public static function resetCurrentCustomerRuntimeCache(): void { } public static function getQuery(): \FluentCart\Framework\Database\Orm\Builder { } /** * Get customers based on specified parameters. * * @param array $params Array containing the necessary parameters. * [ * "params" => (array) Required. * [ * 'search' => (string) Optional.Search Customer. * [ * "column name(e.g., first_name|last_name|email|id)" => [ * column => "column name(e.g., first_name|last_name|email|id)", * operator => "operator (e.g., like_all|rlike|or_rlike|or_like_all)", * value => "value" ] * ], * 'filters' => (string) Optional.Filters customer. * [ * "column name(e.g., first_name|last_name|email)" => [ * column => "column name(e.g., first_name|last_name|email)", * operator => "operator (e.g., between|or_between|like_all|in)", * value => "value" ] * ], * 'order_by' => (string) Optional. Column to order by, * 'order_type' => (string) Optional. Order type for sorting (ASC or DESC), * 'per_page' => (int) Optional. Number of items for per page, * 'page' => (int) Optional. Page number for pagination * ] * ] * */ public static function get(array $params = []) { } /** * Find customer by ID. * * @param int $id Required. The ID of the customer. * @param array $params Optional. Additional parameters for finding a customer. * [ * 'with' => (array) Optional. Relationships name to be eager loaded, * ] * */ public static function find($id, $params = []) { } public static function findOrder($id, $params = []) { } /** * Create a new customer with the given data * * @param array $data Required. Array containing the necessary parameters * [ * 'first_name' => (string) Required. The first name of the customer, * 'last_name' => (string) Optional. The last name of the customer, * 'email' => (string) Required. The email of the customer, * 'city' => (string) Optional. The city of the customer, * 'state' => (string) Optional. The state of the customer, * 'postcode' => (string) Optional. The postal code of the customer, * 'country' => (string) Optional. The country of the customer, * 'wp_user' => (string) Optional. Create customer as WP user, * ] * @param array $params Optional. Additional parameters for creating a customer. * */ public static function create($data, $params = []) { } /** * Update customer with the given data * * @param array $data Required. Array containing the necessary parameters * [ * 'first_name' => (string) Required. The first name of the customer, * 'last_name' => (string) Optional. The last name of the customer, * 'email' => (string) Required. The email of the customer, * 'city' => (string) Optional. The city of the customer, * 'state' => (string) Optional. The state of the customer, * 'postcode' => (string) Optional. The postal code of the customer, * 'country' => (string) Optional. The country of the customer, * ] * @param int $id Required. The ID of the customer. * @param array $params Optional. Additional parameters for creating a customer. * */ public static function update($data, $id, $params = []) { } /** * Delete a customer based on the given ID and parameters. * * @param int $id Optional. The ID of the customer. * @param array $params Optional. Additional parameters for deleting multiple customers. * [ * 'ids' => (array) Required. The array of customer IDs to be deleted. * ] * */ public static function delete($id, $params = []) { } /** * Update customer additional information with the given data * * @param array $data Required. Array containing the necessary parameters * [ * 'labels' => (array) Required. The id of the labels, * ] * @param int $id Required. The ID of the customer. * @param array $params Optional. Additional parameters for updating a customer info. * */ public static function updateAdditionalInfo($data, $id, $params = []) { } /** * Update the status of multiple customers with the given parameters. * * @param array $params Optional. Array containing the necessary parameters * [ * 'new_status' => (string) Required. The new status to be set for the customers. * 'customer_ids' => (array) Required. Customer IDs whose status will be updated. * ] * */ public static function updateStatus($params = []) { } /** * Manage customers based on the provided action and customer IDs. * * @param array $params Optional. Array containing the necessary parameters * [ * 'action' => (string) Required. The action to be performed on the selected customers. * (e.g., Possible values: 'delete_customers', 'change_customer_status') * 'customer_ids' => (array) Required. Customer IDs whose action will be performed. * ] * */ public static function manageCustomer($params = []) { } public static function getCurrentCustomer(bool $createIfNotExists = false): ?object { } private static function resolveCustomerName(array $data): array { } private static function updateUser($data, $userId) { } } class FluentMetaResource extends \FluentCart\Api\Resource\BaseResourceApi { public static function getQuery(): \FluentCart\Framework\Database\Orm\Builder { } /** * Get meta based on the provided parameters. * * @param array $params Array containing the necessary parameters. * [ * 'meta_key' => (string) Required. The meta key to retrieve data. * 'default' => (mixed) Optional. Default value to return if data is not found. * ] * */ public static function get(array $params = []) { } public static function find($id, $params = []) { } public static function create($data, $params = []) { } /** * Update metadata with the given data * * @param array $data Required. Array containing the necessary parameters. * [ * 'meta_key' => (string) Required. The key of the metadata. * 'meta_value' => (mixed) Required. The value of the metadata. * 'type' => (string) Optional. The type of the object. * ] * @param int $id Required. The ID of the product for which metadata is updated. * @param array $params Optional. Additional parameters for updating metadata. * [ * // Include optional parameters, if any. * ] * */ public static function update($data, $id, $params = []) { } public static function delete($id, $params = []) { } } } namespace FluentCart\Api\Resource\FrontendResource { class CartResource extends \FluentCart\Api\Resource\BaseResourceApi { /** * Per-request memo for get(). In production every HTTP request runs in a * fresh PHP process, so this lives exactly one request. Long-running * processes that simulate multiple requests (test suites, CLI) must clear * it between simulated requests via resetCartCache() — as a * function-static it was unreachable and leaked the first request's cart * into every subsequent one. * * Only a resolved Cart is memoized; a null ("no cart") result is * deliberately re-queried on the next call — matching the original * function-static behavior, where isset(null) === false. * * @var \FluentCart\App\Models\Cart|null|false false = not resolved yet */ private static $cartCache = false; public static function resetCartCache(): void { } public static function getQuery(): \FluentCart\Framework\Database\Orm\Builder { } public static function generateCartForInstantCheckout($variationId, $quantity = 1, $params = []) { } /** * Retrieve cart based on the provided parameters. * * This function looks for a cart associated with the provided cart hash. If no cart is found, * it creates a new cart for anonymous users. If the user is logged in, it associates the cart * with the logged-in user. * * @param array $params Optional. Additional parameters for cart retrieval. * [ * // Include optional parameters, if any. * ] * */ public static function get(array $params = []) { } public static function find($id, $params = []) { } /** * Create cart with the provided item data. * * @param array $data Required. Array containing the necessary parameters * [ * 'id' => (int) Required.The ID of the item, * 'quantity' => (int) Optional.The quantity of the item * ] * @param array $params Optional. Additional parameters for cart creation or update. * [ * // Include optional parameters, if any. * ] * */ public static function create($data, $params = []) { } /** * Update the quantity of an item in the cart. * * @param array $data Required. Array containing the necessary parameters for item quantity * [ * 'item_id' => (int) Required.The ID of the product_variation, * 'quantity'=> (int) Optional.The quantity of the item * ] * @param int $id Required. The ID of the cart. * @param array $params Optional. Additional parameters for updating cart * [ * // Include optional parameters, if any. * ] * */ public static function update($data, $id = '', $params = []) { } public static function prepareUtmData(array $params): array { } /** * Delete cart based on the provided user ID or cart hash. * * @param int $id Required. The user ID associated with the cart. * @param array $params Optional. Additional parameters for cart deletion. * [ * 'cart_hash' => (string) Optional. The cart hash for additional identification. * ] * */ public static function delete($id, $params = []) { } public static function getStatus(): array { } public static function isLicensedProduct($productVariation): bool { } private static function validateShouldAddProduct($productVariation, $existingItemsArray) { } public static function hasSubscriptionProduct($existingItemsArray = []): bool { } private static function removeItemFromCart($existingItemsArray, $index): array { } public static function updateItemQuantityInCart($productVariation, $existingItemsArray, $index, $quantity = 1, $isFilteredItem = false): array { } public static function addItemInCart($productVariation, $existingItemsArray, $index, $quantity = 1, $isFilteredItem = false): array { } private static function updateCartItemsQuantity($params = []): array { } private static function getCartSingleItemPreparedArray($params = []): array { } /** * Check if cart exists */ public static function getOrSetCartForThisDevice($autoCreate = false) { } /** * This method should be called only if no cart is found in a current device */ private static function setupNewCart() { } public static function resetCartData() { } } class CustomerAddressResource extends \FluentCart\Api\Resource\BaseResourceApi { public static function getQuery(): \FluentCart\Framework\Database\Orm\Builder { } /** * Get customer addresses with specified parameters. * * @param array $params Array containing the necessary parameters. * [ * 'customer_id' => (int) Required. The ID of the customer. * 'status' => (enum) active|. * 'type' => (string) Optional. The type of address ('billing' by default). * ] * */ public static function get(array $params = []) { } /** * Find customer address based on the given ID and parameters. * * @param int $id Required. The ID of the customer. * @param array $params Optional. Array containing the necessary parameters. * [ * 'type' => (string) Optional. The type of address ('billing' by default). * ] * */ public static function find($id, $params = []) { } /** * Find customer address based on the customer ID and parameters. * * @param int $id Required. The ID of the customer. * @param array $params Optional. Array containing the necessary parameters. * [ * 'type' => (string) Optional. The type of address ('billing' by default). * ] * */ private static function findByCustomer($id, $params = []) { } /** * Create customer address with the given data. * * @param array $data Required. Array containing the necessary parameters * [ * 'email' => (string) Optional. The email of the address. * 'name' => (string) Required. The name of the address. * 'phone' => (string) Required. The phone of the address. * 'address_1' => (string) Required. The primary address line. * 'address_2' => (string) Optional. The secondary address line. * 'city' => (string) Required. The city of the address. * 'country' => (string) Required. The country of the address. * 'postcode' => (string) Required. The postal code of the address. * 'state' => (string) Required. The state of the address. * 'type' => (string) Required. (e.g., 'billing', 'shipping'). * ] * @param array $params Required. Additional parameters for creating an address. * [ * 'id' => (int) Required. The ID of the customer. * ] * */ public static function create($data, $params = []) { } /** * Update customer address with the given data. * * @param array $data Required. Array containing the necessary parameters * [ * 'email' => (string) Optional. The email of the address. * 'name' => (string) Required. The name of the address. * 'phone' => (string) Required. The phone of the address. * 'address_1' => (string) Required. The primary address line. * 'address_2' => (string) Optional. The secondary address line. * 'city' => (string) Required. The city of the address. * 'country' => (string) Required. The country of the address. * 'postcode' => (string) Required. The postal code of the address. * 'state' => (string) Required. The state of the address. * 'type' => (string) Required. (e.g., 'billing', 'shipping'). * ] * @param int $id Required. The ID of the customer address to be updated. * */ public static function update($data, $id, $params = []) { } /** * Delete an address based on the given ID and parameters. * * @param int $id Required. The ID of the customer address. * @param array $params Optional. Additional parameters for address deletion. * */ public static function delete($id, $params = []) { } /** * Make primary address for the specified customer. * * @param int $customerId Required. The ID of the customer. * @param array $params Optional. Additional parameters for making an address primary. * [ * 'address' => [ * 'id' => (int) Required. The ID of the address to be set as primary. * 'type' => (string) Required. The type of the address (e.g., 'billing', 'shipping'). * ], * ] */ public static function makePrimary($customerId, $params = []) { } } class CustomerResource extends \FluentCart\Api\Resource\BaseResourceApi { public static function getQuery(): \FluentCart\Framework\Database\Orm\Builder { } /** * Get customers based on specified parameters. * * @param array $params Array containing the necessary parameters. * [ * "params" => (array) Required. * [ * 'search' => (string) Optional. Search Customer. * [ * "column name(e.g., first_name|last_name|email|id)" => [ * column => "column name(e.g., first_name|last_name|email|id)", * operator => "operator (e.g., like_all|rlike|or_rlike|or_like_all)", * value => "value" ] * ], * 'filters' => (string) Optional. Filters customer. * [ * "column name(e.g., first_name|last_name|email)" => [ * column => "column name(e.g., first_name|last_name|email)", * operator => "operator (e.g., between|or_between|like_all|in)", * value => "value" ] * ], * 'order_by' => (string) Optional. Column to order by, * 'order_type' => (string) Optional. Order type for sorting (ASC or DESC), * 'per_page' => (int) Optional. Number of items for per page, * 'page' => (int) Optional. Page number for pagination * ] * ] * */ public static function get(array $params = []) { } /** * Find customer by ID. * * @param int $id Required. The ID of the customer. * @param array $params Optional. Additional parameters for finding a customer. * [ * 'with' => (array) Optional.Relationship name to be eagerly loaded, * ] * */ public static function find($id, $params = []) { } /** * Create a new customer with the given data * * @param array $data Required. Array containing the necessary parameters * [ * 'first_name' => (string) Required. The first name of the customer, * 'last_name' => (string) Optional. The last name of the customer, * 'email' => (string) Required. The email of the customer, * 'city' => (string) Optional. The city of the customer, * 'state' => (string) Optional. The state of the customer, * 'postcode' => (string) Optional. The postal code of the customer, * 'country' => (string) Optional. The country of the customer, * 'wp_user' => (string) Optional. Create customer as WP user, * ] * @param array $params Optional. Additional parameters for creating a customer. * */ public static function create($data, $params = []) { } /** * Update customer with the given data * * @param array $data Required. Array containing the necessary parameters * [ * 'first_name' => (string) Required. The first name of the customer, * 'last_name' => (string) Optional. The last name of the customer, * 'email' => (string) Required. The email of the customer, * 'city' => (string) Optional. The city of the customer, * 'state' => (string) Optional. The state of the customer, * 'postcode' => (string) Optional. The postal code of the customer, * 'country' => (string) Optional. The country of the customer, * ] * @param int $id Required. The ID of the customer. * @param array $params Optional. Additional parameters for creating a customer. * */ public static function update($data, $id, $params = []) { } /** * Delete a customer based on the given ID and parameters. * * @param int $id Optional. The ID of the customer. * @param array $params Optional. Additional parameters for deleting multiple customers. * [ * 'ids' => (array) Required. The array of customer IDs to be deleted. * ] * */ public static function delete($id, $params = []) { } /** * Get orders for a specific customer. * * @param array $data Required. Array containing the necessary parameters for order retrieval. * [ * 'per_page' => (int) Optional. Number of items for per page, * ] * @param int $customerId Required. The ID of the customer for whom orders are being retrieved. * */ public static function getOrders(array $data, $customerId): array { } /** * Update the status of multiple customers with the given parameters. * * @param array $params Optional. Array containing the necessary parameters * [ * 'new_status' => (string) Required. The new status to be set for the customers. * 'customer_ids' => (array) Required. Customer IDs whose status will be updated. * ] * */ public static function updateStatus($params = []) { } /** * Manage customers based on the provided action and customer IDs. * * @param array $params Optional. Array containing the necessary parameters * [ * 'action' => (string) Required. The action to be performed on the selected customers. * (e.g., Possible values: 'delete_customers', 'change_customer_status') * 'customer_ids' => (array) Required. Customer IDs whose action will be performed. * ] * */ public static function manageCustomer($params = []) { } } class FluentMetaResource extends \FluentCart\Api\Resource\BaseResourceApi { public static function getQuery(): \FluentCart\Framework\Database\Orm\Builder { } /** * Get meta based on the provided parameters. * * @param array $params Array containing the necessary parameters. * [ * 'meta_key' => (string) Required. The meta key to retrieve data. * 'default' => (mixed) Optional. Default value to return if data is not found. * ] * */ public static function get(array $params = []) { } public static function find($id, $params = []) { } public static function create($data, $params = []) { } /** * Update metadata with the given data * * @param array $data Required. Array containing the necessary parameters. * [ * 'meta_key' => (string) Required. The key of the metadata. * 'meta_value' => (mixed) Required. The value of the metadata. * 'type' => (string) Optional. The type of the object. * ] * @param int $id Required. The ID of the product for which metadata is updated. * @param array $params Optional. Additional parameters for updating metadata. * [ * // Include optional parameters, if any. * ] * */ public static function update($data, $id, $params = []) { } public static function delete($id, $params = []) { } } class OrderAddressResource extends \FluentCart\Api\Resource\BaseResourceApi { public static function getQuery(): \FluentCart\Framework\Database\Orm\Builder { } /** * Get order addresses with specified parameters. * * @param array $params Array containing the necessary parameters. * */ public static function get(array $params = []) { } /** * Find order address based on the given ID and parameters. * * @param int $id Optional. The ID of the order address. * @param array $params Optional. Array containing the necessary parameters. * */ public static function find($id = null, $params = []) { } /** * Create order address with the given data. * * @param array $data Required. Array containing the necessary parameters * [ * 'order_id' => (int) Required. The id of the order. * 'name' => (string) Required. The name of the address. * 'address_1' => (string) Required. The primary address line. * 'address_2' => (string) Optional. The secondary address line. * 'city' => (string) Required. The city of the address. * 'country' => (string) Required. The country of the address. * 'postcode' => (string) Required. The postal code of the address. * 'state' => (string) Required. The state of the address. * 'type' => (string) Required. (e.g., 'billing', 'shipping'). * ] * @param array $params Required. Additional parameters for creating an address. * */ public static function create($data, $params = []) { } /** * Update order address with the given data. * * @param array $data Required. Array containing the necessary parameters * @param int $id Required. The ID of the order address to be updated. * */ public static function update($data, $id, $params = []) { } /** * Delete an address based on the given ID and parameters. * * @param int $id Required. The ID of the order address. * @param array $params Optional. Additional parameters for address deletion. * */ public static function delete($id, $params = []) { } } class OrderDownloadPermissionResource extends \FluentCart\Api\Resource\BaseResourceApi { public static function getQuery(): \FluentCart\Framework\Database\Orm\Builder { } /** * Get Order Download Permission based on specified parameters. * * @param array $params Array containing the necessary parameters. * */ public static function get(array $params = []) { } /** * Find Order Download Permission by ID. * * @param int $id Required. The ID of Order Download Permission. * @param array $params Optional. Additional parameters for finding a download permission. * [ * 'with' => (array) Optional. Relationships name to be eager loaded, * ] * */ public static function find($id, $params = []) { } /** * Create a new Order Download Permission with the given data * * @param array $data Required. Array containing the necessary parameters * [ * 'order_id' => (int) Required. The id of the order, * 'customer_id' => (int) Required. The id of the customer, * 'download_id' => (int) Required. The id of the download file, * 'download_count' => (int) Required. The count of the download log, * 'download_limit' => (int) Required. The limit of the download file, * 'access_expires' => (date) Required. The expiry code of the download file, * ] * @param array $params Optional. Additional parameters for creating a Order Download Permission. * */ public static function create($data, $params = []) { } /** * Update Order Download Permission with the given data * * @param array $data Required. Array containing the necessary parameters * [ * 'order_id' => (int) Required. The id of the order, * 'customer_id' => (int) Required. The id of the customer, * 'download_id' => (int) Required. The id of the download file, * 'download_count' => (int) Required. The count of the download log, * 'download_limit' => (int) Required. The limit of the download file, * 'access_expires' => (date) Required. The expiry code of the download file, * ] * @param int $id Required. The ID of the Order Download Permission. * @param array $params Optional. Additional parameters for creating a Order Download Permission. * */ public static function update($data, $id, $params = []) { } /** * Delete a download permission based on the given ID and parameters. * * @param int $id Optional. The ID of the order download permission. * @param array $params Optional. Additional parameters. * */ public static function delete($id, $params = []) { } } class OrderResource extends \FluentCart\Api\Resource\BaseResourceApi { public static function getQuery(): \FluentCart\Framework\Database\Orm\Builder { } /** * Retrieve orders with additional data based on specified parameters. * * @param array $params Optional. Additional parameters for order retrieval. * $params = [ * 'search' => (string) Optional. Search Order. * [ * "column name(e.g., customer_id)" => [ * column => "column name(e.g., customer_id)", * value => "value" ] * ], * 'order_by' => (string) Optional. Column to order by, * 'order_type' => (string) Optional. Order type for sorting (ASC or DESC), * 'per_page' => (int) Optional. Number of items for per page, * 'page' => (int) Optional. Page number for pagination * ] * */ public static function get(array $params = []) { } /** * Find order based on the given id and parameters. * * @param int $id Required. The id of the order. * @param array $params Optional. Array containing the necessary parameters. * */ public static function find($id, $params = []) { } /** * Create order address with the given data. * * @param array $data Required. Array containing the necessary parameters * @param array $params Required. Additional parameters for creating an order. * */ public static function create($data, $params = []) { } /** * Update order with the given data. * * @param array $data Required. Array containing the necessary parameters * @param int $id Required. The id of the order to be updated. * */ public static function update($data, $id, $params = []) { } /** * Delete an order based on the given id and parameters. * * @param int $id Required. The id of the order. * @param array $params Optional. Additional parameters for order deletion. * */ public static function delete($id, $params = []) { } } } namespace FluentCart\Api\Resource { class LabelResource extends \FluentCart\Api\Resource\BaseResourceApi { public static function getQuery(): \FluentCart\Framework\Database\Orm\Builder { } /** * Retrieve labels with additional data based on specified parameters. * * @param array $params Optional. Additional parameters for label retrieval. * $params = [ * * ] * */ public static function get(array $params = []) { } /** * Find an label by id * * @param string $id Required. The id of the label to find. * @param array $params Optional. Additional parameters for label retrieval. * [ * // Include optional parameters, if any. * ] * */ public static function find($id, $params = []) { } /** * Create a label with the provided data. * * @param array $data Required. Array containing the necessary parameters for label creation. * $data = [ * 'value' => (string) Required. The name of the label, * // Include additional parameters, if any. * ] * @param array $params Optional. Additional parameters for label creation. * [ * // Include optional parameters, if any. * ] * */ public static function create($data, $params = []) { } public static function createAndAttach($data, $params = []) { } /** * Update a label with the provided data. * * @param object $data Required. * @param int $id Required. The ID of the label to update. * @param array $params Optional. Additional parameters for label update. * [ * // Include optional parameters, if any. * ] * */ public static function update($data, $id, $params = []) { } /** * Delete a label and associated data by id. * * @param int $id Required. The id of the label to delete. * @param array $params Optional. Additional parameters for label deletion. * [ * // Include optional parameters, if any. * ] * */ public static function delete($id, $params = []) { } /** * Add label to the label relationships for a specific labelable type with the provided data. * * @param object $model Required. * @param array $params Optional. Additional parameters to add label. * [ * // Include optional parameters, if any. * ] * */ public static function addLabelToLabelRelationships($model, $params = []) { } } class OrderAddressResource extends \FluentCart\Api\Resource\BaseResourceApi { public static function getQuery(): \FluentCart\Framework\Database\Orm\Builder { } /** * Get order addresses with specified parameters. * * @param array $params Array containing the necessary parameters. * */ public static function get(array $params = []) { } /** * Find order address based on the given ID and parameters. * * @param int $id Required. The ID of the order. * @param array $params Optional. Array containing the necessary parameters. * */ public static function find($id, $params = []) { } /** * Create order address with the given data. * * @param array $data Required. Array containing the necessary parameters * [ * 'order_id' => (int) Required. The id of the order. * 'name' => (string) Required. The name of the address. * 'address_1' => (string) Required. The primary address line. * 'address_2' => (string) Optional. The secondary address line. * 'city' => (string) Required. The city of the address. * 'country' => (string) Required. The country of the address. * 'postcode' => (string) Required. The postal code of the address. * 'state' => (string) Required. The state of the address. * 'type' => (string) Required. (e.g., 'billing', 'shipping'). * ] * @param array $params Required. Additional parameters for creating an address. * */ public static function create($data, $params = []) { } /** * Update order address with the given data. * * @param array $data Required. Array containing the necessary parameters * @param int $id Required. The ID of the order. * */ public static function update($data, $id, $params = []) { } /** * Delete an address based on the given ID and parameters. * * @param int $id Required. The ID of the order address. * @param array $params Optional. Additional parameters for address deletion. * */ public static function delete($id, $params = []) { } } class OrderItemResource extends \FluentCart\Api\Resource\BaseResourceApi { public static function getQuery(): \FluentCart\Framework\Database\Orm\Builder { } public static function get(array $params = []) { } /** * Find and retrieve order items based on the order ID. * * @param int $id Required. The ID of the order to find and retrieve. * @param array $params Optional. Additional parameters for finding order items. * [ * // Include optional parameters, if any. * ] * */ public static function find($id, $params = []) { } /** * Create order items with the provided data. * * This function creates order items based on the provided data. * It also dispatches events related to order creation and stock changes. * * @param array $data Required. Array containing the necessary parameters * $data => (array) Required. Array of order item details. * [ * 'order_id' => (int) The ID of the order to which the item belongs. * 'post_id' => (int) The product ID associated with the order item. * 'object_id' => (int) The variation ID of the order item. * 'thumbnail' => (string) The URL of the thumbnail of order item. * 'price' => (float) The price of the item. * 'title' => (string) The name of the item. * 'quantity' => (int) The quantity of the item. * 'fulfillment_type' => (string) Type (e.g., 'physical', 'digital'). * 'stockStatus' => (string) (e.g., 'in-stock'|'out-of-stock'). * 'stock' => (int) The current stock quantity. * 'tax_amount' => (float) The tax amount for the item. * 'discount_total' => (float) The total discount amount for the item. * 'total' => (float) The total amount for the item. * 'line_total' => (float) The total amount for the line * ] * @param array $params Optional. Additional parameters for order item creation. * [ * // Include optional parameters, if any. * ] * */ public static function create($data, $params = []) { } /** * Update order items with the provided data. * * This function creates order items based on the provided data. * It also dispatches events related to order creation and stock changes. * * @param array $data Required. Array containing the necessary parameters * $data => (array) Required. Array of order item details. * [ * 'id' => (int) The id for the order item. * 'order_id' => (int) The ID of the order to which the item belongs. * 'post_id' => (int) The product ID associated with the order item. * 'object_id' => (int) The variation ID of the order item. * 'thumbnail' => (string) The URL of the thumbnail of order item. * 'price' => (float) The price of the item. * 'title' => (string) The name of the item. * 'quantity' => (int) The quantity of the item. * 'fulfillment_type' => (string) Type (e.g., 'physical', 'digital'). * 'stockStatus' => (string) (e.g., 'in-stock'|'out-of-stock'). * 'stock' => (int) The current stock quantity. * 'tax_amount' => (float) The tax amount for the item. * 'discount_total' => (float) The total discount amount for the item. * 'total' => (float) The total amount for the item. * 'line_total' => (float) The total amount for the line * ] * @param int $id Required. The id of the order item to update. * @param array $params Optional. Additional parameters for order item creation. * [ * // Include optional parameters, if any. * ] * */ public static function update($data, $id, $params = []) { } public static function delete($id, $params = []) { } /** * Create or Update order items with the provided data. * * This function creates or updates order items based on the provided data. * * @param array $data Required. Array containing the necessary parameters * $order => (array) Required. Array of order details. * [ * 'id' => (int) The id for the order. * 'status' => (string) The current status of the order * 'parent_id' => (int) The parent order ID, if applicable. * 'invoice_no' => (string) The order number assigned to the order. * 'receipt_number' => (int) The sequential order number for using in invoice * 'fulfillment_type' => (string) (e.g., 'virtual', 'physical', etc.). * 'type' => (string) Type (e.g., 'sale', 'refund', etc.). * 'customer_id' => (int) The ID of the customer associated with the order. * 'payment_method' => (string) The payment method used for the order. * 'payment_method_title' => (string) The title of the payment method. * 'currency' => (string) The currency used for the order (e.g., 'BDT'). * 'subtotal' => (float) The subtotal amount of the order. * 'discount_tax' => (float) The tax amount on discounts. * 'discount_total' => (float) The total discount amount for the order. * 'shipping_tax' => (float) The tax amount on shipping. * 'shipping_total' => (float) The total shipping amount for the order. * 'tax_total' => (float) The total tax amount for the order. * 'total_amount' => (float) The total amount for the order. * 'total_paid' => (float) The total amount paid for the order. * 'rate' => (float) The exchange rate used for currency conversion. * 'note' => (string) Additional notes or comments for the order. * 'ip_address' => (string) The IP address associated with the order. * 'completed_at' => (string|null) date-time order completed|null * 'refunded_at' => (string|null) date-time the order was refunded|null * 'uuid' => (string) The id for the order. * 'created_at' => (string) The date and time the order was created. * 'updated_at' => (string) The date and time the order was last updated. * ] * @param int $id Required. The id of the order to create or update. * @param array $params Required. Additional parameters for order item creation|update. * $params => (array) Required. Array of order item details. * [ * 'id' => (int) The id for the order item|null if not. * 'order_id' => (int) The ID of the order to which the item belongs. * 'post_id' => (int) The product ID associated with the order item. * 'object_id' => (int) The variation ID of the order item. * 'thumbnail' => (string) The URL of the thumbnail of order item. * 'unit_price' => (float) The price of the item. * 'title' => (string) The name of the item. * 'quantity' => (int) The quantity of the item. * 'fulfillment_type' => (string) Type (e.g., 'physical', 'digital'). * 'stockStatus' => (string) (e.g., 'in-stock'|'out-of-stock'). * 'stock' => (int) The current stock quantity. * 'tax_amount' => (float) The tax amount for the item. * 'discount_total' => (float) The total discount amount for the item. * 'total' => (float) The total amount for the item. * 'line_total' => (float) The total amount for the line * ] * */ public static function updateOrInsertOrderItems($order, $id, $params = [], $couponCalculation = []) { } /** * Retrieve the top-selling products based on the total quantity sold. * * @param array $params Optional. Additional parameters for retrieving top-selling products. * [ * 'created_at' => (array) Optional. Filter results by creation date. * [ "created_at" => [ * "column" => "created_at", * "operator" => "between", * "value" => "Date range e.g. start_date,end_date ] * ], * 'operator' => (string) Optional. Operator for the 'total_sold' condition. * (e.g., '>', '=', '<', etc.) * 'total_sold' => (int) Optional. Total quantity sold condition. * ] * */ public static function topProductsSold($params = []) { } public static function bulkDeleteByOrderIds($ids, $params = []) { } } class OrderMetaResource extends \FluentCart\Api\Resource\BaseResourceApi { public static function getQuery(): \FluentCart\Framework\Database\Orm\Builder { } /** * Retrieve order meta based on the provided parameters. * * @param array $params Optional. Additional parameters for data retrieval. * [ * 'order_id' => (int) Required. The ID of the order to filter the data. * ] * */ public static function get(array $params = []) { } /** * Find order meta data based on the provided order ID and params. * * @param int $id Required. The ID of the order to find the meta data. * @param array $params Optional. Additional parameters for finding order meta data. * [ * 'meta_key' => (string) Required. The key of the order meta data to retrieve. * 'def' => (mixed) Optional. Default value to return if order meta is not found. * ] * */ public static function find($id, $params = []) { } /** * Create order meta data with the provided information. * * @param array $data Required. Array containing the necessary parameters for data creation. * [ * // Include required parameters for creating the data. * ] * @param array $params Optional. Additional parameters for data creation. * [ * // Include optional parameters, if any. * ] * */ public static function create($data, $params = []) { } /** * Update order meta data with the provided information. * * @param array $data Required. Array containing the necessary parameters * [ * // Include required parameters for updating the data. * ] * @param int $id Required. The ID of the order associated with the data to update. * @param array $params Optional. Additional parameters for order meta update. * [ * 'meta_key' => (string) Required. The key of the meta data to update. * ] * */ public static function update($data, $id, $params = []) { } /** * Delete an order meta based on the given ID and parameters. * * @param int $id Required. The ID of the order meta. * @param array $params Optional. Additional parameters for order meta deletion. * */ public static function delete($id, $params = []) { } public static function bulkDeleteByOrderIds($ids, $params = []) { } } class OrderOperationResource extends \FluentCart\Api\Resource\BaseResourceApi { public static function getQuery(): \FluentCart\Framework\Database\Orm\Builder { } public static function get(array $params = []) { } public static function find($id, $params = []) { } public static function create($data, $params = []) { } public static function update($data, $id, $params = []) { } public static function delete($id, $params = []) { } public static function view(int $id): array { } } class OrderResource extends \FluentCart\Api\Resource\BaseResourceApi { public static function getQuery(): \FluentCart\Framework\Database\Orm\Builder { } /** * Retrieve orders with additional data based on specified parameters. * * @param array $params Optional. Additional parameters for order retrieval. * $params = [ * 'search' => ( string ) Optional. Search Order. * [ * 'column name(e.g., first_name|last_name|email|id)' => [ * column => 'column name(e.g., first_name|last_name|email|id)', * operator => 'operator (e.g., like_all|rlike|or_rlike|or_like_all)', * value => 'value' ] * ], * 'filters' => ( string ) Optional. Filters order. * [ * 'column name(e.g., status|payment_status|payment_method)' => [ * column => 'column name(e.g., status|payment_status|payment_method)', * operator => 'operator (e.g., in)', * value => 'value' ] * ], * 'order_by' => ( string ) Optional. Column to order by, * 'order_type' => ( string ) Optional. Order type for sorting ( ASC or DESC ), * 'per_page' => ( int ) Optional. Number of items for per page, * 'page' => ( int ) Optional. Page number for pagination * ] * */ public static function get(array $params = []) { } /** * Find an order by ID with associated customer and address details. * * @param string $id Required. The UUID of the order to find. * @param array $params Optional. Additional parameters for order retrieval. * [ * // Include optional parameters, if any. * ] * */ public static function find($id, $params = []) { } /** * Create an order with the provided data. * * @param array $data Required. Array containing the necessary parameters for order creation. * $data = [ * 'status' => ( string ) Required. The status of the order, * // Include additional parameters, if any. * ] * @param array $params Optional. Additional parameters for order creation. * [ * // Include optional parameters, if any. * ] * */ public static function create($data, $params = []) { } /** * @throws \Exception */ public static function updatedPlaceOrder($data, $params = []) { } /** * Calculate tax for an admin-created order and persist it to fct_order_tax_rate. * Updates order.tax_total and order.shipping_tax. Never throws — tax failure must * not block order creation. * * @param \FluentCart\App\Models\Order $order The freshly created order. * @param array $items Raw order_items from the create-order request. * @param \FluentCart\App\Models\Customer $customer Customer with primary_billing_address loaded. * @param array $data Raw request data (may include billing_address_id). */ private static function applyAdminOrderTax($order, $items, $customer, $data = []) { } /** * Recalculate and persist tax for an existing order after create or update. * Reads saved items + billing address from the DB, runs AdminOrderTaxService, * recomputes total_amount from scratch, and rewrites fct_order_tax_rate rows. * Never throws — tax failure must not block the save. */ private static function reapplyTaxAfterUpdate($orderId, $order) { } /** * Re-derive payment_status after a tax recalculation changed total_amount on * an order that already received money. A fully-paid order whose total grew * becomes partially_paid (the admin UI then shows Total Due + Collect * Payments); a partially_paid order whose total shrank to within total_paid * becomes paid. Overpayment keeps status paid — the Total Refund Owed row is * derived from the columns directly. Intentionally event-free: no payment was * received, so OrderPaid side effects (emails) must not fire. */ private static function syncPaymentStatusWithTotals($order) { } /** * Resolve whether a checkout-time VIES validation still grants reverse charge * for an admin order edit. * * Sources the validated VAT from order business_info (rate-row vat_reverse * meta as legacy fallback), then re-checks eligibility against the current * tax address: the VAT's member state must match the tax country and the * store settings must allow reverse charge for it. When the tax country * changed since the order was placed, the VAT is re-validated against VIES — * a definitive "invalid" drops reverse charge; an unreachable service trusts * the stored validation (fail open, matching checkout behavior). * * @return array|null vat_reverse payload to persist, or null when reverse * charge must not apply. */ private static function resolveAdminReverseChargeContext($order, $taxAddress) { } /** * Zero out all tax fields, rate rows, and per-item tax amounts for an order * that has become definitively non-taxable (no address, no taxable items). * Only called for deterministic states — not on transient calculation failures. */ private static function clearOrderTax($orderId, $order) { } private static function patchOrderItemTaxMeta(array $savedItems, array $lineItemsFromTax) { } private static function patchSignupFeeTaxMeta($orderId, array $lineItemsFromTax) { } /** * Patch subscription tax fields after admin order tax calculation. * * AdminOrderProcessor creates the subscription row before tax runs, with * recurring_tax_total = 0 and recurring_total at the untaxed recurring price. * Renewals read recurring_tax_total (and the parent item's * other_info.recurring_tax for inclusive items) — without this patch every * renewal of an admin-created subscription invoices zero tax. * * Mirrors CheckoutProcessor::prepareSubscriptionData(): the recurring tax is * folded into recurring_total only when additive (exclusive store, or mixed * cart with this line exclusive). */ private static function patchSubscriptionTax($order, array $lineItemsFromTax, $taxBehavior) { } private static function distributeManualDiscount(&$items, $manualDiscountTotal) { } private static function getCustomer($data) { } private static function addOrderMeta($orderId, $discount, $shipping, $newLabelIds) { } private static function commitEvents($order) { } private static function createOrderAddresses($orderId, $data, $customerId = 0) { } private static function triggerStockChangedEvents($order) { } /** * Update an order with the provided data. * * @param array $data Required. Array containing the necessary parameters for order update. * $data = [ * 'orderData' => ( array ) Required. Represents the main order details. * [ * 'id' => (int) The id for the order. * 'status' => (string) The current status of the order * 'parent_id' => (int) The parent order ID, if applicable. * 'receipt_number' => (int) the unique sequential order number. * 'invoice_no' => (string) The order number assigned to the order. * 'fulfillment_type' => (string) (e.g., 'virtual', 'physical', etc.). * 'type' => (string) Type (e.g., 'sale', 'refund', etc.). * 'customer_id' => (int) The ID of the customer associated with the order. * 'payment_method' => (string) The payment method used for the order. * 'payment_method_title' => (string) The title of the payment method. * 'currency' => (string) The currency used for the order (e.g., 'BDT'). * 'subtotal' => (float) The subtotal amount of the order. * 'discount_tax' => (float) The tax amount on discounts. * 'manual_discount_total' => (float) The total discount amount for the order. * 'shipping_tax' => (float) The tax amount on shipping. * 'shipping_total' => (float) The total shipping amount for the order. * 'tax_total' => (float) The total tax amount for the order. * 'total_amount' => (float) The total amount for the order. * 'total_paid' => (float) The total amount paid for the order. * 'rate' => (float) The exchange rate used for currency conversion. * 'ip_address' => (string) The IP address associated with the order. * 'completed_at' => (string|null) date-time order completed|null *  * 'refunded_at' => (string|null) date-time the order was refunded|null *  * 'uuid' => (string) The id for the order. *   * 'created_at' => (string) The date and time the order was created. *  * 'updated_at' => (string) The date and time the order was last updated. *  * 'customer' => (null|array) Info of customer associated with the order. * 'order_items' => (array) Required. Array of order item details. * [ * 'id' => ( int ) The id for the order item. * 'order_id' => ( int ) The ID of the order to which the item belongs. * 'post_id' => ( int ) The product ID associated with the order item. * 'object_id' => ( int ) The variation ID of the order item. * 'thumbnail' => ( string ) The URL of the thumbnail of order item. * 'item_price' => ( float ) The price of the item. * 'item_name' => ( string ) The name of the item. * 'quantity' => ( int ) The quantity of the item. * 'type' => ( string ) Type ( e.g., 'simple', 'variable' ). * 'stockStatus' => ( string ) ( e.g., 'in-stock'|'out-of-stock' ). * 'stock' => ( int ) The current stock quantity. * 'tax_amount' => ( float ) The tax amount for the item. * 'manual_discount_total' => ( float ) The total discount amount for the item. * 'item_total' => ( float ) The total amount for the item. * 'line_total' => ( float ) The total amount for the line * ] * ], * 'discount' => ( array ) Optional. Represents the discount details * [ * 'type' => ( string ) Required. type of discount ( e.g., 'amount', 'percentage' ) * 'label' => ( string ) Optional. The label associated with the discount * 'reason' => ( string ) Optional. The reason for the discount * 'value' => ( float ) Required. The value of the discount * ], * 'shipping' => ( array ) Optional. Represents the shipping details. * [ * 'type' => ( string ) Optional. The type of shipping. * 'value' => ( float|null ) Optional. Value associated with shipping|null if not * ], * 'deletedItems' => ( array ) Optional. IDs of items to be deleted. * [ * ( e.g., 100, 501 etc ) * ] * ] * @param int $id Required. The ID of the order to update. * @param array $params Optional. Additional parameters for order update. * [ * // Include optional parameters, if any. * ] * */ public static function update($data, $id, $params = []) { } /** * Strip server-authoritative columns from a client-supplied order payload * before it is persisted by update(). * * The admin edit screen sends the whole order object back — including * tax_total, shipping_tax, tax_behavior, discount_tax and per-item * tax_amount. For normal orders reapplyTaxAfterUpdate() recalculates and * overwrites these server-side right after the save, but subscription and * refund-type orders skip that recalc — whatever the client sent would * become final (stale values from a race, or forged values from a * tampered request). These columns must therefore never be * client-writable on this path: the existing DB values persist unless * the server-side recalc changes them. * * total_paid / total_refund only move via payment & refund flows. The * controller already drops them (OrderRequest::sanitize() is a whitelist * and getSafe() only returns whitelisted keys), so stripping them here is * defense in depth for direct OrderResource::update() callers. * * total_amount is intentionally NOT stripped: it is client-computed for * legitimate item edits on subscription/refund orders, and for normal * orders reapplyTaxAfterUpdate() recomputes it from scratch anyway. * * Removing the per-item tax_amount key (rather than zeroing it) makes * OrderItemResource::updateOrInsertOrderItems() leave the existing DB * value untouched on updated rows; inserted rows fall back to the column * default (0) and normal orders get patched by patchOrderItemTaxMeta() * after the recalc. * * @param array $orderData The 'orderData' payload consumed by update(). * @return array */ private static function stripClientTaxFields($orderData) { } public static function updateOrderAddressId($data, \FluentCart\App\Models\Order $order) { } public static function updateOrderAddress($data) { } /** * Delete an order and associated data by ID.Including order meta, order items, transactions, * * @param int $id Required. The ID of the order to delete. * @param array $params Optional. Additional parameters for order deletion. * [ * // Include optional parameters, if any. * ] * */ public static function delete($id, $params = []) { } protected static function deleteOrderRelatedData(array $orderIds, bool $isTestMode = false): void { } /** * View details of an order by ID. * * This function retrieves details of an order by the specified ID. It includes information about the customer, order items with variants, transactions, discount meta, shipping meta, * and order settings. * * @param int $id Required. The ID of the order to view. * */ public static function view(int $id) { } /** * Retrieve an overview of reports based on specified parameters. * * It calculates total sales, net sales, total discounts, total shipping tax, average order * value, and customer order count based on the reports data. * * @param array $params Required. Additional parameters for report overview. * $params = [ * //(Required) * "status" => [ * "column" => "status", * "operator" => "in", * "value" => "Order success status e.g. completed, * ], * * //(Required) * "payment_status" => [ * "column" => "payment_status", * "operator" => "in", * "value" => "Transaction success status e.g. paid, * ], * * //(Optional) * "created_at" => [ * "column" => "created_at", * "operator" => "between" * "value" => "from and to date" * ] * ] * */ /** * @deprecated since v1.4. Use OverviewReportController::getOverview() via GET reports/overview instead. */ public static function reportOverview($params = []) { } /** * Retrieve order summary based on payment methods and specified parameters. * * This function generates order summary by payment method, applying filters provided in the parameters. * * It retrieves the count of orders, total transactions, and groups the results by payment method. * * @param array $params Required. Additional parameters for order summary generation. * $params = [ * //(Required) * "status" => [ * "column" => "status", * "operator" => "in", * "value" => "Order success status e.g. completed, * ], * * //(Required) * "payment_status" => [ * "column" => "payment_status", * "operator" => "in", * "value" => "Transaction success status e.g. paid, * ], * * //( Optional ) * 'created_at' => [ * 'column' => 'created_at', * 'operator' => 'between' * 'value' => 'from and to date' * ] * ] * * @return \FluentCart\Framework\Database\Orm\Collection of orders */ public static function orderSummaryByPayment(array $params = []) { } private static function addOrUpdateOrderMeta($params = []) { } private static function triggerEventsOnStockChanged($orderItems) { } public static function updateStatuses(array $params = []) { } private static function validateStock($orderItems) { } /** * Delete orders and its associated data. * * @param array $orderIds The ids of the order to be deleted. * @param array $params Additional parameters for the deletion process. * */ public static function bulkDeleteByOrderIds($orderIds, $params = []) { } public static function updatePaymentStatus(array $params = []) { } private static function mergeOrderAddress(\FluentCart\App\Models\OrderAddress $address, array $addressData) { } private static function createOrderAddress(array $address, $orderId) { } public static function getOrderByHash($orderHash) { } private static function resolveShippingTitle(array $shipping): array { } } class ProductDetailResource extends \FluentCart\Api\Resource\BaseResourceApi { public static function getQuery(): \FluentCart\Framework\Database\Orm\Builder { } public static function get(array $params = []) { } /** * Find product detail by its id. * * @param int $id The id of the product detail. * @param array $data Additional data for finding product (optional). * */ public static function find($id, $data = []) { } /** * Create a new product detail with the given data. * * @param array $data Array containing the necessary parameters. * * $data = [ * 'post_id' => (int) Required. The product ID. * 'fulfillment_type' => (string) Required. The fulfillment type default:physical. * 'variation_type' => (string) Required. The variation type default:simple. * 'manage_stock' => (int) Required. The manage stock default:1. * ]; */ public static function create($data, $params = []) { } /** * Update a product detail with the given data. * @param int $id The id of the product detail to be updated. * @param array $data Array containing the necessary parameters. * * $data = [ * 'id' => (int) Required. The detail id. * 'post_id' => (int) Required. The product ID. * 'fulfillment_type' => (string) Required. The fulfillment type. * 'variation_type' => (string) Required. The variation type. * 'default_variation_id' => (int) Required. The default variation ID. * 'manage_stock' => (int) Required. The manage stock default:1. * ]; * @param array $params Additional parameters for the update process. * $params = [ * 'action' => (string) Required. This param will help to update detail based on the specific action i.e: variant_modified(Triggers when variant modified which covers all mutations), change_variation_type(Triggers when variation type will change). * ]; */ public static function update($data, $id, $params = []) { } /** * Delete product detail and its associated data. * * @param int $id The id of the product detail to be deleted. * @param array $params Additional parameters for the deletion process. * */ public static function delete($id, $params = []) { } } class ProductDownloadResource extends \FluentCart\Api\Resource\BaseResourceApi { public static function getQuery(): \FluentCart\Framework\Database\Orm\Builder { } public static function get(array $params = []) { } /** * Find downloadable file by ID * * @param int $id Required. The ID of the file to find. * @param array $params Optional. Additional parameters for finding file. * */ public static function find($id, $params = []) { } /** * Create a new file with the given data * * @param array $data Required. Array containing the necessary parameters for file creation. * [ * 'title' => (string) Required. The title of the file, * 'type' => (string) Required. The type of the file, * 'driver' => (string) Required. The driver of the file, * 'file_name' => (string) Required. The file_name of the file, * 'file_path' => (string) Required. The file_path of the file, * 'file_url' => (string) Required. The file_url of the file, * 'settings' => (string) Optional. The settings of the file, * 'serial' => (int) Required. The serial of the file, * ] * @param array $params Optional. Additional parameters for file creation. * [ * // Include optional parameters, if any. * ] * */ public static function create($data, $params = []) { } /** * Update file with the given data * * @param array $data Required. Array containing the necessary parameters for file update. * [ * 'title' => (string) Required. The title of the file, * 'type' => (string) Required. The type of the file, * 'driver' => (string) Required. The driver of the file, * 'file_name' => (string) Required. The file_name of the file, * 'file_path' => (string) Required. The file_path of the file, * 'file_url' => (string) Required. The file_url of the file, * 'settings' => (string) Optional. The settings of the file, * 'serial' => (int) Required. The serial of the file, * ] * @param int $id Required. The ID of the file. * @param array $params Optional. Additional parameters for file update. * [ * // Include optional parameters, if any. * ] * */ public static function update($data, $id, $params = []) { } /** * Delete a downloadable file with the given ID and parameters. * * @param int $id Required. The ID of the product downloadable file to delete single file. * @param array $params Optional. Additional parameters for deleting multiple files. * [ * 'type' => (string) Optional. Possible deletion type (all|byProduct) * ('all - means delete files by product id except specific files') * ('byProduct - means delete files by product id') * 'post_id' => (int) Optional. Delete by particular product. * 'download_file_ids' => (array) Optional. Ignore to delete those files which are * in download file ids array. * ] * */ public static function delete($id, $params = []) { } } class ProductMetaResource extends \FluentCart\Api\Resource\BaseResourceApi { private static $metaKey = 'product_thumbnail'; private static $objectType = 'product_variant_info'; public static function getQuery(): \FluentCart\Framework\Database\Orm\Builder { } public static function get(array $params = []) { } /** * Find metadata by specified product ID and given parameters. * * @param int $productId Required. The ID of the product to find metadata. * @param array $params Optional. Additional parameters for the metadata retrieval. * [ * // Include optional parameters, if any. * ] * */ public static function find($productId, $params = []) { } /** * Create a new product meta with the given data * * @param array $data Required. Array containing the necessary parameters for file creation. * [ * 'object_id' => (int) Required. The id of the product, * 'object_type' => (string) Required. The type of the product meta, * 'meta_value' => (string) Required. The value of the product meta * [ * 'id' => (int) Required. The id of the thumbnail, * 'url' => (string) Required. The url of the thumbnail, * 'title' => (string) Required. The title of the thumbnail, * ] * 'meta_key' => (string) Required. The key of the product meta, * ] * @param array $params Optional. Additional parameters for meta creation. * [ * 'product_id' => (int) Required. The id of the product, * ] * */ public static function create($data, $params = []) { } /** * Update product meta with the given data * * @param array $data Required. Array containing the necessary parameters for file creation. * [ * 'meta_value' => (string) Required. The value of the product meta * [ * 'id' => (int) Required. The id of the thumbnail, * 'url' => (string) Required. The url of the thumbnail, * 'title' => (string) Required. The title of the thumbnail, * ] * ] * @param int $productId Required. The ID of the product meta. * @param array $params Optional. Additional parameters for meta creation. * [ * // Include optional parameters, if any. * ] * */ public static function update($data, $productId, $params = []) { } /** * Delete product meta with the given ID and parameters. * * @param int $id Required. The ID of the product meta. * @param array $params Optional. Additional parameters. * [ * // Include optional parameters, if any. * ] * */ public static function delete($id, $params = []) { } /** * Find metadata by specified ids and given parameters. * * @param array $ids Required. The id of the product variants to find metadata. * @param array $params Optional. Additional parameters for the metadata retrieval. * [ * // Include optional parameters, if any. * ] */ public static function findByIds($ids, $params = []) { } } class ProductResource extends \FluentCart\Api\Resource\BaseResourceApi { public static function getQuery(): \FluentCart\Framework\Database\Orm\Builder { } public static function get(array $params = []): array { } public static function getProducttitle($productId) { } /** * Find product by its ID. * * @param int|string $id The ID of the post. * @param array $data Additional data for finding product (optional). * */ public static function find($id, $data = []): ?array { } /** * Create a new product with the given data. * * @param array $data Array containing the necessary parameters. * * $data = [ * 'post_title' => (string) Required. The title of the product. * 'post_status' => (string) Optional. The status of the product default:draft. * 'post_content' => (string) Optional. The content of the product. * 'post_date' => (date) Optional. The date of the product. * 'detail' => (array) Required. Details of the product. * 'fulfillment_type' => (string) Required. The fulfillment type default:physical. * 'variation_type' => (string) Required. The variation type default:simple. * 'manage_stock' => (int) Required. The manage stock default:1. * ]; */ public static function create($data, $params = []) { } /** * Update a product with the given data. * * @param array $product Array containing the necessary parameters. * * $product = [ * 'ID' => (int) Required. The product ID. * 'post_title' => (string) Required. The title of the product. * 'post_status' => (string) Optional. The status of the product. * 'post_content' => (string) Optional. The content of the product. * 'post_date' => (string) Optional. The date of the product. * 'detail' => (array) Required. Details of the product. * 'id' => (int) Required. The detail ID. * 'post_id' => (int) Required. The product ID. * 'fulfillment_type' => (string) Required. The fulfillment type. * 'variation_type' => (string) Required. The variation type. * 'default_variation_id' => (int) Required. The default variation ID. * 'variants' => (array) Required. Variants of the product. * 'id' => (int) Required. The variant ID. * 'post_id' => (int) Required. The product ID. * 'variant_title' => (string) Required. The variant title. * 'item_price' => (float) Required. The item price. * 'compare_price' => (float) Required. The compare price. * 'manage_cost' => (string) Optional. Whether to manage costs. * 'item_cost' => (float) Required if manage cost is yes. The item cost. * 'manage_stock' => (string) Required. Whether to manage stock. * 'stock_status' => (string) Required. The stock status. * 'stock' => (int) Required. The stock quantity. * 'media' => (array) Optional. Info of media files for each variant. * 'id' => (string) Required if upload any media. The media ID. * 'url' => (string) Required if upload any media. The media URL. * 'title' => (string) Required if upload any media. The media title. * 'other_info' => (array) Optional. Other information for the variant. * 'payment_type' => (string) Required. The payment type. * 'times' => (string) Required. The number of times. * 'repeat_interval' => (string) Required. The repeat interval unit. * 'signup_fee' => (string) Required. The signup fee. * 'downloadable_files' => (array) Required if downloadable is true. * 'download_limit' => (string) Required. The download limit. * 'download_expiry' => (string) Required. The download expiry. * 'downloadable' => (bool) Optional. Whether the product is downloadable. * 'files' => (array) Optional. Info of downloadable files for each variant. * 'title' => (string) Required if files. The file title. * 'type' => (string) Required if files. The file type. * 'file_name' => (string) Required if files. The file name. * 'file_path' => (string) Required if files. The file path. * 'file_url' => (string) Required if files. The file URL. * 'serial' => (string) Required if files. The file serial * 'product_terms' => (array) Optional. Terms of the product. * 'product-categories' => (array) Required if categories. Product categories. * [0] => (int) Optional. The category ID. * 'product-brands' => (array) Required if brands. Product brands. * [0] => (int) Optional. The tag ID. * ]; */ public static function update($product, $postId = '', $params = []) { } public static function partialUpdate(array $data, $postId) { } public static function updateWpPost($postId, $params = []) { } /** * Delete a product and its associated data. * * @param int $postId The ID of the product to be deleted. * @param array $params Additional parameters for the deletion process. * */ public static function delete($postId, $params = []) { } /** * * @param $productId * @param $data * @return mixed */ public static function syncVariantOption($productId, $data = []) { } /** * Manage products based on the provided action and product IDs. * * @param array $params Optional. Array containing the necessary parameters * [ * 'action' => (string) Required. The action to be performed on the selected products. * (e.g., Possible values: 'delete_products') * 'product_ids' => (array) Required. Product IDs whose action will be performed. * ] * */ public static function manageBulkActions($params = []) { } public static function validateDownloadableFiles($data) { } public static function getNextProduct($productId, $skipOutOfStock) { } /** * Count total no of products. * */ public static function countTotalProducts() { } public static function syncTaxonomyTerms($data, $postId = '', $params = []) { } public static function deleteTaxonomyTerms($data, $postId = '', $params = []) { } public static function findByProductAndVariants(array $params = []) { } } class ProductVariationResource extends \FluentCart\Api\Resource\BaseResourceApi { public static function getQuery(): \FluentCart\Framework\Database\Orm\Builder { } public static function get(array $params = []): array { } /** * Find variant by its id. * * @param int $variantId The id of the variant. * @param array $data Additional data for finding variant (optional). * */ public static function find($variantId, $data = []) { } /** * Create a new variant with the given data. * * @param array $data Array containing the necessary parameters. * * $data = [ * 'id' => (int) Required. The variant ID. * 'post_id' => (int) Required. The product ID. * 'variant_title' => (string) Required. The variant title. * 'item_price' => (float) Required. The item price. * 'compare_price' => (float) Required. The compare price. * 'manage_cost' => (string) Optional. Whether to manage costs. * 'item_cost' => (float) Required if manage cost is yes. The item cost. * 'manage_stock' => (string) Required. Whether to manage stock. * 'stock_status' => (string) Required. The stock status. * 'stock' => (int) Required. The stock quantity. * 'media' => (array) Optional. Info of media files for each variant. * 'id' => (string) Required if upload any media. The media ID. * 'url' => (string) Required if upload any media. The media URL. * 'title' => (string) Required if upload any media. The media title. * 'other_info' => (array) Optional. Other information for the variant. * 'payment_type' => (string) Required. The payment type. * 'times' => (string) Required. The number of times. * 'repeat_interval' => (string) Required. The repeat interval unit. * 'signup_fee' => (string) Required. The signup fee. * 'downloadable_files' => (array) Required if downloadable is true. * 'download_limit' => (string) Required. The download limit. * 'download_expiry' => (string) Required. The download expiry. * 'downloadable' => (bool) Optional. Whether the product is downloadable. * 'files' => (array) Optional. Info of downloadable files for each variant. * 'title' => (string) Required if files. The file title. * 'type' => (string) Required if files. The file type. * 'file_name' => (string) Required if files. The file name. * 'file_path' => (string) Required if files. The file path. * 'file_url' => (string) Required if files. The file URL. * 'serial' => (string) Required if files. The file serial * ]; */ public static function create($variant, $params = []) { } /** * Update a variant with the given data. * * @param array $data Array containing the necessary parameters. * * $variant = [ * 'id' => (int) Required. The variant ID. * 'post_id' => (int) Required. The product ID. * 'variant_title' => (string) Required. The variant title. * 'item_price' => (float) Required. The item price. * 'compare_price' => (float) Required. The compare price. * 'manage_cost' => (string) Optional. Whether to manage costs. * 'item_cost' => (float) Required if manage cost is yes. The item cost. * 'manage_stock' => (string) Required. Whether to manage stock. * 'stock_status' => (string) Required. The stock status. * 'stock' => (int) Required. The stock quantity. * 'media' => (array) Optional. Info of media files for each variant. * 'id' => (string) Required if upload any media. The media ID. * 'url' => (string) Required if upload any media. The media URL. * 'title' => (string) Required if upload any media. The media title. * 'other_info' => (array) Optional. Other information for the variant. * 'payment_type' => (string) Required. The payment type. * 'times' => (string) Required. The number of times. * 'repeat_interval' => (string) Required. The repeat interval unit. * 'signup_fee' => (string) Required. The signup fee. * 'downloadable_files' => (array) Required if downloadable is true. * 'download_limit' => (string) Required. The download limit. * 'download_expiry' => (string) Required. The download expiry. * 'downloadable' => (bool) Optional. Whether the product is downloadable. * 'files' => (array) Optional. Info of downloadable files for each variant. * 'title' => (string) Required if files. The file title. * 'type' => (string) Required if files. The file type. * 'file_name' => (string) Required if files. The file name. * 'file_path' => (string) Required if files. The file path. * 'file_url' => (string) Required if files. The file URL. * 'serial' => (string) Required if files. The file serial * 'product_terms' => (array) Optional. Terms of the product. * 'product-categories' => (array) Required if categories. Product categories. * [0] => (int) Optional. The category ID. * 'product-tags' => (array) Required if tags. Product tags. * [0] => (int) Optional. The tag ID. * 'product-types' => (array) Required if types. Product types. * [0] => (int) Optional. The type ID. * ]; */ public static function update($variant, $variantId, $params = []) { } /** * Delete a variant and its associated data. * * @param int $variantId The id of the variant to be deleted. * @param array $params Additional parameters for the deletion process. * */ public static function delete($variantId, $params = []) { } public static function setImage($media, $variantId, $params = []) { } /** * Update a variant pricing table info with the given data. * @param int $variantId The id of the variant. * @param array $data Array containing the necessary parameters. * * $variant = [ * 'description' => (string) Required. The variant description. * ]; */ public static function updatePricingTable($variant, $variantId, $params = []) { } } class ShopResource extends \FluentCart\Api\Resource\BaseResourceApi { public static function getQuery(): \FluentCart\Framework\Database\Orm\Builder { } /** * Get product lists with specified filters. * * @param array $params Array containing the necessary parameters. * * $params = [ * 'filters' => (array) Optional. Additional filters for product retrieval * [ * 'wildcard' => (string) Optional. Wildcard for filtering by name, * 'enable_wildcard_for_post_content' => (int) Optional. Filter for post content, * 'categories' => (array) Optional. Filter by Category, * 'price_range_from' => (float) Optional. Minimum price for filtering, * 'price_range_to' => (float) Optional. Maximum price for filtering * ] * 'selected_status' => (bool) Optional. Whether to filter by selected status for Shop only, * 'status' => (array) Optional. * [ "post_status" => [ * "column" => "post_status", * "operator" => "(string)", * "value" => (string|array) ] * ], * 'term_ids_for_filter' => (array) Optional. IDs for filtering by category or tag, * 'select' => (string|array) Optional. Columns to select in the query, * 'with' => (an array) Optional. Relationships name to be eager loaded, * "admin_all_statuses" => (array) Optional. * [ "post_status" => [ * "column" => "post_status", * "operator" => "(string)", * "value" => (string|array) ] * ], * "admin_search" => (array) Optional. * [ "post_title" => [ * "column" => "post_title", * "operator" => "(string)", * "value" => (string|array) ] * ], * "admin_filters" => (array)Optional. * [ "column name" => [ * "column" => "column name", * "operator" => "(string)", * "value" => (string|array)] * ], * 'order_by' => (string) Optional. Column to order by, * 'order_type' => (string) Optional. Order type for sorting (ASC or DESC), * 'per_page' => (int) Optional. Number of items for per page, * 'page' => (int) Optional. Page number for pagination * ]; */ public static function get(array $params = []): array { } /** * Find product by its ID. * * @param int $productId The ID of the post. * @param array $data Additional data for finding product (optional). * */ public static function find($productId, $data = []): ?array { } /** * Retrieve similar product by its ID. * * @param int $id The ID of the post. * */ public static function getSimilarProducts($id, $asArray = true, $config = []) { } private static function applyPriceOrdering(string $orderDir): \Closure { } private static function buildTaxQuery($productId, $postType, $relatedBy): ?array { } private static function parseOrderBy(string $orderBy): array { } public static function create($data, $params = []) { } public static function update($productDetail, $postId, $params = []) { } public static function delete($detailId, $params = []) { } } class SubscriptionResource extends \FluentCart\Api\Resource\BaseResourceApi { public static function getQuery(): \FluentCart\Framework\Database\Orm\Builder { } public static function get(array $params = []) { } public static function find($id, $params = []) { } public static function create($data, $params = []) { } public static function update($data, $id, $params = []) { } public static function delete($id, $params = []) { } public static function view($id) { } } class UserResource extends \FluentCart\Api\Resource\BaseResourceApi { public static function getQuery(): \FluentCart\Framework\Database\Orm\Builder { } public static function get(array $params = []) { } public static function find($id, $params = []) { } /** * Create a new user with the given data * * @param array $data Required. Array containing the necessary parameters * [ * 'first_name' => (string) Required. The first name of the user,user * 'last_name' => (string) Required. The last name of the user, * 'email' => (string) Required. The email of the user, * 'password' => (string) Optional. The password of the user, * ] * @param array $params Optional. Additional parameters for creating an user. * [ * // Include optional parameters, if any. * ] * */ public static function create($data, $params = []) { } public static function login($data) { } public static function update($data, $id, $params = []) { } public static function delete($id, $params = []) { } } } namespace FluentCart\Api\Sanitizer { abstract class Sanitation { protected static function defaultSanitizerMap(): array { } private static function getSanitizeMap(): array { } public static function sanitizeAll($data): array { } } class Sanitizer { public const SANITIZE_EMAIL = 'sanitize_email'; public const SANITIZE_FILE_NAME = 'sanitize_file_name'; public const SANITIZE_HEX_COLOR = 'sanitize_hex_color'; public const SANITIZE_HEX_COLOR_NO_HASH = 'sanitize_hex_color_no_hash'; public const SANITIZE_HTML_CLASS = 'sanitize_html_class'; public const SANITIZE_KEY = 'sanitize_key'; public const SANITIZE_META = 'sanitize_meta'; public const SANITIZE_MIME_TYPE = 'sanitize_mime_type'; public const SANITIZE_OPTION = 'sanitize_option'; public const SANITIZE_SQL_ORDER_BY = 'sanitize_sql_orderby'; public const SANITIZE_TERM = 'sanitize_term'; public const SANITIZE_TERM_FIELD = 'sanitize_term_field'; public const SANITIZE_TEXT_FIELD = 'sanitize_text_field'; public const SANITIZE_TEXTAREA_FIELD = 'sanitize_textarea_field'; public const SANITIZE_TITLE = 'sanitize_title'; public const SANITIZE_TITLE_FOR_QUERY = 'sanitize_title_for_query'; public const SANITIZE_TITLE_WITH_DASHES = 'sanitize_title_with_dashes'; public const SANITIZE_USER = 'sanitize_user'; public const SANITIZE_URL = 'sanitize_url'; public const WP_KSES = 'wp_kses'; public const WP_KSES_POST = 'wp_kses_post'; public const FLOATVAL = 'floatval'; public static function getDefaultSanitizerMap(): array { } public static function sanitize(array $data, ?array $sanitizeMap = null): array { } } } namespace FluentCart\Api { class StorageDrivers { /** * @param string $driver name like local, s3 etc * Get storage driver settings * @return array * */ public function getSettings($driver) { } /** * @return array * * All storage drivers */ public function getAll() { } /** * @return array * * All active storage drivers */ public function getActive($withInstance = false) { } /** * @param string $driver name like local, s3 etc * Get storage driver Status * @return array * */ public function getStatus($driver) { } /** * @param array $data containing connect info and driver name like s3 etc * Get Verify connect info * @return array * */ public function verifyConnectInfo(array $data) { } } } namespace FluentCart\Framework\Support { interface ArrayableInterface { /** * Get the instance as an array. * * @return array */ public function toArray(); } } namespace FluentCart\Api { class StoreSettings implements \FluentCart\Framework\Support\ArrayableInterface { /** * @var string * * Store settings option name */ protected string $optionKey = 'fluent_cart_store_settings'; /** * @var array key value pair * * Store settings parsed from fields */ protected array $storeSettings; protected static $cachedStoreSettings = null; public function __construct() { } protected function getDefaultSettings(): array { } /** * @return array * * Get all store settings fields * @hook to use apply_filters("fluent_cart/store_setting_fields", $fields) */ public function fields($params = []): array { } public function isModuleTabEnabled(): bool { } /** * @param string|null $key like stripe or paypal * All store settings if key is not provided * @return mixed * */ public function get($key = null, $default = null) { } public function moduleSettings(): array { } /** * @param array $settings like Stripe or PayPal settings array * Save store settings * @return array * */ public function save(array $settings) { } public function set(string $key, $value) { } public function getCurrency() { } public function getCurrencySymbol() { } public function isCheckoutPage(): bool { } public function getCheckoutPageId() { } public function getPagesSettings(): array { } public function getCheckoutPage(): string { } public function getCustomerProfilePageId() { } public function getCustomerProfilePage(): string { } public function getCartPageId() { } public function getCartPage(): string { } public function getShopPageId() { } public function getShopPage(): string { } public function getReceiptPageId() { } public function getReceiptPage(): string { } public function getBuyButtonText(): string { } public function getViewCartButtonText(): string { } /** * @return string * * Get cart button text */ public function getCartButtonText(): string { } public function toArray(): array { } /** * @return string * * Get the base address1 for the store. */ public function getBaseAddressLine1() { } public function getFormattedFullAddress() { } /** * @return string * * Get the base address2 for the store. */ public function getBaseAddressLine2() { } /** * @return string * * Get the base country for the store. */ public function getBaseCountry() { } /** * @return string * * Get the base state for the store. */ public function getBaseState() { } /** * @return string * * Get the base city for the store. */ public function getBaseCity() { } /** * @return string * * Get the base postcode for the store. */ public function getBasePostcode() { } public function getInvoicePrefix() { } public function getInvoiceSuffix(): string { } public function getCustomerDashboardPageSlug($pageId = null, $cached = true) { } /** * Get theme colors as CSS variable string. * * @return string */ public function getThemeColors(): string { } public function getPageLink($pageId = null): string { } } class Taxonomy { public static function getTaxonomies($objectType = 'fluent-products', $publicOnly = true): array { } public static function syncTaxonomyTermsToProduct($productId, string $taxonomy, array $terms) { } public static function deleteTaxonomyTermFromProduct($productId, string $taxonomy, int $term) { } public static function deleteAllTermRelationshipsFromProduct($productId, string $taxonomy) { } public static function getFormattedTerms($taxonomy, $hideEmpty = false, $parents = null, $valueKey = 'value', $labelKey = 'label', $prefilled = null): array { } public static function getTermIdsFromTerms(array $terms): array { } public static function getTermIdsBySlugs($slugs, $taxonomy = 'product-categories'): array { } public static function addTaxonomyTerms(string $taxonomy, array $terms, array $args = []) { } public static function getTaxonomyLabels($taxonomy, $keys = []) { } public static function fetchTaxonomies($data): ?array { } public static function taxonomyWithTerms(): \FluentCart\Framework\Support\Collection { } } class User { public function register($data) { } public function login($data) { } public function validateAndLogin(array $data) { } public function validateAndCreate(array $data) { } public function createUser($processedData) { } protected function sendEmail($userId) { } protected function updateUser($processedData, $userId) { } protected function setUserLoggedIn($userId) { } protected function sendError($message, $code = 'error', $status = 400) { } protected function sendSuccess($data = [], $status = 200) { } } } namespace FluentCart\Api\Validator { abstract class Validation { public static function validate($data, $rules = []) { } } class FluentActivityValidator extends \FluentCart\Api\Validator\Validation { public static function rules(): array { } } class FluentMetaValidator extends \FluentCart\Api\Validator\Validation { public static function rules(): array { } } } namespace FluentCart\Framework\Foundation { /** * @method static db(); * @method static view(); * @method static events(); * @method static config(); * @method static request(); * @method static response(); * @method static encrypter(); * @method static validator(); */ class App { /** * Application instance * * @var \FluentCart\Framework\Foundation\Application */ protected static $instance = null; /** * Set the application instance * * @param \FluentCart\Framework\Foundation\Application $app */ public static function setInstance($app) { } /** * Get the application instance * * @param string $module The binding/key name for a component. * @param array $parameters constructor dependencies if any. * @return \FluentCart\Framework\Foundation\Application|mixed */ public static function getInstance($module = null, $parameters = []) { } /** * Retrive a component from the container * * @param string $module The binding/key name for a component. * @param array $parameters constructor dependencies if any. * @return \FluentCart\Framework\Foundation\Application|mixed */ public static function make($module = null, $parameters = []) { } /** * Handle dynamic method calls * * @param string $method * @param array $params * @return mixed */ public static function __callStatic($method, $params) { } } } namespace FluentCart\App { /** * Class App * * @method static \FluentCart\Framework\Http\Request\Request request() Get the current request instance. * @method static \FluentCart\Framework\Database\DatabaseManager db() * @method static \FluentCart\Framework\Http\Response\Response response() * @method static \FluentCart\Framework\View\View view() * @method static \FluentCart\Framework\Foundation\Config config() */ /** * @method static \FluentCart\Framework\Database\Query\WPDBConnection db() */ class App extends \FluentCart\Framework\Foundation\App { public static function slug(): string { } public static function route(): \FluentCart\Framework\Http\Route { } public static function call($action, array $parameters = []) { } public static function storeSettings(): \FluentCart\Api\StoreSettings { } /** * Get the payment gateway manager or a specific gateway * * @param string|null $gatewayName Optional gateway name to retrieve directly * @return \FluentCart\App\Modules\PaymentMethods\Core\GatewayManager|\FluentCart\App\Modules\PaymentMethods\Core\PaymentGatewayInterface|null */ public static function gateway(?string $gatewayName = null) { } public static function isProActive(): bool { } public static function doingRestRequest(): bool { } public static function isDevMode(): bool { } public static function localization() { } } } namespace FluentCart\App\CPT { class FluentProducts { const CPT_NAME = 'fluent-products'; protected $showStandaloneMenu = false; public function register() { } public function registerElementorScript() { } public function registerPostType() { } public function disableCreateAndEditForFluentProducts() { } public function registerProductTaxonomies() { } private function enqueueCustomEditorStyles() { } public function customizeTaxonomyScreen() { } public function handleThumbChange($meta_id, $object_id, $meta_key, $_meta_value) { } } class Pages { protected static array $cachedPages = []; public function pages(): array { } public function createPages(array $exclude = []): array { } public function getGeneratablePage(bool $withDefaultId = false): array { } public static function getPages($searchBy, $ignoreCache = false) { } public function handlePageDelete() { } public static function isPage($pageId): bool { } public static function getShopPageContent(): string { } } } namespace FluentCart\App { class ComposerScript { public static function postInstall(\Composer\Script\Event $event) { } public static function postUpdate(\Composer\Script\Event $event) { } } } namespace FluentCart\App\Events { abstract class EventDispatcher implements \FluentCart\Framework\Support\ArrayableInterface { protected array $listeners = []; public string $hook = ''; public bool $autoFireHook = true; public function dispatch() { } public function shouldCreateActivity(): bool { } public function getEventInfoForActivity(): array { } /** * @return mixed */ abstract public function getActivityEventModel(); public function beforeDispatch() { } public function afterDispatch() { } } class FirstTimePluginActivation extends \FluentCart\App\Events\EventDispatcher { protected array $listeners = [ //FirstTimeEvents\CreatePages::class, \FluentCart\App\Listeners\FirstTimePluginActivation\ManagePayments::class, \FluentCart\App\Listeners\FirstTimePluginActivation\SetupStore::class, ]; public \FluentCart\Api\StoreSettings $storeSettings; public function __construct() { } public function toArray(): array { } public function getActivityEventModel() { } public function shouldCreateActivity(): bool { } public static function handle() { } } } namespace FluentCart\App\Events\License { class LicenseRenewed extends \FluentCart\App\Events\EventDispatcher { public string $hook = 'fluent_cart/license_renewed'; protected array $listeners = []; /** * @var \FluentCartPro\App\Modules\Licensing\Models\License */ public \FluentCartPro\App\Modules\Licensing\Models\License $license; /** * @var \FluentCart\App\Models\Order */ public \FluentCart\App\Models\Order $order; public function __construct(\FluentCart\App\Models\Order $order, \FluentCartPro\App\Modules\Licensing\Models\License $license) { } public function toArray(): array { } public function getActivityEventModel() { } public function shouldCreateActivity(): bool { } } } namespace FluentCart\App\Events\Order { class OrderBulkAction extends \FluentCart\App\Events\EventDispatcher { public string $hook = 'fluent_cart/order_bulk_action'; protected array $listeners = [\FluentCart\App\Listeners\Order\OrderBulkAction::class]; /** * @var array $customerIds */ public $customerIds; public function __construct($customerIds) { } public function toArray(): array { } public function getActivityEventModel() { } public function shouldCreateActivity(): bool { } } class OrderCanceled extends \FluentCart\App\Events\EventDispatcher { public string $hook = 'fluent_cart/order_canceled'; protected array $listeners = [\FluentCart\App\Listeners\Order\OrderDeleted::class]; /** * @var \FluentCart\App\Models\Order $order */ public \FluentCart\App\Models\Order $order; public function __construct(\FluentCart\App\Models\Order $order) { } public function toArray(): array { } public function getActivityEventModel() { } public function afterDispatch() { } public function shouldCreateActivity(): bool { } } class OrderCreated extends \FluentCart\App\Events\EventDispatcher { public string $hook = 'fluent_cart/order_created'; protected array $listeners = [\FluentCart\App\Listeners\Order\OrderCreated::class]; /** * @var \FluentCart\App\Models\Order $order */ public \FluentCart\App\Models\Order $order; /** * @var \FluentCart\App\Models\Order|null $prevOrder */ public ?\FluentCart\App\Models\Order $prevOrder; /** * @var \FluentCart\App\Models\Customer|null $customer */ public ?\FluentCart\App\Models\Customer $customer; /** * @var \FluentCart\App\Models\OrderTransaction|null $transaction */ public ?\FluentCart\App\Models\OrderTransaction $transaction; public function __construct($order, $prevOrder = null, $customer = null, $transaction = null) { } public function toArray(): array { } public function getActivityEventModel() { } } class OrderDeleted extends \FluentCart\App\Events\EventDispatcher { public string $hook = 'fluent_cart/order_deleted'; protected array $listeners = [ // Listeners\UpdateStock::class, \FluentCart\App\Listeners\Order\OrderDeleted::class, ]; /** * @var \FluentCart\App\Models\Order $order */ public \FluentCart\App\Models\Order $order; /** * @var \FluentCart\App\Models\Customer|null $customer */ public array $connectedOrderIds; public function __construct(\FluentCart\App\Models\Order $order, $connectedOrderIds = []) { } public function toArray(): array { } public function getActivityEventModel() { } public function shouldCreateActivity(): bool { } } class OrderDeleting extends \FluentCart\App\Events\EventDispatcher { public string $hook = 'fluent_cart/order_before_delete'; protected array $listeners = [\FluentCart\App\Listeners\Order\OrderDeleting::class]; public \FluentCart\App\Models\Order $order; public array $connectedOrderIds; public bool $isTestMode; public string $type; public function __construct(\FluentCart\App\Models\Order $order, $connectedOrderIds = [], bool $isTestMode = false, string $type = '') { } public function toArray(): array { } public function getActivityEventModel() { } public function shouldCreateActivity(): bool { } } class OrderPaid extends \FluentCart\App\Events\EventDispatcher { public string $hook = 'fluent_cart/order_paid'; protected array $listeners = [\FluentCart\App\Listeners\Order\OrderPaid::class]; /** * @var \FluentCart\App\Models\Order $order */ public \FluentCart\App\Models\Order $order; /** * @var \FluentCart\App\Models\Customer|null $customer */ public ?\FluentCart\App\Models\Customer $customer; /** * @var \FluentCart\App\Models\OrderTransaction|null $transaction */ public ?\FluentCart\App\Models\OrderTransaction $transaction; public function __construct(\FluentCart\App\Models\Order $order, $customer = null, $transaction = null) { } public function toArray(): array { } public function getActivityEventModel() { } public function beforeDispatch() { } public function afterDispatch() { } } class OrderPaymentFailed extends \FluentCart\App\Events\EventDispatcher { public string $hook = 'fluent_cart/order_payment_failed'; protected array $listeners = [\FluentCart\App\Listeners\Order\OrderPaymentFailed::class]; /** * @var \FluentCart\App\Models\Order $order */ public \FluentCart\App\Models\Order $order; /** * @var \FluentCart\App\Models\Customer|null $customer */ public ?\FluentCart\App\Models\Customer $customer; /** * @var OrderTransaction|null $transaction */ /** * @var string|null $oldStatus */ public ?string $oldStatus; /** * @var string|null $newStatus */ public ?string $newStatus; /** * @var string|null $reason */ public ?string $reason; public ?\FluentCart\App\Models\OrderTransaction $transaction; public function __construct(\FluentCart\App\Models\Order $order, $transaction = null, $oldStatus = null, $newStatus = null, $reason = null) { } public function toArray(): array { } public function getActivityEventModel() { } public function beforeDispatch() { } public function afterDispatch() { } } class OrderRefund extends \FluentCart\App\Events\EventDispatcher { public string $hook = 'fluent_cart/order_refunded'; public bool $autoFireHook = false; protected array $listeners = [\FluentCart\App\Listeners\Order\OrderRefunded::class]; public \FluentCart\App\Models\Order $order; public ?\FluentCart\App\Models\OrderTransaction $transaction; /** * @var int[] Array of refunded order item IDs */ public array $refundedItemIds; public array $refundedItems; public bool $manageStock; /* * Refunded amount in cents */ public int $refundedAmount; public ?\FluentCart\App\Models\Customer $customer; public string $type; public bool $willTrigger = true; /** * OrderRefunded constructor. * * @param \FluentCart\App\Models\Order $order The refunded order * @param \FluentCart\App\Models\OrderTransaction|null $transaction The related transaction, if any * @param int[] $refundedItemIds Array of refunded order item IDs * @param bool $manageStock Whether to manage stock */ public function __construct(\FluentCart\App\Models\Order $order, ?\FluentCart\App\Models\OrderTransaction $createdRefund = null, array $refundedItemIds = [], bool $manageStock = false, $refundedItems = []) { } public function toArray(): array { } public function getActivityEventModel() { } public function afterDispatch() { } } class OrderStatusUpdated extends \FluentCart\App\Events\EventDispatcher { public string $hook = 'fluent_cart/order_status_updated'; public bool $autoFireHook = false; protected array $listeners = []; /** * @var \FluentCart\App\Models\Order $order */ public \FluentCart\App\Models\Order $order; public ?string $oldStatus; public ?string $newStatus; public ?bool $manageStock; public array $activity = []; public string $type; protected $willDispatch = true; public function __construct(\FluentCart\App\Models\Order $order, $oldStatus = null, $newStatus = null, $manageStock = true, $activity = [], $type = 'payment_status') { } public function toArray(): array { } public function getActivityEventModel() { } public function getEventInfoForActivity(): array { } public function afterDispatch() { } } class OrderUpdated extends \FluentCart\App\Events\EventDispatcher { public string $hook = 'fluent_cart/order_updated'; protected array $listeners = [ // Listeners\UpdateStock::class, \FluentCart\App\Listeners\Order\OrderUpdated::class, ]; /** * @var \FluentCart\App\Models\Order $order */ public \FluentCart\App\Models\Order $order; public \FluentCart\App\Models\Order $oldOrder; public function __construct(\FluentCart\App\Models\Order $order, \FluentCart\App\Models\Order $oldOrder) { } public function toArray(): array { } public function getActivityEventModel() { } } class RenewalOrderDeleted extends \FluentCart\App\Events\EventDispatcher { public string $hook = 'fluent_cart/renewal_order_deleted'; protected array $listeners = [ // Listeners\UpdateStock::class, \FluentCart\App\Listeners\Order\RenewalOrderDeleted::class, ]; /** * @var \FluentCart\App\Models\Order $order */ public \FluentCart\App\Models\Order $order; /** * @var \FluentCart\App\Models\Customer|null $customer */ public function __construct(\FluentCart\App\Models\Order $order) { } public function toArray(): array { } public function getActivityEventModel() { } public function shouldCreateActivity(): bool { } } } namespace FluentCart\App\Events { class PlanChanged extends \FluentCart\App\Events\EventDispatcher { public string $hook = 'fluent_cart/plan_changed'; protected array $listeners = []; public \FluentCart\App\Models\Order $order; public \FluentCart\App\Models\ProductVariation $newVariation; public \FluentCart\App\Models\ProductVariation $oldVariation; public array $otherInfo = []; public function __construct(\FluentCart\App\Models\Order $order, \FluentCart\App\Models\ProductVariation $newVariation, \FluentCart\App\Models\ProductVariation $oldVariation, $otherInfo = null) { } public function toArray(): array { } public function getActivityEventModel() { } public function shouldCreateActivity(): bool { } } /** * Fired when a product's variation set changes in a way that can invalidate its * default_variation_id — combinations regenerated/removed, or a variant set * active/inactive. Distinct from StockChanged (which is broad and currently * carries no default listener) so this stays scoped to variant-set mutations. * UpdateDefaultVariation re-resolves the default to the first purchasable * combination; works for every variation type. */ class ProductVariationsChanged extends \FluentCart\App\Events\EventDispatcher { public string $hook = 'fluent_cart/product_variations_changed'; protected array $listeners = [\FluentCart\App\Listeners\UpdateDefaultVariation::class]; /** * @var array $postIds */ public $postIds; public function __construct($postIds) { } public function toArray(): array { } public function getActivityEventModel() { } public function shouldCreateActivity(): bool { } } class StockChanged extends \FluentCart\App\Events\EventDispatcher { public string $hook = 'fluent_cart/product_stock_changed'; protected array $listeners = []; /** * @var array $postIds */ public $postIds; /** * @var array|null $otherInfo */ public ?array $otherInfo; public function __construct($postIds, $otherInfo = null) { } public function toArray(): array { } public function getActivityEventModel() { } public function shouldCreateActivity(): bool { } } } namespace FluentCart\App\Events\Subscription { class SubscriptionActivated extends \FluentCart\App\Events\EventDispatcher { public string $hook = 'fluent_cart/subscription_activated'; protected array $listeners = []; /** * @var \FluentCart\App\Models\Subscription $subscription */ public \FluentCart\App\Models\Subscription $subscription; /** * @var \FluentCart\App\Models\Customer|null $customer */ public ?\FluentCart\App\Models\Customer $customer; /** * @var \FluentCart\App\Models\Order|null $order */ public ?\FluentCart\App\Models\Order $order; public array $meta = []; public function __construct($subscription, $order = null, $customer = null, $meta = []) { } public function toArray(): array { } public function getActivityEventModel() { } } class SubscriptionCanceled extends \FluentCart\App\Events\EventDispatcher { public string $hook = 'fluent_cart/subscription_canceled'; protected array $listeners = []; /** * @var \FluentCart\App\Models\Subscription $subscription */ public \FluentCart\App\Models\Subscription $subscription; /** * @var \FluentCart\App\Models\Customer|null $customer */ public ?\FluentCart\App\Models\Customer $customer; /** * @var \FluentCart\App\Models\Order|null $order */ public ?\FluentCart\App\Models\Order $order; public string $reason; public function __construct($subscription, $order = null, $customer = null, $reason = '') { } public function toArray(): array { } public function getActivityEventModel(): \FluentCart\App\Models\Subscription { } public function shouldCreateActivity(): bool { } } class SubscriptionEOT extends \FluentCart\App\Events\EventDispatcher { public string $hook = 'fluent_cart/subscription_eot'; protected array $listeners = []; /** * @var \FluentCart\App\Models\Subscription */ public \FluentCart\App\Models\Subscription $subscription; /** * @var \FluentCart\App\Models\Order */ public \FluentCart\App\Models\Order $order; public function __construct(\FluentCart\App\Models\Subscription $subscription, \FluentCart\App\Models\Order $order) { } public function toArray(): array { } public function beforeDispatch() { } public function getActivityEventModel() { } public function shouldCreateActivity(): bool { } } class SubscriptionPaused extends \FluentCart\App\Events\EventDispatcher { public string $hook = 'fluent_cart/subscription_paused'; protected array $listeners = []; public \FluentCart\App\Models\Subscription $subscription; public ?\FluentCart\App\Models\Order $order; public ?\FluentCart\App\Models\Customer $customer; public ?string $oldStatus; public string $reason; public function __construct(\FluentCart\App\Models\Subscription $subscription, ?\FluentCart\App\Models\Order $order = null, ?\FluentCart\App\Models\Customer $customer = null, ?string $oldStatus = null, string $reason = '') { } public function toArray(): array { } public function getActivityEventModel(): \FluentCart\App\Models\Subscription { } public function shouldCreateActivity(): bool { } } class SubscriptionPeriodSkipped extends \FluentCart\App\Events\EventDispatcher { public string $hook = 'fluent_cart/subscription_period_skipped'; protected array $listeners = []; public \FluentCart\App\Models\Subscription $subscription; public ?\FluentCart\App\Models\Order $order; public ?\FluentCart\App\Models\Customer $customer; public ?string $oldNextBillingDate; public ?string $newNextBillingDate; public function __construct(\FluentCart\App\Models\Subscription $subscription, ?\FluentCart\App\Models\Order $order = null, ?\FluentCart\App\Models\Customer $customer = null, ?string $oldNextBillingDate = null, ?string $newNextBillingDate = null) { } public function toArray(): array { } public function getActivityEventModel(): \FluentCart\App\Models\Subscription { } public function shouldCreateActivity(): bool { } } class SubscriptionReactivated extends \FluentCart\App\Events\EventDispatcher { public string $hook = 'fluent_cart/subscription_reactivated'; protected array $listeners = []; public \FluentCart\App\Models\Subscription $subscription; public ?\FluentCart\App\Models\Customer $customer; public ?\FluentCart\App\Models\Order $order; public ?string $oldStatus; public function __construct(\FluentCart\App\Models\Subscription $subscription, ?\FluentCart\App\Models\Order $order = null, ?\FluentCart\App\Models\Customer $customer = null, ?string $oldStatus = null) { } public function toArray(): array { } public function getActivityEventModel() { } } class SubscriptionRenewed extends \FluentCart\App\Events\EventDispatcher { public string $hook = 'fluent_cart/subscription_renewed'; protected array $listeners = [\FluentCart\App\Listeners\Subscription\SubscriptionRenewed::class]; /** * @var \FluentCart\App\Models\Subscription $subscription */ public \FluentCart\App\Models\Subscription $subscription; /** * @var \FluentCart\App\Models\Customer|null $customer */ public ?\FluentCart\App\Models\Customer $customer; /** * @var \FluentCart\App\Models\Order|null $newOrder */ public ?\FluentCart\App\Models\Order $newOrder; /** * @var \FluentCart\App\Models\Order|null $oldOrder */ public ?\FluentCart\App\Models\Order $oldOrder; public function __construct($subscription, $newOrder, $oldOrder, $customer) { } public function toArray(): array { } public function beforeDispatch() { } public function getActivityEventModel() { } } class SubscriptionResumed extends \FluentCart\App\Events\EventDispatcher { public string $hook = 'fluent_cart/subscription_resumed'; protected array $listeners = []; public \FluentCart\App\Models\Subscription $subscription; public ?\FluentCart\App\Models\Order $order; public ?\FluentCart\App\Models\Customer $customer; public ?string $oldStatus; public string $reason; public function __construct(\FluentCart\App\Models\Subscription $subscription, ?\FluentCart\App\Models\Order $order = null, ?\FluentCart\App\Models\Customer $customer = null, ?string $oldStatus = null, string $reason = '') { } public function toArray(): array { } public function getActivityEventModel(): \FluentCart\App\Models\Subscription { } public function shouldCreateActivity(): bool { } } class SubscriptionUpdated extends \FluentCart\App\Events\EventDispatcher { public string $hook = 'fluent_cart/subscription_updated'; protected array $listeners = []; public \FluentCart\App\Models\Subscription $subscription; public ?\FluentCart\App\Models\Order $order; public ?\FluentCart\App\Models\Customer $customer; public array $updates; public array $changes; public function __construct(\FluentCart\App\Models\Subscription $subscription, ?\FluentCart\App\Models\Order $order = null, ?\FluentCart\App\Models\Customer $customer = null, array $updates = [], array $changes = []) { } public function toArray(): array { } public function getActivityEventModel(): \FluentCart\App\Models\Subscription { } public function shouldCreateActivity(): bool { } } class SubscriptionValidityExpired extends \FluentCart\App\Events\EventDispatcher { public string $hook = 'fluent_cart/subscription_expired_validity'; protected array $listeners = []; /** * @var \FluentCart\App\Models\Subscription $subscription */ public \FluentCart\App\Models\Subscription $subscription; /** * @var \FluentCart\App\Models\Customer|null $customer */ public ?\FluentCart\App\Models\Customer $customer; /** * @var \FluentCart\App\Models\Order|null $order */ public ?\FluentCart\App\Models\Order $order; public string $reason; public function __construct(\FluentCart\App\Models\Subscription $subscription, $order = null, $customer = null, $reason = '') { } public function toArray(): array { } /** * @return \FluentCart\App\Models\Subscription */ public function getActivityEventModel() { } public function shouldCreateActivity(): bool { } } } namespace FluentCart\App\Events { class UserCreated extends \FluentCart\App\Events\EventDispatcher { public string $hook = 'fluent_cart/user_created'; protected array $listeners = []; public $user; public $userId; public $password; public function __construct($user, $userId, $password) { } public function toArray(): array { } public function getActivityEventModel() { } } } namespace FluentCart\App\Helpers { class AddressHelper { public static function insertOrderAddresses($orderId, $billingAddress, $shippingAddress) { } public static function createOrderAddress($orderId, array $address) { } public static function getIpAddress($anonymize = false) { } private static function isCfIp($ip = '') { } private static function ipInRange($ip, $range) { } public static function getStateNameByCode($stateCode, $countryCode = null) { } public static function getCountryNameByCode($countryCode) { } public static function getUserAgent($sanitize = true) { } /** * Guess first name and last name from the full name. * * @param string $fullName * @return array */ public static function guessFirstNameAndLastName($fullName): array { } public static function getAvailableShippingMethodLists($data): array { } public static function getShippingMethods($country, $state = null, $timezone = null) { } /** * Get shipping methods for a specific shipping class (or General if null). * * @param string $country Country code * @param string|null $state State code * @param int|null $shippingClassId Shipping class ID (null for General zones) * @return array|\WP_Error */ public static function getShippingMethodsForClass($country, $state = null, $shippingClassId = null) { } public static function getCustomerValidatedAddresses($config, $customer): array { } public static function getPrimaryAddress(array $addresses, array $config, $customer, $type = 'billing') { } public static function maybePushAddressDataForCheckout($data, $type = 'billing') { } public static function mergeBillingWithShipping($data) { } public static function getDefaultBillingCountryForCheckout() { } } class AdminHelper { public static function getProductMenu($product, $echo = false, $activeMenu = '') { } private static function getProductsMenu($baseUrl) { } public static function getAdminMenu($echo = false, $activeNav = '') { } public static function getMenuItems($withSettings = false) { } public static function pushGlobalAdminAssets() { } } class AdminOrderProcessor { private $args = []; private $checkoutItems = []; // Order Related Data private $formattedIOrderItems = []; private $orderData = []; private $subscriptionData = []; // Models private $orderModel; private $transactionModel; private $subscriptionModel; // Store Settings private $storeSettings; private $couponDiscountTotal = 0; private $manualDiscountTotal = 0; public function __construct($checkoutItems = [], $args = []) { } private function prepareData() { } private function prepareOrderItems() { } private function prepareOrderData() { } public function createDraftOrder($prevOrder = null) { } private function insertAppliedCoupons($appliedCoupons, $removeOldCoupons = false): void { } public function getTransaction() { } public function getOrder() { } public function getSubscription() { } private function prepareSubscriptionData() { } /** * @param $inputData * @return array */ private function convertToSubscriptionFormat($inputData) { } } /** * Helper for the store attribute library and per-item attribute snapshots. * * @package FluentCart\App\Helpers * * @version 1.0.0 */ class AttributeHelper { /** * Return the store attribute library, or a single group set by slug. * * Loads every attribute group (with its terms) ONCE per request into a * static cache, then serves all later calls from memory — so resolving * variant attributes for many cart/order items never re-queries the DB. * * Shape — groups keyed by slug; each group carries its meta plus every term * keyed by slug DIRECTLY on the group, so `color.red` resolves the term: * [ * 'color' => [ * 'title' => 'Color', * 'slug' => 'color', * 'type' => 'color', * 'red' => ['title' => 'Red', 'slug' => 'red', 'settings' => [...]], * 'blue' => ['title' => 'Blue', 'slug' => 'blue', 'settings' => [...]], * ], * ] * * Note: term slugs share the group array with the reserved meta keys * `title`/`slug`/`type`; product attribute terms never use those slugs. * * @param string $attrSlug Group slug (e.g. 'color', 'size'). Empty = all. * @return array Single group set, the whole library keyed by group slug when * $attrSlug is empty, or [] when the slug is not found. */ public static function getStoreProductAttributeSet($attrSlug = '') { } /** * Build the `item_attributes` snapshot for a single cart/order line item. * * Stored at `other_info['item_attributes']` on cart_data items and order_items. * FluentCart's own attributes are keyed `pa_{group_slug}`; the value is the * term TITLE and slug is the term SLUG — frozen at the moment it is written so * later renames in the attribute library never rewrite past orders. Third-party * providers append their own entries (WITHOUT the `pa_` prefix) via the * `fluent_cart/item_attributes` filter — they supply their own group slug as * the key plus value/slug. * * Output shape: * [ * 'pa_color' => ['value' => 'Red', 'slug' => 'red'], * 'pa_size' => ['value' => 'XS', 'slug' => 'xs'], * 'fluent_booking_start' => ['value' => '2026-06-29 12:12:00', 'slug' => 'fluent_booking'], * ] * * @param int $variationId Product variation id (order/cart item object_id). * @param int $productId Owning product id (passed to the filter for context). * @return array */ public static function getProductItemAttributes($variationId, $productId = 0) { } /** * Batched variant of getProductItemAttributes — resolves the item_attributes * snapshot for many variations with a SINGLE whereIn query, so cart writes * carrying several unsnapshotted items don't run one query per item. The * per-item `fluent_cart/item_attributes` filter still fires for each variation. * * @param array $variationIds Variation (object) ids. * @param array $productIds Optional variationId => productId map for filter context. * @return array variationId => item_attributes */ public static function getProductItemsAttributes($variationIds, $productIds = []) { } /** * Attach a resolved `variation_display_title` ("Color: Red | Size: S") to every * variation of the given products — the picker/list-side mirror of the order * item display. * * Resolves the attribute snapshot for ALL variations in ONE batched query (no * per-variant N+1), and only touches products whose `detail.variants` relation * is eager-loaded — so callers that don't load variants pay nothing. Variations * are mutated in place; the value falls back to the raw variation_title for * simple products. Reusable across any product-list endpoint. * * @param iterable $products Product models with `detail.variants` loaded. * @return void */ public static function attachVariationDisplayTitles($products) { } /** * The store's attribute groups as a lightweight slug => label/type map. * * Sourced from the request-cached `getStoreProductAttributeSet()` registry, * so this is only the current (live) group labels — used to resolve the * display title of a frozen `pa_{slug}` snapshot entry. * * @return array e.g. ['color' => ['title' => 'Color', 'slug' => 'color', 'type' => 'color']] */ public static function getMainAttributes() { } /** * Resolve a line item's stored `item_attributes` snapshot into display rows. * * FluentCart attributes (keyed `pa_{group_slug}`) are resolved against the * live group library for their display title; the term value/slug come from * the frozen snapshot. A `pa_*` entry whose group no longer exists is * skipped. Third-party (un-prefixed) entries are resolved through the * `fluent_cart/item_display_attr_{key}` filter so the owning plugin can * shape its own label/value. * * @param array $itemAttributes other_info['item_attributes'] snapshot. * @param mixed $item Owning cart/order item (passed to filters). * @param string $scope 'cart' | 'order_item' (passed to filters). * @return array Keyed by attr key: ['display_title','attr_key','slug','display_value','is_system'] */ public static function getDisplayAttributes(array $itemAttributes, $item = null, $scope = 'cart') { } /** * Render a line item's variation display string. * * Returns the labeled attribute combination ("Color: Red | Size: XS") when * the item carries an attribute snapshot. When no attributes resolve it * falls back to the item's variation title — staying empty for simple * products whose title equals their post_title (no real variation). So * callers can use the return value directly without their own fallback. * * @param array $itemAttributes other_info['item_attributes'] snapshot. * @param mixed $item Owning cart/order item (model or array). * @param string $scope 'cart' | 'order_item'. * @param string $separator Glue between pairs (default ' | '). * @return string e.g. "Color: Red | Size: XS", the variation title, or '' */ public static function getDisplayAttributesString(array $itemAttributes, $item = null, $scope = 'cart', $separator = ' | ') { } /** * Variation title used when no attributes resolve — empty for simple * products (title === post_title), otherwise the variation title. * * @param mixed $item Cart/order item model or array. * @return string */ protected static function variationTitleFallback($item) { } } class CartCheckoutHelper implements \FluentCart\Framework\Support\ArrayableInterface { private $cart; private ?array $utmData = []; private ?array $checkoutData = []; protected ?\FluentCart\Api\StoreSettings $storeSettings = null; static $instance = false; protected array $couponDiscountData = []; public bool $disableCoupon = false; public function __construct($disableCoupon = false) { } public static function make($disableCoupon = false): ?\FluentCart\App\Helpers\CartCheckoutHelper { } public function init() { } public function hasSubscription(): string { } public function isZeroPayment(): bool { } protected function applyCoupon() { } public function getCouponDiscountData(): array { } public function getAppliedCouponCodes(): array { } public function setCouponDiscountData(array $data) { } public function validateCartItems() { } public function getCountryList(): array { } /** * @return \FluentCart\Api\StoreSettings */ public function getStoreSettings(): \FluentCart\Api\StoreSettings { } public function setCart(\FluentCart\App\Models\Cart $cart) { } public function getCart() { } protected function prepareCartData(\FluentCart\App\Models\Cart $cart) { } /** * @param \FluentCart\App\Models\ProductVariation $variation * * @return \FluentCart\App\Models\Cart */ public static function getCartFromVariation(\FluentCart\App\Models\ProductVariation $variation): \FluentCart\App\Models\Cart { } public function getSettings($setting = '') { } public function getItems(): array { } public function getUtmData($data): array { } public function isEmailLocked() { } public function getUserId() { } public function getUser() { } public function getCustomer($email = '') { } public function requireShippingAddress(): bool { } public function getEmail() { } public function getFullName() { } public function getFirstName() { } /** * @param $productId * * @return array|null */ public function getOriginalProduct($productId): ?array { } /** * @param $itemId * * @return \FluentCart\Framework\Database\Orm\Builder|\FluentCart\Framework\Database\Orm\Builder[]|\FluentCart\Framework\Database\Orm\Collection|\FluentCart\Framework\Database\Orm\Model|null */ public function getOriginalItem($itemId) { } public function getLastName() { } public function getBillingAddress($withNameEmail = false) { } public function getShippingAddress() { } public function getAddressBaseFields($type = 'billing'): array { } public function getAddressFields($type = 'billing') { } public function getBillingAddressFields($viewData = []) { } public function getShippingAddressFields($viewData = []) { } public function getItemsAmountTotal($formatted = true, $withCurrency = true, $shippingTotal = 0) { } public function getItemsAmountTotalWithShipping($shippingTotal = 0, $formatted = true, $withCurrency = true) { } public function getItemsAmountSubtotal($formatted = true, $withCurrency = true) { } public function getSignupFields() { } public function getLoginFields() { } public function getCartHash() { } public function toArray(): array { } public function getCouponFields() { } public function getManualDiscountAmount() { } public function getProrateCreditAmount() { } } class CartHelper { public static function getCart($hash = null, $create = false) { } public static function generateCartItemFromVariation(\FluentCart\App\Models\ProductVariation $variation, $quantity = 1): array { } public static function generateCartItemCustomItem(array $variation, $quantity = 1): array { } public static function calculateShippingCharge(\FluentCart\App\Models\ProductVariation $variation, int $quantity = 1) { } private static function itemHasFreeShipping($item): bool { } private static function excludeFreeShippingPhysicalItems(array &$items, array &$physicalItems): void { } public static function calculateShippingMethodCharge(\FluentCart\App\Models\ShippingMethod $method, ?array $items = null, $returnType = 'amount') { } /** * Calculate shipping charges using the profile-based approach. * Groups cart items by shipping class, finds applicable methods per profile, * falls back to General zones when no class-specific zones exist. * * @param int $shippingMethodId The selected shipping method ID * @param array $cartItems Cart items * @param string $country Country code * @param string|null $state State code * @param string $returnType 'amount' or 'items' * @return int|array */ public static function calculateShippingByProfile($shippingMethodId, $cartItems, $country, $state = null, $returnType = 'amount') { } public static function resetShippingCharge() { } public static function generateCartFromVariation(\FluentCart\App\Models\ProductVariation $variation, $quantity = 1): \FluentCart\App\Models\Cart { } public static function addCommonCartData(\FluentCart\App\Models\Cart $cart) { } public static function generateCartFromCustomVariation(array $variation, $quantity = 1): \FluentCart\App\Models\Cart { } /** * Normalize custom item fields to standard cart variation format. * * NOTE: * - Custom items may originate from external sources (filters, adjustments, migrations) * - Some sources provide `id`, others only provide `item_id` * - For cart consistency, `id` is required and will fall back to `item_id` when missing * - This method intentionally mutates the provided object to normalize field names. * The variation object is treated as a transient data structure and is not reused * elsewhere after normalization. * * @param object $variation * @return object */ public static function normalizeCustomFields(object $variation): object { } /** * @param \FluentCart\App\Models\ProductVariation $variation * @param int|string $updatedQuantity * @return bool */ public static function shouldAddItemToCart(\FluentCart\App\Models\ProductVariation $variation, $updatedQuantity): bool { } public static function doingInstantCheckout() { } /** * @param \FluentCart\App\Models\Cart $cart * @param array|\WP_Error $methods * @param string|int|null $currentSelectedId * @return string|int|null */ public static function resolveAutoSelectShippingMethod($cart, $methods, $currentSelectedId) { } } class CheckoutProcessor { // Raw Data private $cartItems = []; private $args = []; // Order Related Data private $formattedIOrderItems = []; private $orderData = []; private $subscriptionData = []; // Models private $orderModel; private $transactionModel; private $subscriptionModel; // Fee tracking private $feeTotal = 0; // Store Settings private $storeSettings; private $couponDiscountTotal = 0; private $manualDiscountTotal = 0; private $prorateCreditTotal = 0; private $upgradeDiscountTotal = 0; public function __construct($cartItems = [], $args = []) { } private function prepareData() { } public function createDraftOrder($prevOrder = null) { } private function getAdjustedOrder(\FluentCart\App\Models\Order $prevOrder) { } private function persistTaxMeta() { } private function insertAppliedCoupons($appliedCoupons, $removeOlds = false, $order = null): void { } public function getTransaction() { } public function getOrder() { } public function getSubscription() { } private function prepareOrderItems() { } private function prepareSubscriptionData() { } private function determineCollectionMethod(): string { } private function prepareOrderData() { } private function syncFeeItems() { } /** * @param $inputData * @return array */ private function convertToSubscriptionFormat($inputData) { } /** * bill_count is derived from counting total > 0 CHARGE transactions linked to * the subscription (see syncSubscriptionStates / getRequiredBillTimes), which * can't tell "this was a billed cycle" from "this was something else * charged alongside it." Two corrections needed only at initial checkout — * is_trial_days_simulated alone can't be used at runtime because * payment-method switching also sets that flag: * * - Simulated trial, $0 first cycle: consumes a cycle but produces no * total > 0 transaction — add billed_cycles_offset so it still counts. * - Real trial with a signup fee: the initial charge is the signup fee only * (the recurring item isn't billed yet), but it IS a total > 0 transaction * linked to the subscription — mark billed_cycles_deduction so it does * NOT count as a cycle. */ private function syncInitialCycleCounting() { } } /** * Class CouponHelper * * This class provides utility functions related to coupons and their validation, cancellation, and calculation of discounts. */ class CouponHelper { /** * Validates a coupon against various criteria. * * @param object $appliedCoupon The coupon object to be validated. * * @return array An array containing validation results. */ public static function getQuery(): \FluentCart\Framework\Database\Orm\Builder { } public function calculateCoupon($appliedCouponList, $orderTotal) { } public function storeAppliedCouponData($appliedCouponList, $appliedDiscountsList, $orderId) { } /** * Calculates the discount based on the coupon code and purchase amount. * * @param string $couponCode The code of the coupon. * @param float $purchaseAmount The total purchase amount. * * @return float The calculated discount amount. */ public static function calculateDiscount($coupon, $applicableTotalWithItems) { } /** * Cancels a coupon and adjusts the purchase amount if needed. * * @param object $cancelledCoupon The coupon object to cancel. * * @return array|null An array with the adjusted purchase amount if the coupon is canceled. */ public static function checkStackability($appliedCoupon, $appliedCouponList, $coupon) { } //Returning false from this method meaning the coupon is valid public static function checkUsageLimit(\FluentCart\App\Models\Coupon $coupon, $customerEmail = '', $trigger = null) { } public static function sortByPriority($appliedCouponList = []) { } public static function getSingleCouponDetails($coupon, $discount) { } public static function getCouponPriority($couponCode) { } public function prepareCouponCalculation($order) { } public static function checkProductEligibility($productId, $couponCode, $origin) { } public static function getCouponApplicableItemsWithLineTotal($coupon, $modifiedOrderItems) { } public static function updateCouponStatus($coupon = []) { } } class CurrenciesHelper { /** * https://support.stripe.com/questions/which-currencies-does-stripe-support */ public static function getCurrencies($code = null) { } /** * Get the available locales that Stripe can use * * @return array */ public static function getLocales() { } public static function getCurrencySigns() { } public static function getCurrencySign($currency = 'USD') { } public static function getCurrencyWithSign($currencies = []) { } public static function zeroDecimalCurrencies() { } public static function isZeroDecimal($currencyCode): bool { } public static function updateCurrencyArray($oldCurrencies = [], $amount = 0, $currency = ''): array { } public static function centsToDecimal($cents, $currency = null) { } } class CustomerHelper { /** * @return array * @param array $customer with details info like email, name */ public function sanitizeCustomer($customer) { } /** * @return Boolean * * Check email is already available or not */ /** * @return Boolean Check the request owner has right permission * or throw new \Exception('You don\'t have permission!') */ public function updateCustomer($id, $data) { } public function createWpUser($newCustomer) { } //Using Resource Api /*public function manageCustomer($selected) { sleep(1); $action = sanitize_text_field(Arr::get($selected, 'action', '')); $customerIds = Arr::get($selected, 'customer_ids', []); $customerIds = array_map(function ($id) { return (int)$id; }, $customerIds); $customerIds = array_filter($customerIds); if (!$customerIds) { throw new \Exception(__('Customers selection is required', 'fluent-cart')); } $customersApi = new Customers(); if ($action == 'delete_customers') { return $customersApi->delete($customerIds); } if ($action == 'change_customer_status') { return $customersApi->updateStatus($selected); } throw new \Exception(__('Selected action is invalid', 'fluent-cart')); }*/ public static function getRepeatCustomerBySearch($params) { } public static function checkDownloadPermissionAndStoreLog($params) { } private static function storeDownloadLog($data, ?\FluentCart\App\Models\OrderDownloadPermission $orderDownloadPermission = null) { } // public static function storeDownloadLog($params) // { // if (!is_user_logged_in()) { // wp_send_json_error(['message' => __('You are not logged in', 'fluent-cart')], 423); // } // $order = Arr::get($params, 'order'); // $downloadId = Arr::get($params, 'download_id'); // $order = OrderResource::find($order, [ // 'with' => [ // 'order_items' => function ($query) use ($downloadId) { // return $query->with(['product_downloads']) // ->whereHas('product_downloads', function ($query) use ($downloadId) { // $query->where('id', $downloadId); // }); // } // ] // ]); // if ($order) { // if (empty($order->customer) || wp_get_current_user()->ID != $order->customer->user_id) { // wp_send_json_error(['message' => __('Sorry, This is not your order', 'fluent-cart')], 423); // } // $orderId = Arr::get($order, 'id'); // $orderItem = $order->order_items->first(); // if ($orderItem) { // $productDownloadId = Arr::get($orderItem, 'product_downloads.id'); // $hasDownload = OrderDownloadPermissionResource::find($productDownloadId, ['order_id' => $orderId ]); // $downloadCount = Arr::get($hasDownload, 'download_count', 0) + 1; // $data= [ // 'order_id' => $orderId, // 'customer_id' => Arr::get($order, 'customer.id'), // 'download_id' => $productDownloadId, // 'download_count' => $downloadCount, // 'download_limit' => Arr::get($orderItem, 'product_downloads.settings.download_limit'), // 'access_expires' => Arr::get($orderItem, 'product_downloads.settings.download_expiry'), // ]; // if (empty($hasDownload)) { // $isCreatedOrUpdated = OrderDownloadPermissionResource::create($data); // } // else { // $isCreatedOrUpdated = OrderDownloadPermissionResource::update($data, Arr::get($hasDownload, 'id')); // } // if (is_wp_error($isCreatedOrUpdated)) { // return $isCreatedOrUpdated; // } // wp_send_json($isCreatedOrUpdated, 200); // } // } // } public function calculateCustomerStats(array $customerIds = []) { } } class EditorShortCodeHelper { public static function getGeneralShortCodes(): array { } public static function getSettingsShortCodes(): array { } static function collectShortcodeFromNestedTextFields($array, $prefix = '') { } /** * Make shortCodes from array * @array array [ key => [ ... arguments] ] * @parentKey string will add to the key of array label * @type $type string 'keyPair', will only return a key and label (string) array * @return array array of shortCodes Exm: [ {{my.shortcode}} => 'My Shortcode' ] */ public static function makeShortCodes(array $array, $parentKey = '', $type = ''): array { } public static function checkoutInputs(): array { } public static function conditionalInputs() { } public static function getCustomerShortCodesForOrder(): array { } public static function getPaymentShortCodes(): array { } public static function getTransactionShortCodes(): array { } public static function getShortCodes(): array { } public static function getOrderShortCodes(): array { } public static function getEmailNotificationShortcodes(): array { } public static function getEmailSettingsShortcodes(): array { } public static function getItemShortCodes(): array { } public static function getLicenseShortCodes(): array { } public static function getDownloadShortCodes(): array { } public static function getSubscriptionShortCodes(): array { } public static function getButtons() { } } class FluentCartUtilHelper { public function getCheckoutUrl() { } } class Helper { const PRODUCT_TYPE_SIMPLE = 'simple'; const PRODUCT_TYPE_SIMPLE_VARIATION = 'simple_variations'; const PRODUCT_TYPE_ADVANCE_VARIATION = 'advanced_variations'; const INSTANT_CHECKOUT_URL_PARAM = 'fct_cart_hash'; const IN_STOCK = 'in-stock'; const OUT_OF_STOCK = 'out-of-stock'; const ROLE_CAPABILITY_PREFIX = 'fluent_cart/permissions/'; const USER_ROLE = 'fluent_cart_customer'; const MIN_INSTALLMENT_TIMES = 2; /** * An installment plan must bill at least twice. times = 0 means unlimited * (a plain recurring subscription) and times = 1 collects a single payment, * which is a one-time purchase, not an installment plan. * * @param array $otherInfo A variant's other_info payload * @return string|null Error message, or null when valid */ public static function installmentTimesError($otherInfo) { } public static function getUidSerial() { } /** * Build a spec-compliant "Upgrade to Pro" URL. * * Follows the shared Fluent* UTM spec: * utm_source = fluent-cart (fixed vocabulary, never the wp.org slug) * utm_medium = free_plugin | pro_plugin (acquisition vs cross-sell) * utm_campaign= upgrade_pro (override for xsell_ / license_*) * utm_content = the exact placement, e.g. feature_lock_advanced_inventory * utm_term = plugin version that generated the link * utm_id = promo id, blank normally (omit unless passed) * * @param string $content The utm_content placement. * @param array $overrides Override any utm_* param (e.g. utm_campaign for cross-sell). * @return string */ public static function getUpgradeUrl($content = 'upgrade_page', $overrides = []): string { } public static function getRestInfo() { } /** * Get base rest url by examining the permalink. * * @see https://wordpress.stackexchange.com/questions/273144/can-i-use-rest-api-on-plain-permalink-format * * @return string */ protected static function getBaseRestUrl() { } /** * Get the full rest url by examining the permalink * (full means, including the namespace/version). * * @see https://wordpress.stackexchange.com/questions/273144/can-i-use-rest-api-on-plain-permalink-format * * @return string */ protected static function getFullRestUrl($ns, $ver) { } public static function shopConfig($key = false) { } /** * Convert weight between units using grams as base. * * @param float $value * @param string $fromUnit * @param string $toUnit * @return float */ public static function convertWeight($value, $fromUnit, $toUnit) { } /** * Get all shipping packages from store settings. * * @return array */ public static function getShippingPackages() { } /** * Get the default shipping package. * * @return array|null */ public static function getDefaultPackage() { } /** * Find a shipping package by slug. * * @param string $slug * @return array|null */ public static function getPackageBySlug($slug) { } public static function invoiceSettings($key = false) { } public static function getOrderStatuses() { } public static function getEditableOrderStatuses() { } public static function getEditableCustomerStatuses() { } public static function getShippingStatuses() { } public static function getEditableShippingStatuses() { } public static function getOrderSuccessStatuses() { } public static function getOrderFailedStatuses() { } public static function getTransactionSuccessStatuses() { } public static function getTransactionStatuses($withLabel = true) { } public static function getEditableTransactionStatuses($withLabel = true) { } public static function loadSpoutLib() { } public static function productStatuses($withLabel = true): array { } public static function productAdminAllStatuses() { } public static function getCartDriver() { } /** * Convert an amount to a formatted decimal string. * * @param float $amount The amount to convert. (required) * @param bool $withCurrency Whether to include the currency symbol. (optional, default: true) * @param string|null $currencyCode The currency code to use. (optional, default: null) * @param bool $formatted Whether to format the amount. (optional, default: true) * @param bool $showDecimals Whether to show decimal places. (optional, default: true) * @param bool $thousand_separator Whether to include thousand separators. (optional, default: true) * * @return string The formatted amount. * * @dev Note: If you don't want the thousand separator to be applied, * you need to set $formatted to true and $thousand_separator to false. * * @hook fluent_cart/hide_unnecessary_decimals - Filter to control whether unnecessary decimals (like .00) should be hidden. * Usage: add_filter('fluent_cart/hide_unnecessary_decimals', '__return_true'); // This will show 10 instead of 10.00 */ public static function toDecimal($amount, $withCurrency = true, $currencyCode = null, $formatted = true, $showDecimals = true, $thousand_separator = true, $withTranslatedDigit = true) { } public static function toCent($amount): int { } public static function toDecimalWithoutComma($amount) { } public static function getCustomerByUser($user) { } /** * @param array $order_data * * @return array return ['billing_address','shipping_address','others']; */ /** * * @return string */ public static function getProductImageBaseUri(): string { } public static function getProductImageBaseDir() { } public static function getAvailableCurrencyList() { } public static function getSymbolForCurrency($currency = 'BDT') { } public function getConfirmationSettings() { } /** * * @param $remove * @return string */ public static function getCheckoutPageLinkAfterRemovingGetParams($remove = []) { } /** * * @return bool */ public static function isSingleProductPage(): bool { } public static function isTrue($array, $key) { } public static function is_valid_json($string): bool { } public static function getStockStatuses($withLabel = true) { } public static function getFulfilmentTypes($withLabel = true) { } public static function getVariationTypes($withLabel = true) { } public static function isValueEncrypted($raw_value) { } public static function encryptKey($value) { } public static function decryptKey($raw_value) { } /** * @return array * For kses_post to allow some html tags */ public static function allowedHTMLForCheckout(): array { } public static function getCouponStatuses() { } public static function getCouponSuccessStatuses() { } /** * Compact subscription terms as text * * Expected $data keys: * - trial_days (int) * - interval ('daily'|'weekly'|'monthly'|'yearly') * - interval_count (int, default 1) * - times (int; 0 = open-ended, >0 = finite number of payments/cycles) * - price (string; formatted with currency) * - signup_fee (string; 0 if none) * - compare_price (string; 0 if none) * * Output examples: * - "30 days free then $100.00 per year" * - "$100 per year + $10 one-time signup fee" * - "$100/month for 4 months" * - "30 days free then $100/month for 4 months" * - "$99 per month" */ public static function getSubscriptionTermText(array $data, $asHtml = false): string { } public static function getTranslatedIntervalUnit(string $unit): string { } public static function generateSubscriptionInfo($otherInfo, $itemPrice, $currencyCode = null): ?string { } public static function generateSetupFeeInfo($otherInfo, $asArray = false) { } public static function generateTrialInfo($otherInfo) { } public static function getCountryList(): array { } public static function getCountyIsoLists(): array { } public static function getCountryCode($country_name) { } /** * Get the country's name with country code, * * @param $code * @return string */ public static function getCountryName($code): string { } public static function languageCodes(): array { } /** * Returns a translatable string with a shortcode inserted in the correct format. * * @param string $shortcode The shortcode to be inserted (e.g., '[fluent_cart_receipt]'). * @return string The formatted translatable string. */ public static function getShortcodeInstructionString(string $shortcode, $pageName = ''): string { } /** * Get the current user Model. * @return \FluentCart\App\Models\User|\FluentCart\Framework\Database\Orm\Builder|\FluentCart\Framework\Database\Orm\Builder[]|\FluentCart\Framework\Database\Orm\Collection|\FluentCart\Framework\Database\Orm\Model|null */ public static function getCurrentUser($refresh = false) { } public static function hasLicense($product): bool { } public static function generateDownloadFileLink($productDownload, $orderId = null, $validityInMinutes = 60, $isAdmin = false): string { } public static function readableFileSize($bytes): string { } public static function getSitePrefix() { } public static function humanIntervalMaps($interval = '') { } /** * @return array Array of intervals with label and value */ public static function getAvailableSubscriptionIntervalOptions(): array { } public static function translateIntervalToStandardFormat($repeatInterval) { } public static function getAvailableSubscriptionIntervalMaps() { } public static function calculateAdjustedTrialDaysForInterval($trialDays, $repeatInterval) { } public static function subscriptionIntervalInDays($interval) { } public static function parseTermIdsForFilter($filters): array { } public static function mergeTermIdsForFilter($array1 = [], $array2 = []): array { } public static function loadBundleChild(array $variants, $select = ['id', 'variation_title']): array { } /** * Translate digits in a number according to the configured numeric system. * * Converts the digits 0-9 in the given number to their equivalents * defined in the numeric system string from `dateTimeStrings()`. * This allows displaying numbers in other numeral systems, e.g., Bengali, Arabic, Hindi, etc. * * Only digits are translated; other characters such as decimal points, currency symbols, or text remain unchanged. * * @param int|float|string $number The number to translate. * @return string The number with digits translated according to the configured numeric system. */ public static function translateNumber($number): string { } public static function isModalCheckoutEnabled(): bool { } public static function isAdminUser(): bool { } /** * Convert string/boolean to actual boolean value. * Handles shortcode string attributes like "true"/"false" * * @param mixed $value The value to convert to boolean * @param bool $default Default value if conversion fails * @return bool The boolean result */ public static function toBool($value, bool $default = false): bool { } public static function formatTaxRatePercent(float $rate): string { } /** * Returns the tax label for order-level tax rows (tax_total, not per-item). * For mixed orders, indicates tax varies per item. * * @param \FluentCart\App\Models\Order $order * @return string */ public static function getOrderTaxLabel($order) { } } class OrderItemHelper { private $orderId = null; /** * @return array * sanitized order_item */ public function sanitize($orderItem) { } public function mapOrderItem($product, $quantity = 0) { } public function saveOrderItems($products) { } /** * @return array * processed orderItem from product */ public function processProducts($orderId, $items) { } public function processCustom($product, $orderId) { } } class ProductAdminHelper { /** * * @param $details * @param $variants */ public static function syncProduct($details, $variants) { } /** * Syncing advance variations * * @param $srcDetails * @param $variations * @param array $variantProductDetails * @return mixed */ public static function syncAdvanceVariations($srcDetails, $variations, array $variantProductDetails = []) { } /** * Build a bounded, human-readable summary of variation titles for activity * logs. When the count is within $limit the full list is returned; only when * there are MORE than $limit titles do we sample the first $limit and append * "and N more", so large combination sets don't bloat the log content. * * @param array $titles * @param int $limit * @return string */ public static function summarizeVariationTitles(array $titles, $limit = 5) { } /** * * @param $productId * @param array $childrenIdsWeWantToKeepSafe * @param string $reason Human-readable cause for the deletion, shown in the * log content (e.g. "the variation type was changed to * 'Simple'"). Defaults to a generic, always-true phrase * so the message never claims the wrong cause — this is * called from several flows (Simple switch, option/group * changes, regeneration), not only the Simple switch. * @return mixed */ public static function deleteOrphanVariant($productId, array $childrenIdsWeWantToKeepSafe = [], $reason = '') { } public static function generateVariationSets($formattedVariations, $i = 0) { } public static function getFeaturedMedia($featuredMedia): string { } } class Status { // product statuses: publish, draft, pending, private, future public const PRODUCT_PUBLISH = 'publish'; public const PRODUCT_DRAFT = 'draft'; public const PRODUCT_PRIVATE = 'private'; public const PRODUCT_FUTURE = 'future'; public const PRODUCT_TRASH = 'trash'; // Order Statuses public const ORDER_PROCESSING = 'processing'; public const ORDER_COMPLETED = 'completed'; public const ORDER_ON_HOLD = 'on-hold'; public const ORDER_CANCELED = 'canceled'; public const ORDER_FAILED = 'failed'; public const ORDER_MODE_TEST = 'test'; public const ORDER_MODE_LIVE = 'live'; // Payment Statuses public const PAYMENT_PENDING = 'pending'; public const PAYMENT_PAID = 'paid'; public const PAYMENT_PARTIALLY_PAID = 'partially_paid'; public const PAYMENT_FAILED = 'failed'; public const PAYMENT_REFUNDED = 'refunded'; public const PAYMENT_PARTIALLY_REFUNDED = 'partially_refunded'; public const PAYMENT_AUTHORIZED = 'authorized'; public const PAYMENT_SCHEDULED = 'payment_scheduled'; // Transaction Statuses public const TRANSACTION_SUCCEEDED = 'succeeded'; public const TRANSACTION_AUTHORIZED = 'authorized'; public const TRANSACTION_PENDING = 'pending'; public const TRANSACTION_REFUNDED = 'refunded'; public const TRANSACTION_FAILED = 'failed'; public const TRANSACTION_DISPUTE_LOST = 'dispute_lost'; // Transaction table transaction_type status public const TRANSACTION_TYPE_CHARGE = 'charge'; public const TRANSACTION_TYPE_REFUND = 'refund'; public const TRANSACTION_TYPE_DISPUTE = 'dispute'; // todo: will remove after some necessary test public const TRANSACTION_TYPE_SIGNUP = 'signup_fee'; // Subscription Statuses public const SUBSCRIPTION_PENDING = 'pending'; public const SUBSCRIPTION_INTENDED = 'intended'; public const SUBSCRIPTION_TRIALING = 'trialing'; public const SUBSCRIPTION_ACTIVE = 'active'; public const SUBSCRIPTION_CANCELED = 'canceled'; public const SUBSCRIPTION_PAUSED = 'paused'; public const SUBSCRIPTION_PAST_DUE = 'past_due'; public const SUBSCRIPTION_EXPIRED = 'expired'; public const SUBSCRIPTION_FAILING = 'failing'; public const SUBSCRIPTION_EXPIRING = 'expiring'; public const SUBSCRIPTION_COMPLETED = 'completed'; public const SUBSCRIPTION_AUTHENTICATED = 'authenticated'; public const SUBSCRIPTION_CREATED = 'created'; public const SUBSCRIPTION_METHOD_MANUAL = 'manual'; public const SUBSCRIPTION_METHOD_AUTOMATIC = 'automatic'; public const SUBSCRIPTION_METHOD_SYSTEM = 'system'; // billing interval public const BILLING_YEARLY = 'yearly'; public const BILLING_HALF_YEARLY = 'half_yearly'; public const BILLING_QUARTERLY = 'quarterly'; public const BILLING_MONTHLY = 'monthly'; public const BILLING_WEEKLY = 'weekly'; public const BILLING_DAILY = 'daily'; // Shipping Statuses public const SHIPPING_UNSHIPPED = 'unshipped'; public const SHIPPING_SHIPPED = 'shipped'; public const SHIPPING_DELIVERED = 'delivered'; public const SHIPPING_UNSHIPPABLE = 'unshippable'; // Customer Statuses public const CUSTOMER_ACTIVE = 'active'; public const CUSTOMER_INACTIVE = 'inactive'; // Stock Statuses public const STOCK_INSTOCK = 'instock'; public const STOCK_OUTOFSTOCK = 'outofstock'; public const STOCK_ONBACKORDER = 'onbackorder'; public const SCHEDULE_PENDING = 'pending'; public const SCHEDULE_COMPLETED = 'completed'; public const SCHEDULE_FAILED = 'failed'; public const SCHEDULE_PROCESSING = 'processing'; public const LICENSE_ACTIVE = 'active'; public const LICENSE_DISABLED = 'disabled'; public const LICENSE_EXPIRED = 'expired'; public const FULFILLMENT_TYPE_PHYSICAL = 'physical'; public const FULFILLMENT_TYPE_DIGITAL = 'digital'; public const ORDER_TYPE_PAYMENT = 'payment'; public const ORDER_TYPE_SUBSCRIPTION = 'subscription'; public const ORDER_TYPE_RENEWAL = 'renewal'; public static function getProductStatuses($withLabel = true) { } public static function getScheduleStatus($status): string { } public static function getLicenseStatus($status): string { } public static function productAdminAllStatuses() { } // Order statuses public static function getOrderStatuses() { } public static function getEditableOrderStatuses() { } // Payment statuses public static function getPaymentStatuses() { } // Transaction statuses public static function getTransactionStatuses($withLabel = true) { } public static function getEditableTransactionStatuses($withLabel = true) { } // Shipping statuses public static function getShippingStatuses() { } public static function getEditableShippingStatuses() { } // Subscription statuses public static function getSubscriptionStatuses() { } // Get Validable Subscription Statuses public static function getValidableSubscriptionStatuses() { } // Stock statuses public static function getStockStatuses($withLabel = true) { } public static function getOrderSuccessStatuses() { } public static function getOrderFailedStatuses() { } public static function getOrderPaymentSuccessStatuses() { } public static function getPaymentRetryableStatuses() { } public static function getReportStatuses() { } public static function getTransactionSuccessStatuses() { } // Get all statuses (optional utility) public static function all() { } public static function getEditableCustomerStatuses() { } // call when syncing status from external services, ex: public static function syncPaymentStatus($status) { } public static function syncTransactionStatus($status) { } public static function syncSubscriptionStatus($status) { } public static function eventTriggers(): array { } // Additional statuses can be added here as needed } class StatusHelper { protected $order; public function __construct($order = null) { } public function setOrder($order) { } public function changeOrderStatus($orderStatus, $paymentStatus, $title, $slug) { } protected function completeRelatedCart() { } public function updateTotalPaid($amount) { } public function triggerPaymentStatusActions($order, $paymentStatus) { } public function updateTransactionData($updateData = [], $transaction = null) { } public function syncOrderStatuses($latestTransaction = null) { } private function maybeActivateManualSubscription() { } } class UtmHelper { public static function allowedUtmParameterKey(): array { } /** * Hostnames that belong to the same store network (e.g. child/product sites * that redirect visitors here for checkout). Referrers from these hosts are * treated as internal navigation and never recorded as refer_url — the real * source arrives as query params (refer_url, utm_*) appended by the child site. */ public static function getInternalDomains(): array { } public static function addUtmToOrder($orderId, $data = []) { } /** * Reduce a referrer (full URL or bare host) to its bare domain: * no scheme, no www. prefix, no path — e.g. "google.com" */ public static function normalizeReferUrl($value): string { } public static function getUtmDataOfRequest(): array { } } } namespace FluentCart\App\Hooks\CLI { class ClipboardManager { static function copyToClipBoard(string $text): bool { } } class Commands { public function migrate_wc_products($args, $assoc_args) { } private function verifyMigration($result) { } public function anonymize_customers() { } public function sync_product_names() { } public function recount_stats($args, $assoc_args) { } public function recountCustomersStat() { } public function recountSubscriptions() { } private function recountCoupons() { } private function getFakeCustomer() { } private function getRandomCart($products, $maxAmount = 5) { } public function migrate(): void { } public function migrate_fresh_2($args, $assoc_args) { } public function migrate_fresh($args, $assoc_args, $checkDev = true) { } public function seed($args, $assoc_args, $default = 1000, $checkDev = true) { } public function authorize($checkDev = true) { } public function seed_all($args, $assoc_args, $default = 1000, $checkDev = true) { } public function generate_billing_address_from_ip() { } /** * Migrate WooCommerce customers to FluentCart * * ## OPTIONS * * [--force] * : Force migration even if customers already exist * * [--debug] * : Show debug information about customers found * * ## EXAMPLES * * wp fluent_cart migrate_customers * wp fluent_cart migrate_customers --force * wp fluent_cart migrate_customers --debug */ public function migrate_customers($args, $assoc_args) { } /** * Migrate WooCommerce orders to FluentCart * * ## OPTIONS * * [--batch-size=] * : Number of orders to process at once * --- * default: 50 * --- * * [--start-date=] * : Start date for order migration (YYYY-MM-DD) * * [--end-date=] * : End date for order migration (YYYY-MM-DD) * * [--debug] * : Show debug information about orders found * * ## EXAMPLES * * wp fluent_cart migrate_orders * wp fluent_cart migrate_orders --batch-size=25 * wp fluent_cart migrate_orders --start-date=2024-01-01 --end-date=2024-12-31 * wp fluent_cart migrate_orders --debug */ public function migrate_orders($args, $assoc_args) { } /** * Update customer purchase statistics after order migration * * This command recalculates purchase counts, values, and dates for customers * who have migrated orders. Useful if orders were migrated but customer stats * weren't properly updated. * * ## EXAMPLES * * wp fluent_cart update_customer_stats * * @when after_wp_load */ public function update_customer_stats($args, $assoc_args) { } /** * Run complete migration (products, customers, orders) * * ## OPTIONS * * [--skip-products] * : Skip product migration * * [--skip-customers] * : Skip customer migration * * [--skip-orders] * : Skip order migration * * ## EXAMPLES * * wp fluent_cart migrate_all * wp fluent_cart migrate_all --skip-products * wp fluent_cart migrate_all --skip-customers * wp fluent_cart migrate_all --skip-orders */ public function migrate_all($args, $assoc_args) { } private function displayMigrationStats($type, $stats) { } /** * Clone existing orders with random dates * * ## OPTIONS * * [--count=] * : Number of orders to clone * --- * default: 10 * --- * * [--start-date=] * : Start date for cloned orders (YYYY-MM-DD) * --- * default: 30 days ago * --- * * [--end-date=] * : End date for cloned orders (YYYY-MM-DD) * --- * default: today * --- * * [--source-order-id=] * : Specific order ID to clone * * ## EXAMPLES * * wp fluent_cart clone_orders --count=50 * wp fluent_cart clone_orders --count=25 --start-date=2024-01-01 --end-date=2024-12-31 * wp fluent_cart clone_orders --source-order-id=123 --count=5 */ public function clone_orders($args, $assoc_args) { } /** * Generate retention snapshots for cohort analysis * * This command processes all subscriptions and generates monthly retention * snapshots that track true customer retention (not subscription retention). * Customers who "recycle" (cancel and re-subscribe) are correctly tracked * as retained, not churned. * * ## OPTIONS * * [--product_id=] * : Only process a specific product (optional) * * ## EXAMPLES * * wp fluent_cart generate_retention_snapshots --product_id=123 * * @when after_wp_load */ public function generate_retention_snapshots($args, $assoc_args) { } /** * Send a test email for any notification type * * ## OPTIONS * * [] * : The notification name to send (e.g. order_paid_customer) * * [--order_id=] * : Use a real order for email data * * [--to=] * : Override recipient email address * * [--list] * : List all available notification names * * [--all] * : Send all notifications at once (requires --to) * * [--render-only] * : Skip sending, just render and save the HTML file to .debug-emails/ * * ## EXAMPLES * * wp fluent_cart test_email --list * wp fluent_cart test_email order_paid_customer --order_id=42 * wp fluent_cart test_email order_paid_customer --order_id=42 --to=dev@example.com * wp fluent_cart test_email order_paid_customer --to=dev@example.com * wp fluent_cart test_email order_paid_customer --render-only * wp fluent_cart test_email order_paid_customer --render-only --order_id=42 * wp fluent_cart test_email --all --to=dev@example.com * wp fluent_cart test_email --all --to=dev@example.com --order_id=42 */ public function test_email($args, $assoc_args) { } /** * Render raw block markup through FluentBlockParser and save as HTML. * * Useful for testing individual block renderers without a full notification. * * * : Path to a file containing block markup * * [--order_id=] * : Use a real order for shortcode data * * [--out=] * : Output file path (default: .debug-emails/render_blocks.html) * * [--wrapper] * : Wrap in email template (default: yes). Use --no-wrapper to skip. * * ## EXAMPLES * * wp fluent_cart render_blocks blocks.html * wp fluent_cart render_blocks blocks.html --order_id=42 * wp fluent_cart render_blocks blocks.html --out=test-output.html * wp fluent_cart render_blocks blocks.html --no-wrapper */ public function render_blocks($args, $assoc_args) { } /** * Resolve order/mock data for test emails. * * @param array $assoc_args * @return array */ private function resolveEmailData($assoc_args) { } private function getMockEmailData() { } public function reset_tax($args, $assoc_args) { } public function sync_stripe_renwals($args, $assoc_args) { } } class OrderCloneCommand { /** * Clone orders with specified date range * * ## OPTIONS * * [--count=] * : Number of orders to clone * --- * default: 10 * --- * * [--start-date=] * : Start date for cloned orders (YYYY-MM-DD) * --- * default: 30 days ago * --- * * [--end-date=] * : End date for cloned orders (YYYY-MM-DD) * --- * default: today * --- * * [--source-order-id=] * : Specific order ID to clone (if not provided, random orders will be selected) * * ## EXAMPLES * * wp fluent_cart clone_orders --count=50 * wp fluent_cart clone_orders --count=25 --start-date=2024-01-01 --end-date=2024-12-31 * wp fluent_cart clone_orders --source-order-id=123 --count=5 */ public function clone_orders($args, $assoc_args) { } private function cloneOrders($count, $startDate, $endDate, $sourceOrderId = null) { } private function getSourceOrders($sourceOrderId, $count) { } private function cloneSingleOrder($sourceOrder, $targetDate) { } private function cloneOrderRecord($sourceOrder, $targetDate) { } private function cloneOrderAddresses($sourceOrder, $newOrder) { } private function cloneOrderItems($sourceOrder, $newOrder) { } private function cloneAppliedCoupons($sourceOrder, $newOrder) { } private function cloneOrderMeta($sourceOrder, $newOrder) { } private function cloneLicenses($sourceOrder, $newOrder) { } private function cloneSubscriptions($sourceOrder, $newOrder) { } private function getRandomDateInRange($startDate, $endDate) { } private function getNextReceiptNumber() { } } class RetentionSnapshotCommand { /** * Generate retention snapshots */ public function generate($args, $assoc_args) { } } } namespace FluentCart\App\Hooks\Cart { class CartLoader { public function register() { } public function init(): void { } public static function initCartDrawer(): void { } public function registerDependency(): void { } public function enqueueStyle() { } public static function shouldHideCartDrawer() { } } class WebCheckoutHandler { public function register() { } public function globalCheckoutRouteHandler() { } public function handlePlaceOrderAjax() { } public function getShippingChargeData($cart): array { } public function handleGetOrderInfoAjax() { } public function handleApplyCouponAjax() { } public function handleRemoveCouponAjax() { } public function handleGetCheckoutSummaryViewAjax() { } public function handleUpdateAddressSelectAjax() { } public function handleGetCountryInfoAjax() { } public function getShippingMethodsListView(array $data) { } public function handleGetShippingMethodsListViewAjax() { } public function handleCartStatusAjax() { } public function handleCartUpdateAjax() { } public function patchCheckoutData() { } public function handleOrderBumpRequest() { } public function normalizeCheckoutChangeData($changedData, $allData): array { } private function pushAddressData($data, $type = 'billing') { } public function getProductModalView() { } } } namespace FluentCart\App\Hooks\Handlers { class ActivationHandler { public \FluentCart\Api\StoreSettings $storeSettings; public function handle($network_wide = false) { } public function dispatch() { } public function registerWpCron() { } } class AddonGatewaysHandler { /** * Default addon gateways to register * @var array */ protected $defaultGateways = ['paystack' => \FluentCart\App\Modules\PaymentMethods\PromoGateways\Addons\PaystackAddon::class, 'razorpay' => \FluentCart\App\Modules\PaymentMethods\PromoGateways\Addons\RazorpayAddon::class, 'mercado_pago' => \FluentCart\App\Modules\PaymentMethods\PromoGateways\Addons\MercadoPagoAddon::class, 'flutterwave' => \FluentCart\App\Modules\PaymentMethods\PromoGateways\Addons\FlutterwaveAddon::class, 'square' => \FluentCart\App\Modules\PaymentMethods\PromoGateways\Addons\SquareAddon::class, 'sslcommerz' => \FluentCart\App\Modules\PaymentMethods\PromoGateways\Addons\SslcommerzAddon::class]; public function register() { } /** * Register addon gateways * Can be filtered to add or remove gateways */ public function registerPromoGateways() { } /** * Add a new addon gateway to the default list * * @param string $slug * @param string $className */ public function addGateway($slug, $className) { } /** * Remove an addon gateway from the default list * * @param string $slug */ public function removeGateway($slug) { } } class AdminMenuBarHandler { public function register() { } public function init($wp_admin_bar) { } } class AdvancedVariationHandler { public function register() { } } class AttributesHandler { public function register() { } } } namespace FluentCart\App\Hooks\Handlers\BlockEditors { abstract class BlockEditor { use \FluentCart\Api\Contracts\CanEnqueue; const PARENT_BLOCK_DATA_NAME = 'fluent_cart_parent_block_data'; protected static string $editorName; private static bool $isReactSupportAdded = false; private static bool $blockSupportStylesEnqueued = false; public function __construct() { } private function addReactSupport() { } abstract public function render(array $shortCodeAttribute, $block = null); protected function generateEnqueueSlug(): string { } public static function getEditorName(): string { } public static function register() { } private function enqueueAsset() { } private function enqueueGlobalStyles() { } public function init(): void { } public function blockAttributes(): array { } /** * Register just the block type (render callback, attributes, supports) * without editor scripts/styles. Used for email-only blocks that handle * asset enqueuing through the email editor handler instead of globally. */ public function registerBlockType(): void { } public function supports(): array { } public function ancestor(): array { } public function provideContext() { } public function useContext() { } /** * Whether to skip automatic inner block rendering in WP_Block::render(). * * Override to return true in blocks that manually render their inner blocks * in the render callback. This prevents WordPress from auto-rendering inner * blocks before the callback runs (which causes double rendering and can * trigger WP 6.x's empty-block script dequeue mechanism). */ protected function skipInnerBlocks(): bool { } public function render_block($attributes, $content, $block) { } /** * Ensure WordPress global styles (preset colors, typography, spacing) are available * on the frontend. Some themes (e.g., Bricks) strip the global-styles stylesheet, * which breaks block support classes like .has-vivid-red-color. * * This outputs a minimal inline fallback only if global styles aren't already loaded. */ private static function getBlockSupportFallbackStyles(): string { } public function getStyles(): array { } public static function make(): \FluentCart\App\Hooks\Handlers\BlockEditors\BlockEditor { } protected function isBlockEditor(): bool { } } } namespace FluentCart\App\Hooks\Handlers\BlockEditors\Buttons { class AddToCartButtonBlockEditor extends \FluentCart\App\Hooks\Handlers\BlockEditors\BlockEditor { protected static string $editorName = 'add-to-cart-button'; public function getScripts(): array { } public function getStyles(): array { } public function supports(): array { } public function localizeData(): array { } public function render(array $shortCodeAttribute, $block = null) { } } class BuyNowButtonBlockEditor extends \FluentCart\App\Hooks\Handlers\BlockEditors\BlockEditor { protected static string $editorName = 'buy-now-button'; public function getScripts(): array { } public function supports(): array { } public function getStyles(): array { } public function localizeData(): array { } public function render(array $shortCodeAttribute, $block = null) { } } } namespace FluentCart\App\Hooks\Handlers\BlockEditors { class BuySectionBlockEditor extends \FluentCart\App\Hooks\Handlers\BlockEditors\BlockEditor { protected static string $editorName = 'buy-section'; public function getScripts(): array { } public function getStyles(): array { } public function localizeData(): array { } public function render(array $shortCodeAttribute, $block = null) { } } } namespace FluentCart\App\Hooks\Handlers\BlockEditors\Checkout { class CheckoutBlockEditor extends \FluentCart\App\Hooks\Handlers\BlockEditors\BlockEditor { protected static string $editorName = 'checkout'; public function getScripts(): array { } public function getStyles(): array { } public function init(): void { } public function registerInnerBlocks() { } public function localizeData(): array { } protected function skipInnerBlocks(): bool { } public function render(array $shortCodeAttribute, $block = null, $content = null): string { } /** * Returns the default `addressModal` * * @return array */ public static function getDefaultAddressModal(): array { } /** * Returns the default `SippingMethods` * * @return array */ public static function getDefaultSippingMethods(): array { } /** * Returns the default `PaymentMethods` * * @return array */ public static function getDefaultPaymentMethods(): array { } /** * Returns the default `orderSummary` * * @return array */ public static function getDefaultOrderSummary(): array { } /** * Returns the default `coupons` * * @return array */ public static function getDefaultCoupons(): array { } /** * Returns the default `submitButton` * * @return array */ public static function getDefaultSubmitButton(): array { } /** * Returns the default `AllowCreateAccount` * * @return array */ public static function getDefaultAllowCreateAccount(): array { } /** * Safely encode JSON strings if needed * * @param mixed $value The value to process * @return mixed The processed value (encoded if it was an array or object) */ protected function maybeEncodeJson($value) { } } } namespace FluentCart\App\Hooks\Handlers\BlockEditors\Checkout\InnerBlocks { class InnerBlocks { use \FluentCart\Api\Contracts\CanEnqueue; public static $parentBlock = 'fluent-cart/checkout'; public array $blocks = []; private $cart = null; private function getCart() { } public static function textBlockSupport(): array { } public static function buttonBlockSupport(): array { } public static function register() { } public function getInnerBlocks(): array { } public function renderCheckoutNameFields($attributes, $content, $block) { } public function renderCheckoutCreateAccountField($attributes, $content, $block) { } public function renderCheckoutAddressFields($attributes, $content, $block) { } public function renderCheckoutBillingAddressField($attributes, $content, $block) { } public function renderCheckoutShippingAddressField($attributes, $content, $block) { } public function renderCheckoutShipToDifferentField($attributes, $content, $block) { } public function renderCheckoutShippingMethods($attributes, $content, $block) { } public function renderCheckoutPaymentMethods($attributes, $content, $block) { } public function renderCheckoutEuVat($attributes, $content, $block) { } public function renderCheckoutAgreeTermsField($attributes, $content, $block) { } public function renderCheckoutSubmitButton($attributes, $content, $block) { } public function renderCheckoutOrderNotesField($attributes, $content, $block) { } public function renderCheckoutSummary($attributes, $content, $block) { } public function renderCheckoutOrderSummary($attributes, $content, $block) { } public function renderCheckoutSummaryFooter($attributes, $content, $block) { } public function renderCheckoutSubtotal($attributes, $content, $block) { } public function renderCheckoutShipping($attributes, $content, $block) { } public function renderCheckoutFees($attributes, $content, $block) { } public function renderCheckoutCoupon($attributes, $content, $block) { } public function renderCheckoutManualDiscount($attributes, $content, $block) { } public function renderCheckoutTax($attributes, $content, $block) { } public function renderCheckoutShippingTax($attributes, $content, $block) { } public function renderCheckoutTotal($attributes, $content, $block) { } public function renderCheckoutOrderBump($attributes, $content, $block) { } protected function getLocalizationKey(): string { } public function localizeData(): array { } public function getStyles(): array { } public function getScripts(): array { } protected function generateEnqueueSlug(): string { } } } namespace FluentCart\App\Hooks\Handlers\BlockEditors { class CustomerDashboardButtonBlockEditor extends \FluentCart\App\Hooks\Handlers\BlockEditors\BlockEditor { protected static string $editorName = 'customer-dashboard-button'; public function getScripts(): array { } public function getStyles(): array { } public function supports(): array { } public function localizeData(): array { } public function render(array $shortCodeAttribute, $block = null) { } } class CustomerProfileBlockEditor extends \FluentCart\App\Hooks\Handlers\BlockEditors\BlockEditor { protected static string $editorName = 'customer-profile'; public function getScripts(): array { } public function getStyles(): array { } public function localizeData(): array { } public function render(array $shortCodeAttribute, $block = null): string { } } class ExcerptBlockEditor extends \FluentCart\App\Hooks\Handlers\BlockEditors\BlockEditor { protected static string $editorName = 'excerpt'; public function ancestor(): array { } public function supports(): array { } public function getScripts(): array { } public function getStyles(): array { } public function localizeData(): array { } public function render(array $shortCodeAttribute, $block = null) { } } } namespace FluentCart\App\Hooks\Handlers\BlockEditors\MediaCarousel\InnerBlocks { class InnerBlocks { use \FluentCart\Api\Contracts\CanEnqueue; public static $parentBlock = 'fluent-cart/media-carousel'; public array $blocks = []; public static function register() { } public function getInnerBlocks(): array { } public function renderImage($attributes, $content, $block): string { } public function getProductFromBlockContext($block) { } protected static function getDefaultCarouselSettings(): array { } protected function getCarouselSettingsFromContext($block): array { } protected function isSlideBlock($block): bool { } public function renderMediaCarouselLoop($attributes, $content, $block): string { } public function renderCarouselControls($attributes, $content, $block): string { } public function renderCarouselPagination($attributes, $content, $block): string { } protected function getLocalizationKey(): string { } public function localizeData(): array { } public function getStyles(): array { } public function getScripts(): array { } protected function generateEnqueueSlug(): string { } } } namespace FluentCart\App\Hooks\Handlers\BlockEditors\MediaCarousel { class MediaCarouselBlockEditor extends \FluentCart\App\Hooks\Handlers\BlockEditors\BlockEditor { protected static string $editorName = 'media-carousel'; protected ?string $localizationKey = 'fluent_cart_media_carousel_block_editor_data'; public function getScripts(): array { } public function getStyles(): array { } public function init(): void { } public function registerInnerBlocks() { } public function localizeData(): array { } public function provideContext(): array { } public function render(array $shortCodeAttribute, $block = null, $content = null): string { } } } namespace FluentCart\App\Hooks\Handlers\BlockEditors { class MiniCartBlockEditor extends \FluentCart\App\Hooks\Handlers\BlockEditors\BlockEditor { protected static string $editorName = 'mini-cart'; public function getScripts(): array { } public function getStyles(): array { } public function supports(): array { } public function localizeData(): array { } public function render(array $shortCodeAttribute, $block = null) { } } class PriceRangeBlockEditor extends \FluentCart\App\Hooks\Handlers\BlockEditors\BlockEditor { protected static string $editorName = 'price-range'; public function ancestor(): array { } public function supports(): array { } public function getScripts(): array { } public function getStyles(): array { } public function localizeData(): array { } public function useContext() { } public function render(array $shortCodeAttribute, $block = null) { } } class PricingTableBlockEditor extends \FluentCart\App\Hooks\Handlers\BlockEditors\BlockEditor { protected static string $editorName = 'product-pricing-table'; public function getScripts(): array { } public function getStyles(): array { } public function localizeData(): array { } public function render(array $shortCodeAttribute, $block = null): string { } private function assocArrayToString(array $array, string $delimiter = ', '): string { } } class ProductCardBlockEditor extends \FluentCart\App\Hooks\Handlers\BlockEditors\BlockEditor { protected static string $editorName = 'product-card'; public function getScripts(): array { } public function getStyles(): array { } public function localizeData(): array { } public function render(array $shortCodeAttribute, $block = null): string { } } } namespace FluentCart\App\Hooks\Handlers\BlockEditors\ProductCarousel\InnerBlocks { class InnerBlocks { use \FluentCart\Api\Contracts\CanEnqueue; public static $parentBlock = 'fluent-cart/product-carousel'; public array $blocks = []; public static function textBlockSupport(): array { } public static function buttonBlockSupport(): array { } public static function register() { } public function getInnerBlocks(): array { } public function getProductFromBlockContext($block) { } protected static function getDefaultCarouselSettings(): array { } protected function getCarouselSettingsFromContext($block): array { } public function renderTitle($attributes, $content, $block): string { } public function renderPrice($attributes, $content, $block): string { } public function renderImage($attributes, $content, $block): string { } public function renderButtons($attributes, $content, $block): string { } public function renderExcerpt($attributes, $content, $block): string { } protected function isSlideBlock($block): bool { } public function renderProductCarouselLoop($attributes, $content, $block): string { } public function renderCarouselControls($attributes, $content, $block): string { } public function renderCarouselPagination($attributes, $content, $block): string { } protected function getLocalizationKey(): string { } public function localizeData(): array { } public function getStyles(): array { } public function getScripts(): array { } protected function generateEnqueueSlug(): string { } } } namespace FluentCart\App\Hooks\Handlers\BlockEditors\ProductCarousel { class ProductCarouselBlockEditor extends \FluentCart\App\Hooks\Handlers\BlockEditors\BlockEditor { protected static string $editorName = 'product-carousel'; protected ?string $localizationKey = 'fluent_cart_product_carousel_block_editor_data'; public function getScripts(): array { } public function getStyles(): array { } public function init(): void { } public function registerInnerBlocks() { } public function localizeData(): array { } public function provideContext(): array { } public function render(array $shortCodeAttribute, $block = null, $content = null): string { } } } namespace FluentCart\App\Hooks\Handlers\BlockEditors { class ProductCategoriesListBlockEditor extends \FluentCart\App\Hooks\Handlers\BlockEditors\BlockEditor { protected static string $editorName = 'product-categories-list'; public function getScripts(): array { } public function getStyles(): array { } public function supports(): array { } public function localizeData(): array { } public function render(array $shortCodeAttribute, $block = null) { } } class ProductDescriptionBlockEditor extends \FluentCart\App\Hooks\Handlers\BlockEditors\BlockEditor { protected static string $editorName = 'product-description'; public function ancestor(): array { } public function supports(): array { } public function getScripts(): array { } public function getStyles(): array { } public function localizeData(): array { } public function render(array $shortCodeAttribute, $block = null) { } } class ProductGalleryBlockEditor extends \FluentCart\App\Hooks\Handlers\BlockEditors\BlockEditor { protected static string $editorName = 'product-gallery'; public function getScripts(): array { } public function getStyles(): array { } public function localizeData(): array { } public function render(array $shortCodeAttribute, $block = null) { } } class ProductImageBlockEditor extends \FluentCart\App\Hooks\Handlers\BlockEditors\BlockEditor { protected static string $editorName = 'product-image'; public function ancestor(): array { } public function supports(): array { } public function getScripts(): array { } public function getStyles(): array { } public function localizeData(): array { } protected function skipInnerBlocks(): bool { } public function render(array $shortCodeAttribute, $block = null) { } } class ProductInfoBlockEditor extends \FluentCart\App\Hooks\Handlers\BlockEditors\BlockEditor { protected static string $editorName = 'product-info'; public function getScripts(): array { } public function getStyles(): array { } public function localizeData(): array { } protected function skipInnerBlocks(): bool { } public function render(array $shortCodeAttribute, $block = null) { } } class ProductPackageDescriptionBlockEditor extends \FluentCart\App\Hooks\Handlers\BlockEditors\BlockEditor { protected static string $editorName = 'product-package-description'; public function ancestor(): array { } public function supports(): array { } public function getScripts(): array { } public function getStyles(): array { } public function localizeData(): array { } public function render(array $shortCodeAttribute, $block = null): string { } } class ProductSkuBlockEditor extends \FluentCart\App\Hooks\Handlers\BlockEditors\BlockEditor { protected static string $editorName = 'product-sku'; public function ancestor(): array { } public function supports(): array { } public function getScripts(): array { } public function getStyles(): array { } public function localizeData(): array { } public function render(array $shortCodeAttribute, $block = null): string { } } class ProductTitleBlockEditor extends \FluentCart\App\Hooks\Handlers\BlockEditors\BlockEditor { protected static string $editorName = 'product-title'; public function ancestor(): array { } public function supports(): array { } public function getScripts(): array { } public function getStyles(): array { } public function localizeData(): array { } public function render(array $shortCodeAttribute, $block = null) { } } } namespace FluentCart\App\Hooks\Handlers\BlockEditors\RelatedProduct\InnerBlocks { class InnerBlocks { public static $parentBlock = 'fluent-cart/related-product'; private const MIN_COLUMNS = 1; private const MAX_COLUMNS = 6; public static function register() { } public function getInnerBlocks(): array { } public function renderProductTemplate($attributes, $content, $block): string { } } } namespace FluentCart\App\Hooks\Handlers\BlockEditors\RelatedProduct { class RelatedProductBlockEditor extends \FluentCart\App\Hooks\Handlers\BlockEditors\BlockEditor { protected static string $editorName = 'related-product'; public function init(): void { } public function registerInnerBlocks() { } public function getScripts(): array { } public function getStyles(): array { } public function localizeData(): array { } public function provideContext(): array { } public function render(array $shortCodeAttribute, $block = null, $content = null): string { } } } namespace FluentCart\App\Hooks\Handlers\BlockEditors { class SaleBadgeBlockEditor extends \FluentCart\App\Hooks\Handlers\BlockEditors\BlockEditor { protected static string $editorName = 'sale-badge'; public function ancestor(): array { } public function supports(): array { } public function getScripts(): array { } public function getStyles(): array { } public function localizeData(): array { } public function render(array $shortCodeAttribute, $block = null): string { } } class SearchBarBlockEditor extends \FluentCart\App\Hooks\Handlers\BlockEditors\BlockEditor { protected static string $editorName = 'fluent-products-search-bar'; public function getScripts(): array { } public function getStyles(): array { } public function localizeData(): array { } public function render(array $shortCodeAttribute, $block = null): string { } } } namespace FluentCart\App\Hooks\Handlers\BlockEditors\ShopApp\InnerBlocks { class InnerBlocks { use \FluentCart\Api\Contracts\CanEnqueue; public static $parentBlock = 'fluent-cart/products'; public array $blocks = []; public static function textBlockSupport(): array { } public static function buttonBlockSupport(): array { } public static function register() { } public function getInnerBlocks(): array { } public function getProductFromBlockContext($block) { } public function renderFilter($attributes, $content, $block) { } public function renderFilterSortBy($attributes, $content, $block) { } public function renderProductActionContainer($attributes, $content, $block) { } public function renderFilterViewSwitcher($attributes, $content, $block) { } public function renderFilterSearchBox($attributes, $content, $block): string { } public function renderFilterFilters($attributes, $content, $block) { } public function renderFilterButton($attributes, $content, $block) { } public function renderFilterApplyButton($attributes, $content, $block) { } public function renderFilterResetButton($attributes, $content, $block) { } public function renderNoResultBlock($attributes, $content, $block) { } public function renderProductLoaderBlock($attributes, $content, $block) { } public function renderTitle($attributes, $content, $block): string { } public function renderPrice($attributes, $content, $block): string { } public function renderImage($attributes, $content, $block): string { } public function renderButtons($attributes, $content, $block): string { } public function renderExcerpt($attributes, $content, $block): string { } public function renderProductLoop($attributes, $content, $block): string { } public function renderProductContainer($attributes, $content, $block): string { } protected function getLocalizationKey(): string { } public function localizeData(): array { } public function getStyles(): array { } public function getScripts(): array { } protected function generateEnqueueSlug(): string { } public function renderProductPaginator($attributes, $content, $block) { } public function renderProductPaginatorInfo($attributes, $content, $block) { } public function renderProductPaginatorNumber($attributes, $content, $block) { } private function renderPaginatorItems($paginator, $paginationJump = 3) { } public function getInitialProducts($block = null) { } } } namespace FluentCart\App\Hooks\Handlers\BlockEditors\ShopApp { class ShopAppBlockEditor extends \FluentCart\App\Hooks\Handlers\BlockEditors\BlockEditor { protected static string $editorName = 'products'; protected ?string $localizationKey = 'fluent_cart_shop_app_block_editor_data'; public function getScripts(): array { } public function getStyles(): array { } public function init(): void { } public function registerInnerBlocks() { } public function localizeData(): array { } private function getMetaFilterOptions($key): array { } public function provideContext(): array { } public function render(array $shortCodeAttribute, $block = null, $content = null): string { } } } namespace FluentCart\App\Hooks\Handlers\BlockEditors { class SoldOutBadgeBlockEditor extends \FluentCart\App\Hooks\Handlers\BlockEditors\BlockEditor { protected static string $editorName = 'sold-out-badge'; public function ancestor(): array { } public function supports(): array { } public function getScripts(): array { } public function getStyles(): array { } public function localizeData(): array { } public function render(array $shortCodeAttribute, $block = null): string { } } class StockBlock extends \FluentCart\App\Hooks\Handlers\BlockEditors\BlockEditor { protected static string $editorName = 'stock'; public function supports(): array { } public function getScripts(): array { } public function getStyles(): array { } public function localizeData(): array { } public function render(array $shortCodeAttribute, $block = null) { } } class StoreLogoBlockEditor extends \FluentCart\App\Hooks\Handlers\BlockEditors\BlockEditor { protected static string $editorName = 'store-logo'; public function getScripts(): array { } public function getStyles(): array { } public function localizeData(): array { } public function render(array $shortCodeAttribute, $block = null) { } } } namespace FluentCart\App\Hooks\Handlers { class CPTHandler { /* * Add all Custom Post Type classes here to * register all of your Custom Post Types. */ public function register() { } protected $customPostTypes = [\FluentCart\App\CPT\FluentProducts::class]; public function registerPostTypes() { } } class CartCookieHandler { public static function handle() { } } } namespace FluentCart\App\Hooks\Handlers\CustomCheckout { class CustomCheckout { public function register() { } /* * 1. validation * 2. create cart * - subscription * discount, signup etc. * - onetime * 3. redirect to the checkout with cart */ public function handleCustomCheckoutRedirect($data) { } } } namespace FluentCart\App\Hooks\Handlers { class DeactivationHandler { public function handle() { } } class ExportHandler { public function register() { } public function mapAjaxRoute() { } public function exportOrders() { } public function exportRepeatCustomers() { } public function exportProducts() { } } class FluentCartHandler { protected $app = null; public function register() { } public function init() { } } class GlobalPaymentHandler { public function register() { } public function init() { } // IPN / Payment Webhook Listener public function initIpnListener(): void { } public function appAuthenticator() { } public function verifyStripeConnect() { } public function disconnect($method, $mode) { } public function getSettings($method): array { } /** * @throws \Exception */ public function getAll(): array { } } class GlobalPermissionsHandler { public static $customCapabilities = array(); public function register() { } } class GlobalStorageHandler { public function register() { } public function init() { } public function getSettings($driver) { } public function getAll() { } public function getStatus($driver) { } public function getAllActive() { } public function registerPromoR2Driver($drivers, $args) { } public function getPromoR2Logo() { } public function getPromoR2DarkLogo() { } } class MenuHandler { public function register() { } public function addDisplayPostStates($states, $post) { } public function outputFluentCartDarkModeScript() { } public function enqueueDarkModeToggleForTaxonomy() { } private function getDarkModeInitScript(): string { } public function init() { } public function addAdminMenu() { } public function renderAdmin() { } public function maybeRenderAdminMenu() { } public function renderAdminMenu() { } public function pushProductNav($post) { } public function enqueueAssets() { } public function globalEnqueueAssets($adminBar) { } protected function getMenuIcon(): string { } } class OrderEventHandler { public function maybeRecountCustomerStat($data) { } public function handleOrderDeleted($data) { } } class PromoGatewaysHandler { /** * Default promo gateways to register * @var array */ protected $defaultGateways = ['paddle' => \FluentCart\App\Modules\PaymentMethods\PromoGateways\Pro\PaddlePromo::class, 'mollie' => \FluentCart\App\Modules\PaymentMethods\PromoGateways\Pro\MolliePromo::class, 'authorize_dot_net' => \FluentCart\App\Modules\PaymentMethods\PromoGateways\Pro\AuthorizeNetPromo::class]; public function register() { } /** * Register promo gateways * Only registers if Fluent Cart Pro is not active */ public function registerPromoGateways() { } /** * Add a new promo gateway to the default list * * @param string $slug * @param string $className */ public function addGateway($slug, $className) { } /** * Remove a promo gateway from the default list * * @param string $slug */ public function removeGateway($slug) { } } class ReminderHandler { public function register(): void { } public function scan(): void { } public function sendSubscriptionRenewalReminder($subscriptionId, $stage, $cycleKey): void { } public function sendSubscriptionTrialReminder($subscriptionId, $stage, $cycleKey): void { } public function sendRenewalReminder($orderId, $stage, $cycleKey): void { } public function addDefaultStoreSettings($defaults): array { } public function addStoreSettingFields($fields): array { } public function addStoreSettingSanitizers($sanitizers): array { } public function clearOrderReminderState($data): void { } public function clearSubscriptionReminderState($data): void { } } class RetentionSnapshotHandler { /** * Register Action Scheduler hooks */ public function register() { } /** * Action Scheduler callback to generate retention snapshots * * @param array $args ['product_id' => int|null] */ public function generateSnapshots($productId = null, $jobId = null) { } } } namespace FluentCart\App\Hooks\Handlers\ShortCodes { abstract class ShortCode { use \FluentCart\Api\Contracts\CanEnqueue; protected static string $shortCodeName; protected ?array $shortCodeAttributes = null; protected ?string $slugPrefix = null; public function __construct(array $shortcodeAttributes = []) { } abstract public function render(?array $viewData = null); public function renderShortcode($block = null) { } public function parseAttribute(array $shortcodeAttributes): array { } public function viewData(): ?array { } public static function getShortCodeName(): string { } public static function register() { } protected function generateEnqueueSlug(): string { } public static function make($shortcodeAttributes = null): \FluentCart\App\Hooks\Handlers\ShortCodes\ShortCode { } } } namespace FluentCart\App\Hooks\Handlers\ShortCodes\Buttons { class AddToCartShortcode extends \FluentCart\App\Hooks\Handlers\ShortCodes\ShortCode { protected static string $shortCodeName = 'fluent_cart_add_to_cart_button'; public function getStyles(): array { } /** * Example: * [fluent_cart_add_to_cart_button * button_text="Add to Cart" * variation_id="123" * ] * * Supported attributes: * - button_text * - variation_id */ public function render(?array $viewData = null) { } } class DirectCheckoutShortcode extends \FluentCart\App\Hooks\Handlers\ShortCodes\ShortCode { protected static string $shortCodeName = 'fluent_cart_checkout_button'; public function getStyles(): array { } /* * Example: * [fluent_cart_checkout_button * button_text="Buy Now" * variation_id="123" * instant_checkout="yes" * ] * * Supported attributes: * - button_text * - variation_id * - target * - instant_checkout (yes|no) */ public function render(?array $viewData = null) { } protected function renderAttributes($atts = []) { } } } namespace FluentCart\App\Hooks\Handlers\ShortCodes { class CartShortcode extends \FluentCart\App\Hooks\Handlers\ShortCodes\ShortCode { const SHORT_CODE = 'fluent_cart_cart'; protected static string $shortCodeName = 'fluent_cart_cart'; public static function register() { } public function render(?array $viewData = null) { } public function getStyles(): array { } } } namespace FluentCart\App\Hooks\Handlers\ShortCodes\Checkout { class CheckoutPageHandler extends \FluentCart\App\Hooks\Handlers\ShortCodes\ShortCode { const SHORT_CODE = 'fluent_cart_checkout'; protected static string $shortCodeName = 'fluent_cart_checkout'; public static function register() { } public function render(?array $viewData = null) { } } class CheckoutShippingMethodsShortCode extends \FluentCart\App\Hooks\Handlers\ShortCodes\ShortCode { protected static string $shortCodeName = 'fluent_cart_checkout_shipping_methods'; public function render($viewData = null) { } } } namespace FluentCart\App\Hooks\Handlers\ShortCodes { class CustomerDashboardButtonShortcode extends \FluentCart\App\Hooks\Handlers\ShortCodes\ShortCode { protected static string $shortCodeName = 'fluent_cart_customer_dashboard_button'; public function getStyles(): array { } public function render(?array $viewData = null) { } } class CustomerLoginHandler extends \FluentCart\App\Hooks\Handlers\ShortCodes\ShortCode { const SHORT_CODE = 'fluent_cart_login_form'; protected static string $shortCodeName = 'fluent_cart_login_form'; public static function register() { } public function getScripts(): array { } public function getStyles(): array { } public function localizeData(): array { } public function viewData(): ?array { } public function render(?array $viewData = null) { } } class CustomerProfileHandler extends \FluentCart\App\Hooks\Handlers\ShortCodes\ShortCode { const SHORT_CODE = 'fluent_cart_customer_profile'; protected static string $shortCodeName = 'fluent_cart_customer_profile'; protected static $slug = ''; protected string $assetsPath = ''; public function renderShortcode($block = null) { } public static function register() { } public function render(?array $viewData = null) { } public function renderCustomerAppContainer() { } public function maybeCustomEndpointContent() { } public function renderCustomerApp() { } public function renderCustomerMenu() { } public static function getLocalizationData($attributes = []): array { } public function localizeData(): array { } private static function generateCssColorVariables($colors): string { } } class CustomerRegistrationHandler extends \FluentCart\App\Hooks\Handlers\ShortCodes\ShortCode { const SHORT_CODE = 'fluent_cart_registration_form'; protected static string $shortCodeName = 'fluent_cart_registration_form'; public static function register() { } public function getScripts(): array { } public function getStyles(): array { } public function localizeData(): array { } public function viewData(): ?array { } public function render(?array $viewData = null) { } } class MiniCartShortcode extends \FluentCart\App\Hooks\Handlers\ShortCodes\ShortCode { protected static string $shortCodeName = 'fluent_cart_mini_cart'; public function getStyles(): array { } public function render(?array $viewData = null) { } } class PricingTableShortCode extends \FluentCart\App\Hooks\Handlers\ShortCodes\ShortCode { const SHORT_CODE = 'fluent_cart_pricing_table'; protected static string $shortCodeName = 'fluent_cart_pricing_table'; public static function register() { } public function getScripts(): array { } public function getStyles(): array { } public function viewData(): ?array { } public function render(?array $viewData = null) { } public function localizeData(): array { } } class ProductCardShortCode extends \FluentCart\App\Hooks\Handlers\ShortCodes\ShortCode { const SHORT_CODE = 'fluent_cart_product_card'; protected static string $shortCodeName = 'fluent_cart_product_card'; public static function register() { } public function viewData(): ?array { } public function render(?array $viewData = null) { } } class ProductCategoriesListShortcode extends \FluentCart\App\Hooks\Handlers\ShortCodes\ShortCode { protected static string $shortCodeName = 'fluent_cart_product_categories'; public function getStyles(): array { } public function getScripts(): array { } public function render(?array $viewData = null) { } } class ProductImageShortCode extends \FluentCart\App\Hooks\Handlers\ShortCodes\ShortCode { protected static string $shortCodeName = 'fluent_cart_product_image'; public function render(?array $viewData = null) { } } class ProductTitleShortCode extends \FluentCart\App\Hooks\Handlers\ShortCodes\ShortCode { protected static string $shortCodeName = 'fluent_cart_product_title'; public function render(?array $viewData = null) { } } class ReceiptHandler { protected string $slug = ''; protected string $assetsPath = ''; protected $productId; public function register() { } public function renderRedirectPage($attributes): string { } public function renderNotFoundPage() { } } class SearchBarShortCode extends \FluentCart\App\Hooks\Handlers\ShortCodes\ShortCode { protected static string $shortCodeName = 'fluent_products_search_bar'; public function getScripts(): array { } public function getStyles(): array { } public function localizeData(): array { } public function viewData(): ?array { } public function render(?array $viewData = null) { } private function getTermsData($key): array { } } class ShopAppHandler { protected array $viewData = []; protected array $defaultViewData = []; protected array $shortcodeAttributes = []; protected string $slug = ''; protected string $assetsPath = ''; protected bool $shouldLoadRangePlugin = false; protected array $urlFilters = []; const SHORT_CODE = 'fluent_cart_products'; public function register() { } public function handelShortcodeCall($shortcodeAttributes) { } private function buildPaths() { } private function buildShortcodeAttributes($shortcodeAttributes) { } public function handelGridSizes($key, $defaultValue = 6) { } private function buildFilters() { } private function getMetaFilterOptions($key, $prefilled = []): array { } private function prepareInitialViewData() { } protected function getGridAttributes(): array { } public function getBlockClassName(): array { } private function getViewData(): array { } private function getInitialProducts() { } private function getDefaultConfig() { } public function renderView() { } public function enqueueAssets() { } public function enqueueStyles() { } public function enqueueScripts() { } public function getTermIdsForFilter($defaultFilters): array { } } class SingleProductShortCode extends \FluentCart\App\Hooks\Handlers\ShortCodes\ShortCode { protected static string $shortCodeName = 'fluent_cart_single_product'; public static function register() { } public function getScripts(): array { } public function getStyles(): array { } public function viewData(): ?array { } public function localizeData(): array { } public function render(?array $viewData = null) { } } class StoreLogoShortCode extends \FluentCart\App\Hooks\Handlers\ShortCodes\ShortCode { protected static string $shortCodeName = 'fluent_cart_store_logo'; public function render(?array $viewData = null) { } } } namespace FluentCart\App\Hooks\Handlers { class TemplateLoader { public function init() { } public function showTitle() { } public function showExcerpt() { } public function showBuy() { } // public function loadTemplate($template) // { // if (is_singular(FluentProducts::CPT_NAME)) { // global $post; // unset($GLOBALS['product_detail']); // $product = ProductDetail::where('product_id', $post->ID)->first(); // $GLOBALS['product_detail'] = $product; // return FLUENTCART_PLUGIN_PATH . 'templates/single-product.php'; // } // return $template; // } } class UserHandler { public function register() { } public function handleWpUserProfileUpdated($userId, $oldData, $newData = []) { } public function maybeCreateUser($data) { } /** * @return void */ public function userDeleteHandler($userId) { } public function userRegistrationHandler($userId) { } private function updateCustomer(\FluentCart\App\Models\Customer $customer, object $user, int $userId): void { } private function moveCustomerResources($fromCustomerId, $toCustomerId) { } } } namespace FluentCart\App\Hooks\Scheduler\AutoSchedules { class DailyScheduler { private $startTimeStamp = null; public function register(): void { } public function handle() { } private function deleteOldCarts() { } } class FiveMinuteScheduler { public function register(): void { } public function handle(): void { } } class HourlyScheduler { private $startTimeStamp = null; public function register(): void { } public function handle() { } private function removeCompleteTasks() { } private function checkAndExpireSubscriptions() { } } } namespace FluentCart\App\Hooks\Scheduler { class JobRunner { protected static $instance = null; protected $actionIds = []; protected $actions = []; protected $startedAt; public function __construct() { } public function async($hook, $scheduleActionData) { } public function start($filters = []): void { } public function runScheduler(\FluentCart\App\Models\ScheduledAction $job): void { } public function addQueue(array $data) { } } } namespace FluentCart\Framework\Http { /** * Base controller — exposes the Application, Request, and Response * via protected properties. The `@property` annotations below are * intentional in addition to the protected declarations: they help * PHPStan disambiguate when a subclass declares a method with the * same name as one of these properties (e.g., `function app()`). * * @property \FluentCart\Framework\Foundation\Application $app * @property \FluentCart\Framework\Http\Request\Request $request * @property \FluentCart\Framework\Http\Response\Response $response */ abstract class Controller { /** * Application Instance * @var \FluentCart\Framework\Foundation\Application */ protected $app = null; /** * Request Instane * @var \FluentCart\Framework\Http\Request\Request */ protected $request = null; /** * Response Instane * @var \FluentCart\Framework\Http\Response\Response */ protected $response = null; /** * Validated data after validation has been passed * @var array */ private $__validated = []; /** * Construct the controller instance */ public function __construct($app = null) { } /** * Validate the request data * @param array $data * @param array $rules * @param array $messages * @return array */ public function validate($data, $rules, $messages = []) { } /** * Get the valid data after validation has been passed. * * @return array */ public function validated() { } /** * Send json response * @param array $data * @param integer $code * @return string|false The JSON encoded string, or false if it cannot be encoded. */ public function json($data = [], $code = 200) { } /** * Send json response * @param array $data * @param integer $code * @return \WP_REST_Response */ public function response($data = [], $code = 200) { } /** * Send json response * @param array $data * @param integer $code * @return \WP_REST_Response */ public function send($data = [], $code = 200) { } /** * Send a success json response. * * @param array $data * @return \WP_REST_Response */ public function sendSuccess($data = []) { } /** * Send an error json response * @param array $data * @param integer $code * @return \WP_REST_Response */ public function sendError($data = [], $code = 422) { } /** * Dynamically Access components from container * @param string $key * @return mixed * @throws \ReflectionException */ public function __get($key) { } } } namespace FluentCart\App\Http\Controllers { abstract class Controller extends \FluentCart\Framework\Http\Controller { /** * * @param string $permission * @return false|string|void */ public function redirectOnUnauthorized(string $permission) { } public function getUser() { } public function entityNotFoundError($message, $buttonText = null, $route = '/'): \WP_REST_Response { } } class ActivityController extends \FluentCart\App\Http\Controllers\Controller { public function index(\FluentCart\Framework\Http\Request\Request $request) { } public function delete($id) { } public function markReadUnread($id, \FluentCart\Framework\Http\Request\Request $request): \WP_REST_Response { } } class AddonsController extends \FluentCart\App\Http\Controllers\Controller { public function getAddons(\FluentCart\Framework\Http\Request\Request $request) { } public function getPremiumIntegrations() { } public function installAndActivate(\FluentCart\Framework\Http\Request\Request $request) { } } class AddressInfoController extends \FluentCart\App\Http\Controllers\Controller { public function countriesOption(): \WP_REST_Response { } public function getCountryInfo(\FluentCart\Framework\Http\Request\Request $request): \WP_REST_Response { } } } namespace FluentCart\App\Http\Controllers\AdvanceFilter { class AdvanceFilterController extends \FluentCart\App\Http\Controllers\Controller { public function getFilterOption(\FluentCart\Framework\Http\Request\Request $request): \WP_REST_Response { } public function getSearchOptions(\FluentCart\Framework\Http\Request\Request $request) { } } } namespace FluentCart\App\Http\Controllers\AppControllers { class AppController extends \FluentCart\App\Http\Controllers\Controller { public function init(\FluentCart\Framework\Http\Request\Request $request): \WP_REST_Response { } public function attachments(): \WP_REST_Response { } public function uploadAttachments(\FluentCart\Framework\Http\Request\Request $request) { } } } namespace FluentCart\App\Http\Controllers { class AttributesController extends \FluentCart\App\Http\Controllers\Controller { public function getGroup(\FluentCart\Framework\Http\Request\Request $request, $group_id): array { } public function getGroups(\FluentCart\Framework\Http\Request\Request $request) { } /** * Two-pass payload for the Advanced Variation library picker. * * Pass 1: groups list (capped at 200) plus a per-group terms_count from a * single batched aggregate. No terms are eager-loaded — at scale (200 * groups times hundreds of terms each) the combined payload could exceed * memory limits and stall the admin request. * * Pass 2: the picker calls GET attr/group/{id}/terms on expand to fetch * the full paginated term list for the specific group the merchant * clicked. This trades one big upfront response for one small expansion * round-trip per group the user actually interacts with — the usual * pattern at expected catalog sizes (most stores expand 1-3 groups, not * all 200). */ public function getLibrary(\FluentCart\Framework\Http\Request\Request $request): array { } public function createGroup(\FluentCart\App\Http\Requests\AttrGroupRequest $request) { } public function updateGroup(\FluentCart\App\Http\Requests\AttrGroupRequest $request, $group_id) { } public function deleteGroup(\FluentCart\Framework\Http\Request\Request $request, $group_id) { } public function getTerms(\FluentCart\Framework\Http\Request\Request $request, $group_id): array { } public function createTerms(\FluentCart\App\Http\Requests\AttrTermRequest $request, $group_id) { } public function updateTerm(\FluentCart\App\Http\Requests\AttrTermUpdateRequest $request, $group_id, $term_id) { } public function deleteTerm(\FluentCart\Framework\Http\Request\Request $request, $group_id, $term_id) { } public function reorderTerms(\FluentCart\Framework\Http\Request\Request $request, $group_id) { } public function reorderGroups(\FluentCart\Framework\Http\Request\Request $request) { } } class CartController extends \FluentCart\App\Http\Controllers\Controller { /** * * @param \FluentCart\Framework\Http\Request\Request $request * @return array */ public function getStatus(\FluentCart\Framework\Http\Request\Request $request) { } /** * * @param \FluentCart\Framework\Http\Request\Request $request */ public function updateCart(\FluentCart\App\Http\Requests\CartRequest $request) { } /** * * @param \FluentCart\Framework\Http\Request\Request $request * @return mixed */ public function addToCart(\FluentCart\App\Http\Requests\CartRequest $request) { } } class CheckoutController extends \FluentCart\App\Http\Controllers\Controller { /** * @throws \Exception */ public function placeOrder(\FluentCart\Framework\Http\Request\Request $request) { } public function getCheckoutSummary(\FluentCart\Framework\Http\Request\Request $request) { } public function getOrderInfo(\FluentCart\Framework\Http\Request\Request $request) { } } class CheckoutFieldsController extends \FluentCart\App\Http\Controllers\Controller { public function getFields() { } public function saveFields(\FluentCart\Framework\Http\Request\Request $request) { } } class CouponsController extends \FluentCart\App\Http\Controllers\Controller { public function index(\FluentCart\Framework\Http\Request\Request $request) { } public function viewDetails(\FluentCart\Framework\Http\Request\Request $request, $id) { } public function create(\FluentCart\App\Http\Requests\CouponRequest $request) { } public function update(\FluentCart\App\Http\Requests\CouponRequest $request, $id) { } public function delete(\FluentCart\Framework\Http\Request\Request $request) { } public function applyCoupon(\FluentCart\App\Http\Requests\FrontendRequests\CouponRequest $request) { } public function cancelCoupon(\FluentCart\App\Http\Requests\FrontendRequests\CouponRequest $request) { } public function reapplyCoupon(\FluentCart\Framework\Http\Request\Request $request) { } public function listCoupons(\FluentCart\Framework\Http\Request\Request $request) { } public function isProductEligible(\FluentCart\Framework\Http\Request\Request $request) { } public function storeCouponSettings(\FluentCart\Framework\Http\Request\Request $request) { } public function getSettings() { } } class CustomerController extends \FluentCart\App\Http\Controllers\Controller { public function index(\FluentCart\Framework\Http\Request\Request $request): \WP_REST_Response { } public function store(\FluentCart\App\Http\Requests\CustomerRequest $request) { } public function update(\FluentCart\App\Http\Requests\CustomerRequest $request, $customerId) { } public function find(\FluentCart\Framework\Http\Request\Request $request, $customerId) { } public function findOrder(\FluentCart\Framework\Http\Request\Request $request, $customerId) { } public function updateAdditionalInfo(\FluentCart\Framework\Http\Request\Request $request, $customerId) { } public function getAddress(\FluentCart\Framework\Http\Request\Request $request, $customerId) { } public function createAddress(\FluentCart\App\Http\Requests\CustomerAddressRequest $request, $customerId) { } public function updateAddress(\FluentCart\App\Http\Requests\CustomerAddressRequest $request) { } public function removeAddress(\FluentCart\Framework\Http\Request\Request $request) { } public function setAddressPrimary(\FluentCart\Framework\Http\Request\Request $request, $customerId) { } public function getCustomerOrders(\FluentCart\Framework\Http\Request\Request $request, $customerId): array { } public function handleBulkActions(\FluentCart\Framework\Http\Request\Request $request, \FluentCart\App\Helpers\CustomerHelper $customerHelper) { } public function getStats($customerId): \WP_REST_Response { } public function getAttachableUser(): \WP_REST_Response { } public function setAttachableUser(\FluentCart\App\Http\Requests\AttachUserRequest $request, $customerId): \WP_REST_Response { } public function detachCustomer(\FluentCart\Framework\Http\Request\Request $request, $customerId): \WP_REST_Response { } public function recalculateLtv(\FluentCart\Framework\Http\Request\Request $request, $customerId): \WP_REST_Response { } } class DashboardController extends \FluentCart\App\Http\Controllers\Controller { public function getOnboardingData() { } protected function isStoreInfoProvided(array $settings): bool { } protected function isProductInfoProvided(): bool { } private function isAllPageSetUpDone(array $settings): bool { } private function isAnyPaymentModuleEnabled(): bool { } public function getDashboardStats(): \WP_REST_Response { } } class DataBackfillController extends \FluentCart\App\Http\Controllers\Controller { /** * Run pending one-shot data backfills within this request's budget. * The admin app silently re-calls this endpoint while the returned * status is 'running'; 'locked' means another request is already on it. */ public function run() { } } class EmailNotificationController extends \FluentCart\App\Http\Controllers\Controller { public function index(\FluentCart\Framework\Http\Request\Request $request): \WP_REST_Response { } public function find($notification): \WP_REST_Response { } public function update(\FluentCart\App\Http\Requests\EmailNotificationRequest $request, $notification): \WP_REST_Response { } public function enableNotification(\FluentCart\Framework\Http\Request\Request $request, $name): \WP_REST_Response { } public function getShortCodes(\FluentCart\Framework\Http\Request\Request $request): \WP_REST_Response { } public function previewDefaultTemplate(\FluentCart\Framework\Http\Request\Request $request) { } public function getTemplateFiles() { } public function getSettings(): \WP_REST_Response { } public function saveSettings(\FluentCart\App\Http\Requests\EmailSettingsRequest $request): \WP_REST_Response { } public function getDigestSettings(): \WP_REST_Response { } public function saveDigestSettings(\FluentCart\Framework\Http\Request\Request $request): \WP_REST_Response { } public function sendDigestTest(\FluentCart\Framework\Http\Request\Request $request): \WP_REST_Response { } public function getSchedulingSettings(\FluentCart\Api\StoreSettings $storeSettings): array { } public function saveSchedulingSettings(\FluentCart\App\Http\Requests\SchedulingSettingsRequest $request, \FluentCart\Api\StoreSettings $storeSettings): \WP_REST_Response { } public function sendManualReminder(\FluentCart\Framework\Http\Request\Request $request): \WP_REST_Response { } } class FileUploadController extends \FluentCart\App\Http\Controllers\Controller { public function index(\FluentCart\Framework\Http\Request\Request $request) { } public function getBucketList(\FluentCart\Framework\Http\Request\Request $request) { } private function invalidDriverResponse($driver) { } public function upload(\FluentCart\Framework\Http\Request\Request $request) { } public function uploadEditorFile(\FluentCart\Framework\Http\Request\Request $request) { } public function deleteFile(\FluentCart\Framework\Http\Request\Request $request) { } } } namespace FluentCart\App\Http\Controllers\FrontendControllers { class BaseFrontendController extends \FluentCart\App\Http\Controllers\Controller { /** * Check if the user is logged in. * * @return \WP_REST_Response|null Returns an error response if the user is not logged in; otherwise, returns null. */ protected function checkUserLoggedIn(): ?\WP_REST_Response { } } class CustomerController extends \FluentCart\App\Http\Controllers\Controller { public function index(\FluentCart\Framework\Http\Request\Request $request) { } public function store(\FluentCart\App\Http\Requests\CustomerRequest $request) { } public function updateDetails(\FluentCart\App\Http\Requests\CustomerRequest $request, $customerId) { } public function getDetails(\FluentCart\Framework\Http\Request\Request $request, $customerId) { } public function getAddress(\FluentCart\Framework\Http\Request\Request $request, $customerId) { } public function updateAddressSelect(\FluentCart\Framework\Http\Request\Request $request, $customerAddressId) { } public function createAddress(\FluentCart\Framework\Http\Request\Request $request) { } private function validateAddressData($data) { } private function resolveCountryForValidation(array $address, string $addressType): string { } private function validateAddressField(string $field, $value, string $rule, string $label, string $country): array { } private function validateCountryField($value, string $rule, string $label, \FluentCart\App\Services\Localization\LocalizationManager $localization): array { } private function validateStateField($value, string $rule, string $label, string $country, \FluentCart\App\Services\Localization\LocalizationManager $localization): array { } public function updateAddress(\FluentCart\App\Http\Requests\FrontendRequests\CustomerAddressRequest $request) { } public function removeAddress(\FluentCart\Framework\Http\Request\Request $request) { } public function setAddressPrimary(\FluentCart\Framework\Http\Request\Request $request, $customerId) { } public function getCustomerOrders(\FluentCart\Framework\Http\Request\Request $request, $customerId): array { } private static function formattedAddress(array $data = []): array { } } class CustomerOrderController extends \FluentCart\App\Http\Controllers\FrontendControllers\BaseFrontendController { public function getOrders(\FluentCart\Framework\Http\Request\Request $request): \WP_REST_Response { } public function orderDetails($order_uuid): \WP_REST_Response { } public function downloadableProducts($order_uuid): \WP_REST_Response { } /** * @param $order * @return bool|string */ public function getCustomPaymentLink($order) { } public function getTransactionBillingAddress(\FluentCart\Framework\Http\Request\Request $request, $transaction_uuid) { } public function saveTransactionBillingAddress(\FluentCart\Framework\Http\Request\Request $request, $transaction_uuid) { } } class CustomerProfileController extends \FluentCart\App\Http\Controllers\FrontendControllers\BaseFrontendController { /** * Handle the request to retrieve the customer's orders. * * This method checks if the user is logged in, retrieves the current customer, * and searches for their orders based on the provided search parameters. * * @param \FluentCart\Framework\Http\Request\Request $request The incoming HTTP request. * @return array */ public function index(\FluentCart\Framework\Http\Request\Request $request) { } public function getCustomerProfileDetails() { } public function updateCustomerProfileDetails(\FluentCart\App\Http\Requests\FrontendRequests\CustomerRequests\CustomerProfileAccountDetailsRequest $request): \WP_REST_Response { } /** * Helper method to validate email uniqueness */ private function validateEmailUniqueness($email, $currentCustomerId): ?\WP_REST_Response { } public function createCustomerProfileAddress(\FluentCart\App\Http\Requests\FrontendRequests\CustomerRequests\CustomerProfileRequest $request): \WP_REST_Response { } public function updateCustomerProfileAddress(\FluentCart\App\Http\Requests\FrontendRequests\CustomerRequests\CustomerProfileRequest $request): \WP_REST_Response { } public function makePrimaryCustomerProfileAddress(\FluentCart\Framework\Http\Request\Request $request): \WP_REST_Response { } public function deleteCustomerProfileAddress(\FluentCart\Framework\Http\Request\Request $request) { } public function getDownloads(\FluentCart\Framework\Http\Request\Request $request): \WP_REST_Response { } /* * Get upgradable paths for a given variation */ public function getUpgradePaths(\FluentCart\Framework\Http\Request\Request $request, $orderHash) { } } class CustomerSubscriptionController extends \FluentCart\App\Http\Controllers\FrontendControllers\BaseFrontendController { public function getSubscriptions(\FluentCart\Framework\Http\Request\Request $request): \WP_REST_Response { } public function getSubscription($subscription_uuid): \WP_REST_Response { } public function updatePaymentMethod(\FluentCart\Framework\Http\Request\Request $request, $subscription_uuid) { } public function getOrCreatePlan(\FluentCart\Framework\Http\Request\Request $request, $subscription_uuid) { } public function switchPaymentMethod(\FluentCart\Framework\Http\Request\Request $request, $subscription_uuid) { } // needed in case of two step switch payment method public function confirmSubscriptionSwitch(\FluentCart\Framework\Http\Request\Request $request, $subscription_uuid) { } public function cancelAutoRenew(\FluentCart\Framework\Http\Request\Request $request, $subscription_uuid) { } public function initiateEarlyPayment(\FluentCart\Framework\Http\Request\Request $request, $subscription_uuid) { } private function canEarlyPay(\FluentCart\App\Models\Subscription $subscription): bool { } public function pauseSubscription(\FluentCart\Framework\Http\Request\Request $request, $subscription_uuid) { } public function resumeSubscription(\FluentCart\Framework\Http\Request\Request $request, $subscription_uuid) { } public function getSetupIntentRemainingAttempts($subscription_uuid) { } } } namespace FluentCart\App\Http\Controllers { class IntegrationController extends \FluentCart\App\Http\Controllers\Controller { public function index() { } public function updateStatus() { } public function saveSettings(\FluentCart\Framework\Http\Request\Request $request) { } public function lists() { } /** * @return array * @throws \Exception * Get all Global Integrations */ public function getFeeds(\FluentCart\Framework\Http\Request\Request $request) { } public function changeStatus(\FluentCart\Framework\Http\Request\Request $request, $integrationId) { } public function getSettings(\FluentCart\Framework\Http\Request\Request $request) { } public function deleteSettings(\FluentCart\Framework\Http\Request\Request $request, $integrationId) { } /** * @return array * @throws \Exception * Get global settings of an integration */ public function getGlobalSettings() { } public function setGlobalSettings() { } public function authenticateCredentials() { } public function chained() { } public function installPlugin() { } public function getDynamicOptions(\FluentCart\Framework\Http\Request\Request $request) { } } class LabelController extends \FluentCart\App\Http\Controllers\Controller { public function index(\FluentCart\Framework\Http\Request\Request $request) { } public function create(\FluentCart\App\Http\Requests\LabelRequest $request) { } public function updateSelections(\FluentCart\Framework\Http\Request\Request $request) { } } /** * Backend for the Settings → Features & addon → MCP card. * * The MCP feature stores its on/off state under the `mcp` key of the shared * `fluent_cart_modules_settings` blob (autoloaded — no extra query on init). * It still owns its own status/toggle/snippet endpoints (instant toggle + the * connection helpers) rather than riding the shared modules save; toggle() * read-modify-writes only the `mcp` key so the rest of the blob is untouched. */ class McpSettingsController extends \FluentCart\App\Http\Controllers\Controller { const TOOLKIT_PLUGIN_FILE = 'fluent-toolkit/fluent-toolkit.php'; /** GitHub link shown when no Pro plugin can auto-install the toolkit. */ const TOOLKIT_DOWNLOAD_URL = 'https://github.com/WPManageNinja/fluent-toolkit'; /** Status payload for the MCP card: enabled state, endpoint, adapter, snippet helpers. */ public function status() { } /** * One-click FluentHub install. The free plugin can only detect + trigger; * the actual installer lives in a Fluent Pro plugin (FluentCart Pro, or any * Fluent product) that hooks the site-wide `fluent_toolkit/*` contract. With * no Pro present we hand back the manual download link. */ public function installAdapter() { } /** Is FluentHub (the toolkit plugin) present on disk (installed, active or not)? */ private function isToolkitInstalled() { } /** Flip the master switch. Writes the same blob key the server boot guard reads. */ public function toggle(\FluentCart\Framework\Http\Request\Request $request) { } /** * Connection snippets for EVERY supported client, in one response. They're * cheap server-side string templates, so we build them all at once rather * than round-tripping per tab — the UI just switches between cached entries. * * Credentials are NEVER sent here: each snippet carries placeholders the * browser fills in client-side, so an application password never round-trips * through the server. Only `local_dev` (TLS verification for Claude Desktop) * varies the output. */ public function getConfigSnippets(\FluentCart\Framework\Http\Request\Request $request) { } /** * Build a single client's connection snippet + instructions. Pure string * assembly — no DB, no credentials. */ private function buildSnippet($client, $endpoint, $isLocalDev) { } /** * Best-effort "is this a local dev site?" check, used to default the TLS * override in the Claude Desktop snippet. Filterable for edge cases. */ private function isLocalDev() { } } class ModuleSettingsController extends \FluentCart\App\Http\Controllers\Controller { public function getSettings(): \WP_REST_Response { } public function saveSettings(\FluentCart\Framework\Http\Request\Request $request) { } private function hasModuleSettingsChanged($newData, $oldData) { } public function getPluginAddons(): \WP_REST_Response { } public function installPluginAddon(\FluentCart\Framework\Http\Request\Request $request): \WP_REST_Response { } public function activatePluginAddon(\FluentCart\Framework\Http\Request\Request $request): \WP_REST_Response { } public function verifyTurnstileKeys(\FluentCart\Framework\Http\Request\Request $request): \WP_REST_Response { } private function getRegisteredPluginAddons(): array { } } class NotesController extends \FluentCart\App\Http\Controllers\Controller { public function attach(\FluentCart\Framework\Http\Request\Request $request) { } } class OnboardingController extends \FluentCart\App\Http\Controllers\Controller { public function index(\FluentCart\Framework\Http\Request\Request $request): \WP_REST_Response { } public function createPages(\FluentCart\Framework\Http\Request\Request $request): \WP_REST_Response { } public function createPage(\FluentCart\App\Http\Requests\CreatePageRequest $request): \WP_REST_Response { } public function saveTaxSettings(\FluentCart\Framework\Http\Request\Request $request): \WP_REST_Response { } public function saveSettings(\FluentCart\Framework\Http\Request\Request $request) { } } class OrderController extends \FluentCart\App\Http\Controllers\Controller { protected function getTestOrdersQuery() { } public function index(\FluentCart\Framework\Http\Request\Request $request): \WP_REST_Response { } /** * @throws \Exception */ public function store(\FluentCart\App\Http\Requests\OrderRequest $request) { } public static function hasSubscription($orderItems): bool { } public function updateOrder(\FluentCart\App\Http\Requests\OrderRequest $request, $order_id) { } public function updateOrderAddressId(\FluentCart\Framework\Http\Request\Request $request, $order_id) { } public function generateMissingLicenses(\FluentCart\Framework\Http\Request\Request $request, \FluentCart\App\Models\Order $order) { } /** * @throws \FluentCart\Framework\Validator\ValidationException */ public function refundOrder(\FluentCart\Framework\Http\Request\Request $request, $orderId) { } public function createAndChangeCustomer(\FluentCart\App\Http\Requests\CustomerRequest $request, $order_id) { } public function changeCustomer(\FluentCart\Framework\Http\Request\Request $request, $order_id) { } private function updateOrderCustomer($customerId, $orderId) { } public function deleteOrder(\FluentCart\Framework\Http\Request\Request $request, $order_id) { } /** * Delete order related data (transactions, items, meta, addresses, orders) */ private function deleteOrderRelatedData(array $orderIds, bool $isTestMode = false): void { } public function getDetails($orderId) { } public function createCustom(\FluentCart\Framework\Http\Request\Request $request, \FluentCart\App\Helpers\OrderItemHelper $orderItemHelper, \FluentCart\App\Models\Order $order) { } // public function calculate(Request $request, OrderHelper $orderHelper) // { // return $orderHelper->calculate($request->order); // } public function updateStatuses(\FluentCart\Framework\Http\Request\Request $request, \FluentCart\App\Models\Order $order) { } public function updateOrderAddress(\FluentCart\Framework\Http\Request\Request $request, $orderId, $addressId) { } public function markAsPaid(\FluentCart\Framework\Http\Request\Request $request, \FluentCart\App\Models\Order $order) { } public function handleBulkActions(\FluentCart\Framework\Http\Request\Request $request) { } protected function handleDeleteTestOrdersBulkAction(\FluentCart\Framework\Http\Request\Request $request) { } public function updateTransactionStatus(\FluentCart\Framework\Http\Request\Request $request, $order, \FluentCart\App\Models\OrderTransaction $transaction) { } public function syncPendingTransaction(\FluentCart\Framework\Http\Request\Request $request, $order, \FluentCart\App\Models\OrderTransaction $transaction) { } public function getStats($orderUuid): \WP_REST_Response { } public function getShippingMethods(\FluentCart\Framework\Http\Request\Request $request): \WP_REST_Response { } protected function getEnabledShippingMethodsWithCharges(array $orderItems) { } public function updateShipping(\FluentCart\Framework\Http\Request\Request $request) { } /** * Calculate tax for an admin order given an address and item list. * No DB writes — pure calculation helper. * * Accepts: { country, state, city, postcode, items: [{post_id, object_id, subtotal, discount_total}] } * Returns: { tax_total, shipping_tax, tax_lines, tax_behavior, tax_country } */ public function calculateTax(\FluentCart\Framework\Http\Request\Request $request) { } protected function prepareOrderItemsWithVariations($orderItems) { } public function acceptDispute(\FluentCart\Framework\Http\Request\Request $request, $order, $transaction) { } public function syncOrderStatuses(\FluentCart\Framework\Http\Request\Request $request, \FluentCart\App\Models\Order $order) { } } class PaymentMethodController extends \FluentCart\App\Http\Controllers\Controller { public function index(\FluentCart\Framework\Http\Request\Request $request, \FluentCart\App\Hooks\Handlers\GlobalPaymentHandler $globalHandler) { } public function store(\FluentCart\Framework\Http\Request\Request $request, \FluentCart\App\Hooks\Handlers\GlobalPaymentHandler $globalHandler) { } public function getSettings(\FluentCart\Framework\Http\Request\Request $request, \FluentCart\App\Hooks\Handlers\GlobalPaymentHandler $globalHandler) { } public function saveDesign(\FluentCart\Framework\Http\Request\Request $request) { } public function connectInfo(\FluentCart\Framework\Http\Request\Request $request, \FluentCart\App\Hooks\Handlers\GlobalPaymentHandler $globalHandler) { } public function disconnect(\FluentCart\Framework\Http\Request\Request $request, \FluentCart\App\Hooks\Handlers\GlobalPaymentHandler $globalHandler) { } public function setPayPalWebhook(\FluentCart\Framework\Http\Request\Request $request) { } public function checkPayPalWebhook(\FluentCart\Framework\Http\Request\Request $request) { } public function reorder(\FluentCart\Framework\Http\Request\Request $request) { } public function installAddon(\FluentCart\Framework\Http\Request\Request $request) { } public function activateAddon(\FluentCart\Framework\Http\Request\Request $request) { } } class ProductController extends \FluentCart\App\Http\Controllers\Controller { public function index(\FluentCart\Framework\Http\Request\Request $request): \WP_REST_Response { } public function find(\FluentCart\Framework\Http\Request\Request $request, \FluentCart\App\Models\Product $product): array { } public function getRelatedProducts(\FluentCart\Framework\Http\Request\Request $request, $productId): \WP_REST_Response { } /** * * @param \FluentCart\App\Http\Requests\ProductRequest $request * @return \WP_REST_Response */ public function create(\FluentCart\App\Http\Requests\ProductCreateRequest $request): \WP_REST_Response { } /** * Bulk insert products from import/manual entry. * * @param \FluentCart\Framework\Http\Request\Request $request * @return \WP_REST_Response */ public function bulkInsert(\FluentCart\Framework\Http\Request\Request $request): \WP_REST_Response { } /** * Duplicate a product with selected options * * @param \FluentCart\Framework\Http\Request\Request $request * @param int $productId * @return \WP_REST_Response */ public function duplicate(\FluentCart\Framework\Http\Request\Request $request, $productId): \WP_REST_Response { } public function delete(\FluentCart\Framework\Http\Request\Request $request, \FluentCart\App\Models\Product $product) { } public function update(\FluentCart\App\Http\Requests\ProductUpdateRequest $request, $postId) { } private function applyPartialPostUpdate(array $data, $postId) { } public function updateLongDescEditorMode(\FluentCart\Framework\Http\Request\Request $request, $postId) { } public function updateTaxClass(\FluentCart\Framework\Http\Request\Request $request, $postId) { } public function removeTaxClass(\FluentCart\Framework\Http\Request\Request $request, $postId) { } public function toggleTaxExempt(\FluentCart\Framework\Http\Request\Request $request, $postId) { } public function updateShippingClass(\FluentCart\Framework\Http\Request\Request $request, $postId) { } public function removeShippingClass(\FluentCart\Framework\Http\Request\Request $request, $postId) { } /** * * @param \FluentCart\Framework\Http\Request\Request $request * @param $productId * @return \WP_REST_Response */ public function get(\FluentCart\Framework\Http\Request\Request $request, $productId) { } public function getUpgradeSettings($id, \FluentCart\Framework\Http\Request\Request $request): \WP_REST_Response { } public function saveUpgradeSetting(\FluentCart\App\Http\Requests\UpgradePathSettingRequest $request, $id): \WP_REST_Response { } public function deleteUpgradePath($id): \WP_REST_Response { } public function updateUpgradePath(\FluentCart\App\Http\Requests\UpgradePathSettingRequest $request, $id): \WP_REST_Response { } public function getUpgradePaths($variationId, \FluentCart\Framework\Http\Request\Request $request) { } public function getPricingWidgets(\FluentCart\Framework\Http\Request\Request $request, $productId) { } public function updateProductDetail(\FluentCart\Framework\Http\Request\Request $request, $id) { } public function syncTaxonomyTerms(\FluentCart\Framework\Http\Request\Request $request, $id) { } public function deleteTaxonomyTerms(\FluentCart\Framework\Http\Request\Request $request, $id) { } public function updateVariantOption(\FluentCart\Framework\Http\Request\Request $request, $postId) { } public function addProductTerms(\FluentCart\Framework\Http\Request\Request $request) { } public function getProductTermsList(): array { } public function getProductTermListByParent(\FluentCart\Framework\Http\Request\Request $request): \WP_REST_Response { } public function handleBulkActions(\FluentCart\Framework\Http\Request\Request $request) { } public static function getMimeGroups() { } public function searchVariantByName(\FluentCart\Framework\Http\Request\Request $request): array { } public function searchProductVariantOptions(\FluentCart\Framework\Http\Request\Request $request): array { } public function findSubscriptionVariants(\FluentCart\Framework\Http\Request\Request $request) { } public function fetchVariationsByIds(\FluentCart\Framework\Http\Request\Request $request): array { } public function searchProductByName(\FluentCart\Framework\Http\Request\Request $request): array { } public function getBundleInfo(\FluentCart\Framework\Http\Request\Request $request, $productId): array { } public function saveBundleInfo(\FluentCart\Framework\Http\Request\Request $request, $variationId): array { } public function fetchProductsByIds(\FluentCart\Framework\Http\Request\Request $request): array { } public function getMaxExcerptWordCount(): \WP_REST_Response { } public function createDummyProducts(\FluentCart\Framework\Http\Request\Request $request) { } public function updateInventory(\FluentCart\Framework\Http\Request\Request $request, $postId, $variantId) { } public function updateManageStock(\FluentCart\Framework\Http\Request\Request $request, $postId) { } /** * Suggest a unique SKU based on product title and optional variant title. * * @param \FluentCart\Framework\Http\Request\Request $request * @return \WP_REST_Response */ public function suggestSku(\FluentCart\Framework\Http\Request\Request $request) { } /** * Generate a SKU string from a product title and optional variant title. * * @param string $title * @param string $variantTitle * @return string */ private function generateSkuFromTitle($title, $variantTitle = '') { } /** * Ensure the SKU is unique in the database, appending a numeric suffix if needed. * * @param string $sku * @param int|null $excludeId * @return string */ private function ensureUniqueSku($sku, $excludeId = null) { } /** * Fetch products formatted for bulk editing. */ public function bulkEditFetch(\FluentCart\Framework\Http\Request\Request $request): \WP_REST_Response { } /** * Bulk update products from the bulk edit spreadsheet. */ public function bulkUpdate(\FluentCart\Framework\Http\Request\Request $request): \WP_REST_Response { } } class ProductDownloadablesController extends \FluentCart\App\Http\Controllers\Controller { public function syncDownloadableFiles(\FluentCart\Framework\Http\Request\Request $request): \WP_REST_Response { } public function getDownloadableUrl($downloadableId) { } public function update(\FluentCart\App\Http\Requests\ProductDownloadable\ProductDownloadableFileRequest $request, $downloadId) { } public function delete($downloadableFileId) { } public function updateDownloadableFile(\FluentCart\Framework\Http\Request\Request $request, \FluentCart\App\Models\Product $product, \FluentCart\App\Models\ProductDownload $productDownload) { } } class ProductIntegrationsController extends \FluentCart\Framework\Http\Controller { public function getFeeds(\FluentCart\Framework\Http\Request\Request $request) { } /** * Get product-specific integration settings * * @param \FluentCart\Framework\Http\Request\Request $request * @param int $product_id * @param string $integration_name */ public function getProductIntegrationSettings(\FluentCart\Framework\Http\Request\Request $request, $product_id, $integration_name) { } /** * @param \FluentCart\Framework\Http\Request\Request $request * @param $product_id * @return array|\WP_REST_Response */ public function saveProductIntegration(\FluentCart\Framework\Http\Request\Request $request, $product_id) { } public function changeStatus(\FluentCart\Framework\Http\Request\Request $request) { } public function deleteProductIntegration(\FluentCart\Framework\Http\Request\Request $request, $product_id, $integration_id) { } /** * Get integration settings for a specific integration type * * @param string $integration_type */ private function getIntegrationSettings($integration_type) { } private function getNotificationFeeds($productId) { } } class ProductVariationController extends \FluentCart\App\Http\Controllers\Controller { public function index(\FluentCart\Framework\Http\Request\Request $request): array { } public function find(\FluentCart\Framework\Http\Request\Request $request, \FluentCart\App\Models\ProductVariation $product): array { } public function create(\FluentCart\App\Http\Requests\ProductVariationRequest $request) { } public function update(\FluentCart\App\Http\Requests\ProductVariationRequest $request, $variantId) { } public function updateTaxSettings(\FluentCart\Framework\Http\Request\Request $request, $variantId) { } public function delete(\FluentCart\Framework\Http\Request\Request $request, $variantId) { } public function setMedia(\FluentCart\Framework\Http\Request\Request $request, $variantId) { } public function updatePricingTable(\FluentCart\Framework\Http\Request\Request $request, $variantId) { } public function bulkUpdate(\FluentCart\App\Http\Requests\BulkUpdateVariantRequest $request) { } /** * Group bulk update — partial update with PATCH semantics. * Any field left null in the payload is skipped; only provided non-null * fields are written to each variant in the group. For other_info, only * the supplied non-null sub-keys are merged into the existing JSON. */ public function groupBulkUpdate(\FluentCart\App\Http\Requests\GroupBulkUpdateVariantRequest $request) { } /** * Build the per-variant billing summary string, mirroring the admin JS * (ProductEditModel.onChangePricingPayment): "{price} {interval} {occurrence}". */ private function buildBillingSummary($priceCents, array $otherInfo) { } /** * Sanitize the other_info delta for group bulk update. * Only known sub-keys are allowed; unknown keys are dropped to prevent * arbitrary data injection into the JSON column. */ private function sanitizeOtherInfoDelta(array $raw) { } } class RenewalController extends \FluentCart\App\Http\Controllers\Controller { /** * List all invoices (renewal orders) */ public function index(\FluentCart\Framework\Http\Request\Request $request): \WP_REST_Response { } /** * Get single invoice details */ public function show(\FluentCart\Framework\Http\Request\Request $request, int $id): \WP_REST_Response { } /** * Void/cancel a pending invoice */ public function void(\FluentCart\Framework\Http\Request\Request $request, \FluentCart\App\Models\Order $order): \WP_REST_Response { } /** * Resend invoice email notification */ public function resend(\FluentCart\Framework\Http\Request\Request $request, \FluentCart\App\Models\Order $order): \WP_REST_Response { } } } namespace FluentCart\App\Http\Controllers\Reports { class CustomerReportController extends \FluentCart\App\Http\Controllers\Controller { public function index(\FluentCart\Framework\Http\Request\Request $request) { } } class DefaultReportController extends \FluentCart\App\Http\Controllers\Controller { protected $params = ['orderTypes', 'paymentStatus']; public function getTopSoldProducts(\FluentCart\Framework\Http\Request\Request $request): array { } public function getTopSoldVariants(\FluentCart\Framework\Http\Request\Request $request): array { } public function getSalesReport(\FluentCart\Framework\Http\Request\Request $request) { } } class LicenseReportController extends \FluentCart\App\Http\Controllers\Controller { public function getLicenseLineChart(\FluentCart\Framework\Http\Request\Request $request): array { } public function getLicensePieChart(\FluentCart\Framework\Http\Request\Request $request): array { } public function getLicenseSummary(\FluentCart\Framework\Http\Request\Request $request): array { } } class OrderReportController extends \FluentCart\App\Http\Controllers\Controller { protected $params = ['orderTypes', 'paymentStatus']; public function getOrderChart(\FluentCart\Framework\Http\Request\Request $request): array { } public function getNewVsReturningCustomer(\FluentCart\Framework\Http\Request\Request $request) { } public function getOrderByGroup(\FluentCart\Framework\Http\Request\Request $request) { } public function getOrderValueDistribution(\FluentCart\Framework\Http\Request\Request $request) { } public function getReportByDayAndHour(\FluentCart\Framework\Http\Request\Request $request) { } public function getItemCountDistribution(\FluentCart\Framework\Http\Request\Request $request) { } public function getOrderCompletionTime(\FluentCart\Framework\Http\Request\Request $request) { } } class OverviewReportController extends \FluentCart\App\Http\Controllers\Controller { public function getOverview(\FluentCart\Framework\Http\Request\Request $request): \WP_REST_Response { } protected function getMonthToMonthStats($start, $end, $currency = null) { } private function fillData($dateRange, $results) { } private function generateComparesMonths($results) { } private function calculateOverallSummary($data) { } private function calculateQuaterlyGrowth($data) { } protected function getCountryWiseStatsImproved($start_date, $end_date, $limit = 5, $currency = null) { } } class ProductReportController extends \FluentCart\App\Http\Controllers\Controller { protected $params = ['paymentStatus', 'orderTypes']; public function getProductPerformance(\FluentCart\Framework\Http\Request\Request $request) { } public function getProductReport(\FluentCart\Framework\Http\Request\Request $request): array { } } class RefundReportController extends \FluentCart\App\Http\Controllers\Controller { protected $params = ['orderTypes', 'paymentStatus']; public function getRefundChart(\FluentCart\Framework\Http\Request\Request $request): array { } public function getWeeksBetweenRefund(\FluentCart\Framework\Http\Request\Request $request): array { } public function getRefundDataByGroup(\FluentCart\Framework\Http\Request\Request $request): array { } } class ReportingController extends \FluentCart\App\Http\Controllers\Controller { public function getOrderQuickStats(\FluentCart\Framework\Http\Request\Request $request): array { } public function getSalesGrowth(\FluentCart\Framework\Http\Request\Request $request, \FluentCart\App\Modules\ReportingModule\SalesReport $salesReport): array { } /** * @deprecated since v1.4. Use GET reports/overview (OverviewReportController::getOverview) instead. */ public function getReportOverview(\FluentCart\Framework\Http\Request\Request $request): array { } public function searchRepeatCustomer(\FluentCart\Framework\Http\Request\Request $request): array { } /** * @deprecated since v1.4. Use GET reports/fetch-top-sold-products (DefaultReportController::getTopSoldProducts) instead. */ public function getTopProductsSold(\FluentCart\Framework\Http\Request\Request $request): array { } public function getReportMeta(\FluentCart\Framework\Http\Request\Request $request): array { } //Dashboard Report Controllers public function getDashBoardSummary(\FluentCart\Framework\Http\Request\Request $request) { } public function getRecentOrders(\FluentCart\Framework\Http\Request\Request $request) { } public function getRecentActivities(\FluentCart\Framework\Http\Request\Request $request) { } public function getDashBoardStats(\FluentCart\Framework\Http\Request\Request $request): array { } public function getSalesGrowthChart(\FluentCart\Framework\Http\Request\Request $request): array { } public function getCountryHeatMap(\FluentCart\Framework\Http\Request\Request $request) { } } class RetentionSnapshotController extends \FluentCart\App\Http\Controllers\Controller { /** * Generate retention snapshots via Action Scheduler (background job) */ public function generate(\FluentCart\Framework\Http\Request\Request $request) { } /** * Check status of a snapshot generation job */ public function checkStatus(\FluentCart\Framework\Http\Request\Request $request) { } } class RevenueReportController extends \FluentCart\App\Http\Controllers\Controller { protected $params = ['paymentStatus', 'orderTypes']; public function getRevenue(\FluentCart\Framework\Http\Request\Request $request): array { } public function getRevenueByGroup(\FluentCart\Framework\Http\Request\Request $request): array { } } class SourceReportController extends \FluentCart\App\Http\Controllers\Controller { protected $params = ['orderTypes', 'paymentStatus']; public function index(\FluentCart\Framework\Http\Request\Request $request): array { } } class SubscriptionReportController extends \FluentCart\App\Http\Controllers\Controller { protected $params = ['paymentStatus', 'subscriptionType']; public function getRetentionChart(\FluentCart\Framework\Http\Request\Request $request) { } public function getDailySignups(\FluentCart\Framework\Http\Request\Request $request) { } public function getSubscriptionChart(\FluentCart\Framework\Http\Request\Request $request) { } public function getFutureRenewals(\FluentCart\Framework\Http\Request\Request $request) { } public function getRetentionData(\FluentCart\Framework\Http\Request\Request $request) { } public function getCohortData(\FluentCart\Framework\Http\Request\Request $request) { } } } namespace FluentCart\App\Http\Controllers { class SettingsController extends \FluentCart\App\Http\Controllers\Controller { public function getStore(\FluentCart\Framework\Http\Request\Request $request, \FluentCart\Api\StoreSettings $storeSettings) { } public function saveStore(\FluentCart\App\Http\Requests\FluentMetaRequest $request, \FluentCart\Api\StoreSettings $storeSettings) { } public function getConfirmation() { } public function saveConfirmation(\FluentCart\Framework\Http\Request\Request $request) { } public function getShortcode(): array { } public function getPermissions() { } public function savePermissions(\FluentCart\Framework\Http\Request\Request $request) { } } class ShopController extends \FluentCart\App\Http\Controllers\Controller { public function getProducts(\FluentCart\Framework\Http\Request\Request $request): array { } public function getProductViews(\FluentCart\Framework\Http\Request\Request $request): array { } public function getTermIdsFromDefaultFilter($defaultFilters): array { } public function getTermIdsFromFilter($filters): array { } public function searchProduct(\FluentCart\Framework\Http\Request\Request $request) { } } class StorageController extends \FluentCart\App\Http\Controllers\Controller { public function index(\FluentCart\Framework\Http\Request\Request $request, \FluentCart\App\Hooks\Handlers\GlobalStorageHandler $globalHandler) { } public function store(\FluentCart\Framework\Http\Request\Request $request) { } public function getSettings(\FluentCart\Framework\Http\Request\Request $request, $driver, \FluentCart\App\Hooks\Handlers\GlobalStorageHandler $globalHandler) { } public function getStatus(\FluentCart\Framework\Http\Request\Request $request, \FluentCart\App\Hooks\Handlers\GlobalStorageHandler $globalHandler) { } public function getActiveDrivers(\FluentCart\Framework\Http\Request\Request $request, \FluentCart\App\Hooks\Handlers\GlobalStorageHandler $globalHandler) { } public function verifyConnectInfo(\FluentCart\Framework\Http\Request\Request $request, \FluentCart\App\Hooks\Handlers\GlobalStorageHandler $globalHandler) { } public function createBucket(\FluentCart\Framework\Http\Request\Request $request) { } public function listBuckets(\FluentCart\Framework\Http\Request\Request $request) { } public function resetSettings(\FluentCart\Framework\Http\Request\Request $request) { } public function changeStatus(\FluentCart\Framework\Http\Request\Request $request) { } private function resolveBucketActionDriver(string $driver, string $method) { } private function resolveStorageDriver(string $driver) { } private function resolveDriverInstance(string $driver) { } } class TaxClassController extends \FluentCart\App\Http\Controllers\Controller { public function index(\FluentCart\Framework\Http\Request\Request $request) { } public function store(\FluentCart\App\Http\Requests\TaxClassRequest $request) { } public function checkAndCreateInitialTaxClasses() { } public function update(\FluentCart\App\Http\Requests\TaxClassRequest $request, $id) { } public function delete(\FluentCart\Framework\Http\Request\Request $request, $id) { } } class TaxConfigurationController extends \FluentCart\App\Http\Controllers\Controller { public function getTaxRates() { } public function saveConfiguredCountries(\FluentCart\Framework\Http\Request\Request $request) { } public function getSettings() { } public function saveSettings(\FluentCart\Framework\Http\Request\Request $request) { } private static function sanitizeNestedArray(array $data) { } private function defaultSettings() { } } class TaxController extends \FluentCart\App\Http\Controllers\Controller { public function index(\FluentCart\Framework\Http\Request\Request $request) { } /** * For rows where the tax_rate FK has no matching DB row (EU home/specific-mode virtual * rates stored as tax_rate_id=0, or rates deleted after order placement), the label was * never written to meta at order time. Attempt to recover it from the EU VAT registration * for that country — one extra DB query per unique country, run only when needed. */ private function enrichOrphanedRateRows($items) { } public function markAsFiled(\FluentCart\Framework\Http\Request\Request $request) { } } class TaxEUController extends \FluentCart\App\Http\Controllers\Controller { public function saveEuVatSettings(\FluentCart\Framework\Http\Request\Request $request) { } public function saveCountryRegistration(\FluentCart\Framework\Http\Request\Request $request) { } public function deleteCountryRegistration(\FluentCart\Framework\Http\Request\Request $request) { } public function getOssCountryRates() { } public function saveOssCountryRates(\FluentCart\Framework\Http\Request\Request $request) { } private function sanitizeNestedArray(array $data) { } private function upsertOssRate($country, $classId, $rate, $rateName) { } public function getEuProductOverrides() { } public function resetEuRatesToDefaults() { } public function euCrossBorderSettings(\FluentCart\Framework\Http\Request\Request $request) { } private function sanitizeCountryCode($countryCode) { } private function isEuVatCountry($countryCode) { } } class TaxRateController extends \FluentCart\App\Http\Controllers\Controller { private static $maxTaxClasses = 6; private static $builtInClasses = [['slug' => 'reduced', 'title' => 'Reduced'], ['slug' => 'zero', 'title' => 'Zero']]; public function getClasses(\FluentCart\Framework\Http\Request\Request $request) { } public function createClass(\FluentCart\Framework\Http\Request\Request $request) { } public function deleteClass(\FluentCart\Framework\Http\Request\Request $request, $id) { } private function migrateProductTaxClassReferences($deletedClassId, $standardClassId) { } private function migrateVariationTaxClassReferences($deletedClassSlug, $standardClassSlug) { } private function migrateEuRegistrationTaxClassReferences($deletedClassSlug, $standardClassSlug) { } private function migrateProductOverridesToStandard($deletedClassId, $standardClassId) { } private function taxOverrideLocationKey($override, array $metaValue) { } private function migrateTaxRatesToStandard($deletedClassId, $standardClassId) { } public function index(\FluentCart\Framework\Http\Request\Request $request) { } public function show(\FluentCart\Framework\Http\Request\Request $request) { } public function update(\FluentCart\App\Http\Requests\TaxRateRequest $request, $id) { } public function store(\FluentCart\App\Http\Requests\TaxRateRequest $request) { } public function delete(\FluentCart\Framework\Http\Request\Request $request, $id) { } public function updateCountryStatus(\FluentCart\App\Http\Requests\TaxCountryStatusRequest $request, $country_code) { } public function getCountryTaxId(\FluentCart\Framework\Http\Request\Request $request, $country_code) { } public function saveCountryTaxId(\FluentCart\Framework\Http\Request\Request $request, $country_code) { } public function deleteShippingOverride(\FluentCart\Framework\Http\Request\Request $request, $id) { } public function saveShippingOverride(\FluentCart\Framework\Http\Request\Request $request) { } public function getProductOverrides(\FluentCart\Framework\Http\Request\Request $request, $country_code) { } public function saveProductOverride(\FluentCart\Framework\Http\Request\Request $request) { } public function deleteProductOverride(\FluentCart\Framework\Http\Request\Request $request, $id) { } public function addCountry(\FluentCart\Framework\Http\Request\Request $request) { } private function getNextBuiltinClass() { } } class TemplateController extends \FluentCart\App\Http\Controllers\Controller { public function getPrintTemplates(\FluentCart\Framework\Http\Request\Request $request): \WP_REST_Response { } public function savePrintTemplates(\FluentCart\Framework\Http\Request\Request $request): \WP_REST_Response { } } class UserController { public function register(\FluentCart\App\Http\Requests\UserRequest $request) { } public function login(\FluentCart\Framework\Http\Request\Request $request) { } } class VariantController extends \FluentCart\App\Http\Controllers\Controller { public function index(\FluentCart\Framework\Http\Request\Request $request): array { } } } namespace FluentCart\App\Http\Controllers\WebController { class FileDownloader extends \FluentCart\App\Http\Controllers\Controller { /** * @param \FluentCart\Framework\Http\Request\Request $request * @return void */ public function index(\FluentCart\Framework\Http\Request\Request $request) { } public function returnError() { } } } namespace FluentCart\App\Http\Controllers { class WidgetsController extends \FluentCart\App\Http\Controllers\Controller { public function __invoke(\FluentCart\Framework\Http\Request\Request $request): \WP_REST_Response { } } } namespace FluentCart\Framework\Foundation { abstract class Policy { /** * Fallback method even if verifyRequest is not implemented. * @return bool true */ public function verifyRequest(\FluentCart\Framework\Http\Request\Request $request) { } } } namespace FluentCart\App\Http\Policies { class Policy extends \FluentCart\Framework\Foundation\Policy { public function userCan($permission): bool { } public function userCanAny($permission): bool { } public function resolveRoutePermission(): array { } public function hasRoutePermissions(): bool { } } class AdminPolicy extends \FluentCart\App\Http\Policies\Policy { public function verifyRequest(\FluentCart\Framework\Http\Request\Request $request): bool { } } class CouponPolicy extends \FluentCart\App\Http\Policies\Policy { public function verifyRequest(\FluentCart\Framework\Http\Request\Request $request): bool { } } class CustomerFrontendPolicy extends \FluentCart\App\Http\Policies\Policy { public function verifyRequest(\FluentCart\Framework\Http\Request\Request $request): bool { } } class CustomerPolicy extends \FluentCart\App\Http\Policies\Policy { public function verifyRequest(\FluentCart\Framework\Http\Request\Request $request): bool { } } class DashboardPolicy extends \FluentCart\App\Http\Policies\Policy { public function verifyRequest(\FluentCart\Framework\Http\Request\Request $request): bool { } } class IntegrationPolicy extends \FluentCart\App\Http\Policies\Policy { public function verifyRequest(\FluentCart\Framework\Http\Request\Request $request) { } public function index(\FluentCart\Framework\Http\Request\Request $request) { } public function store(\FluentCart\Framework\Http\Request\Request $request) { } public function update(\FluentCart\Framework\Http\Request\Request $request) { } public function delete(\FluentCart\Framework\Http\Request\Request $request) { } } class LabelPolicy extends \FluentCart\App\Http\Policies\Policy { public function verifyRequest(\FluentCart\Framework\Http\Request\Request $request): bool { } } class OrderPolicy extends \FluentCart\App\Http\Policies\Policy { public function verifyRequest(\FluentCart\Framework\Http\Request\Request $request) { } } class ProductPolicy extends \FluentCart\App\Http\Policies\Policy { public function verifyRequest(\FluentCart\Framework\Http\Request\Request $request): bool { } } class PublicPolicy extends \FluentCart\Framework\Foundation\Policy { /** * Check user permission for any method * @param \FluentCart\Framework\Http\Request\Request $request * @return Boolean */ public function verifyRequest(\FluentCart\Framework\Http\Request\Request $request) { } /** * Check user permission for any method * @param \FluentCart\Framework\Http\Request\Request $request * @return Boolean */ public function create(\FluentCart\Framework\Http\Request\Request $request) { } } class ReportPolicy extends \FluentCart\App\Http\Policies\Policy { public function verifyRequest(\FluentCart\Framework\Http\Request\Request $request): bool { } } class StoreSensitivePolicy extends \FluentCart\App\Http\Policies\Policy { public function verifyRequest(\FluentCart\Framework\Http\Request\Request $request) { } } class StoreSettingsPolicy extends \FluentCart\App\Http\Policies\Policy { public function verifyRequest(\FluentCart\Framework\Http\Request\Request $request) { } } class UserPolicy extends \FluentCart\App\Http\Policies\Policy { public function verifyRequest(\FluentCart\Framework\Http\Request\Request $request): bool { } } } namespace FluentCart\Framework\Foundation { /** * @property \FluentCart\Framework\Http\Request\Request $request */ abstract class RequestGuard { /** * The request instance. * @var \FluentCart\Framework\Http\Request\Request */ protected $request; /** * Retrive the validation rules * @return array */ public function rules() { } /** * Retrive the validation messages set by the developer * @return array */ public function messages() { } /** * Allow the developer tinker with data before the validation. * @return array */ public function beforeValidation() { } /** * Allow the developer tinker with data after the validation. * @return array */ public function afterValidation($validator) { } /** * Validate the request. * * @param array $rules Optional * @param array $messages Optional * @return array Request Data * @throws \FluentCart\Framework\Validator\ValidationException */ public function validate($rules = [], $messages = []) { } /** * Check if exceptions should be thrown. * * @return bool */ protected function shouldThrowException() { } /** * Handles validation including before and after calls * * @throws \FluentCart\Framework\Validator\ValidationException * @return void */ public static function applyValidation() { } /** * Get an input element from the request. * * @param string $key * @return mixed */ public function __get($key) { } /** * Set an input element to the request. * * @param string $key * @return mixed */ public function __set($key, $value) { } /** * Set the request instance. * * @param \FluentCart\Framework\Http\Request\Request $request */ public function setRequestInstance($request) { } /** * Handle the dynamic method calls * @param string $method * @param array $params * @return mixed */ public function __call($method, $params) { } } } namespace FluentCart\App\Http\Requests { class AttachUserRequest extends \FluentCart\Framework\Foundation\RequestGuard { /** * @return array */ public function rules(): array { } /** * @return array */ public function messages(): array { } /** * @return array */ public function sanitize(): array { } } class AttrGroupRequest extends \FluentCart\Framework\Foundation\RequestGuard { public function rules() { } public function messages() { } public function sanitize() { } } class AttrTermRequest extends \FluentCart\Framework\Foundation\RequestGuard { public function rules() { } public function messages() { } public function sanitize() { } /** * Look up the parent attribute group's type ('color' | 'image' | 'options') * so the rules() can require the matching settings field. The {group_id} * URL param is merged into the request inputs via WP_REST_Request::get_params(), * so $this->get() resolves it without touching the controller signature. * * @return string|null */ protected function getGroupType() { } } class AttrTermUpdateRequest extends \FluentCart\Framework\Foundation\RequestGuard { public function rules() { } public function messages() { } public function sanitize() { } /** * Look up the parent attribute group's type ('color' | 'image' | 'options') * from the route param {group_id} so settings can be required to match. * * @return string|null */ protected function getGroupType() { } } class BulkUpdateVariantRequest extends \FluentCart\Framework\Foundation\RequestGuard { /** * Hard cap on the number of variant rows a single bulk-update call may * modify. Matches AdvancedVariationService::DEFAULT_MAX_COMBINATIONS so a * caller cannot use the bulk endpoint to write more rows than the editor * can generate in the first place. Without this, an unauthenticated-yet- * capability-holding attacker could POST a 100K-element array and burn * memory + CPU even when every row eventually fails per-row sanitization. */ const MAX_UPDATES_PER_REQUEST = 500; public function rules() { } public function messages() { } public function sanitize() { } } class CartRequest extends \FluentCart\Framework\Foundation\RequestGuard { /** * @return array */ public function rules() { } /** * * @return array */ public function messages() { } /** * * @return array */ public function sanitize() { } } class CouponRequest extends \FluentCart\Framework\Foundation\RequestGuard { /** * @return array */ public function rules(): array { } /** * @return array */ public function messages(): array { } /** * @return array */ public function sanitize(): array { } } class CreatePageRequest extends \FluentCart\Framework\Foundation\RequestGuard { public function rules(): array { } public function messages(): array { } } class CustomerAddressRequest extends \FluentCart\Framework\Foundation\RequestGuard { public function beforeValidation() { } /** * @return array */ public function rules() { } /** * @return array */ public function messages() { } /** * @return array */ public function sanitize() { } } class CustomerRequest extends \FluentCart\Framework\Foundation\RequestGuard { public function beforeValidation() { } /** * @return array */ public function rules() { } /** * @return array */ public function messages() { } /** * @return array */ public function sanitize() { } } class EmailNotificationRequest extends \FluentCart\Framework\Foundation\RequestGuard { /** * @return array */ public function rules() { } /** * @return array */ public function messages() { } /** * @return array */ public function sanitize() { } } class EmailSettingsRequest extends \FluentCart\Framework\Foundation\RequestGuard { public function rules(): array { } public function messages(): array { } public function sanitize(): array { } } class ExampleRequest extends \FluentCart\Framework\Foundation\RequestGuard { /** * @return array */ public function rules() { } /** * @return array */ public function messages() { } /** * @return array */ public function sanitize() { } } class FluentMetaRequest extends \FluentCart\Framework\Foundation\RequestGuard { /** * @return array */ public function rules() { } /** * @return array */ public function messages(): array { } /** * @return array */ public function sanitize(): array { } } } namespace FluentCart\App\Http\Requests\FrontendRequests { class CouponRequest extends \FluentCart\Framework\Foundation\RequestGuard { /** * @return array */ public function rules(): array { } /** * @return array */ public function messages(): array { } /** * @return array */ public function sanitize(): array { } } class CustomerAddressRequest extends \FluentCart\Framework\Foundation\RequestGuard { /** * @return array */ public function rules() { } /** * @return array */ public function messages() { } /** * @return array */ public function sanitize() { } } } namespace FluentCart\App\Http\Requests\FrontendRequests\CustomerRequests { class CustomerProfileAccountDetailsRequest extends \FluentCart\Framework\Foundation\RequestGuard { /** * @return array */ public function rules() { } /** * @return array */ public function messages() { } /** * @return array */ public function sanitize() { } } class CustomerProfileRequest extends \FluentCart\Framework\Foundation\RequestGuard { public function beforeValidation() { } /** * @return array */ public function rules() { } /** * @return array */ public function messages() { } /** * @return array */ public function sanitize() { } } } namespace FluentCart\App\Http\Requests { class GroupBulkUpdateVariantRequest extends \FluentCart\Framework\Foundation\RequestGuard { const MAX_VARIANTS_PER_REQUEST = 500; public function rules() { } public function messages() { } public function sanitize() { } } class LabelRequest extends \FluentCart\Framework\Foundation\RequestGuard { /** * @return array */ public function rules() { } /** * @return array */ public function messages() { } /** * @return array */ public function sanitize() { } } class OrderRequest extends \FluentCart\Framework\Foundation\RequestGuard { /** * @return array */ public function rules(): array { } /** * @return array */ public function messages(): array { } /** * @return array */ public function sanitize() { } } class ProductCreateRequest extends \FluentCart\Framework\Foundation\RequestGuard { /** * Prepare and normalize the incoming data before validation. * * This method ensures that each variant in the request payload has the necessary structure * expected for processing, particularly focusing on the `other_info` attribute. * * If `other_info` is missing from a variant (common during data migration scenarios), * this method sets default values to prevent validation or processing errors. * * It also ensures that: * - `fulfillment_type` is consistently applied across all variants, defaulting to 'physical'. * - `payment_type` is set (defaulting to 'onetime') and injected into `other_info`. * - `other_info` is populated with a consistent structure containing default billing and setup fee options. * * @return array The normalized request data ready for validation. */ /** * @return array */ public function rules(): array { } /** * @return array */ public function messages(): array { } /** * @return array */ public function sanitize(): array { } } } namespace FluentCart\App\Http\Requests\ProductDownloadable { class ProductDownloadableBulkFileRequest extends \FluentCart\Framework\Foundation\RequestGuard { /** * @return array */ public function rules(): array { } /** * @return array */ public function messages(): array { } /** * @return array */ public function sanitize() { } } class ProductDownloadableFileRequest extends \FluentCart\Framework\Foundation\RequestGuard { /** * @return array */ public function rules() { } /** * @return array */ public function messages(): array { } /** * @return array */ public function sanitize() { } } } namespace FluentCart\App\Http\Requests { class ProductRequest extends \FluentCart\Framework\Foundation\RequestGuard { /** * Prepare and normalize the incoming data before validation. * * This method ensures that each variant in the request payload has the necessary structure * expected for processing, particularly focusing on the `other_info` attribute. * * If `other_info` is missing from a variant (common during data migration scenarios), * this method sets default values to prevent validation or processing errors. * * It also ensures that: * - `fulfillment_type` is consistently applied across all variants, defaulting to 'physical'. * - `payment_type` is set (defaulting to 'onetime') and injected into `other_info`. * - `other_info` is populated with a consistent structure containing default billing and setup fee options. * * @return array The normalized request data ready for validation. */ public function beforeValidation() { } function validateShippingClassId($attribute, $value): ?string { } function validateTaxClassId($attribute, $value): ?string { } function validateTaxClassSlug($attribute, $value): ?string { } public function validatePostDate($attribute, $value): ?string { } /** * @return array */ public function rules(): array { } public function afterValidation($validator): array { } /** * @return array */ public function messages(): array { } /** * @return array */ public function sanitize(): array { } } class ProductUpdateRequest extends \FluentCart\Framework\Foundation\RequestGuard { /** * Prepare and normalize the incoming data before validation. * * This method ensures that each variant in the request payload has the necessary structure * expected for processing, particularly focusing on the `other_info` attribute. * * If `other_info` is missing from a variant (common during data migration scenarios), * this method sets default values to prevent validation or processing errors. * * It also ensures that: * - `fulfillment_type` is consistently applied across all variants, defaulting to 'physical'. * - `payment_type` is set (defaulting to 'onetime') and injected into `other_info`. * - `other_info` is populated with a consistent structure containing default billing and setup fee options. * * @return array The normalized request data ready for validation. */ public function beforeValidation() { } function validateShippingClassId($attribute, $value): ?string { } function validateTaxClassId($attribute, $value): ?string { } function validateTaxClassSlug($attribute, $value): ?string { } public function validatePostDate($attribute, $value): ?string { } /** * @return array */ public function rules(): array { } public function afterValidation($validator): array { } /** * @return array */ public function messages(): array { } /** * @return array */ public function sanitize(): array { } /** * Only return sanitizers for fields that actually exist in the request * * @return array */ private function getSanitizersForExistingFields(): array { } } class ProductVariationRequest extends \FluentCart\Framework\Foundation\RequestGuard { /** * Normalize variant data before validation. * * This method is primarily used to ensure that the `variants` array contains * the required structure, especially during data migration or when * optional fields like `other_info` are not provided. * * Key operations: * - Sets a default `fulfillment_type` (fallback to 'physical') if missing. * - Sets a default `payment_type` (fallback to 'onetime') if missing. * - Ensures `other_info` exists and assigns default billing/setup fee-related values if it's empty. * * This helps avoid issues during validation or processing by guaranteeing a consistent data structure. * * @return array The normalized data ready for validation. */ public function beforeValidation() { } /** * @return array */ public function rules() { } public function afterValidation($validator): array { } /** * @return array */ public function messages() { } /** * @return array */ public function sanitize() { } } class SchedulingSettingsRequest extends \FluentCart\Framework\Foundation\RequestGuard { public function beforeValidation(): array { } public function rules(): array { } public function messages(): array { } public function sanitize(): array { } } class ShopRequest extends \FluentCart\Framework\Foundation\RequestGuard { /** * @return array */ public function rules() { } /** * @return array */ public function messages() { } /** * @return array */ public function sanitize() { } } class SubscriptionRequest extends \FluentCart\Framework\Foundation\RequestGuard { /** * @return array */ public function rules() { } /** * @return array */ public function messages() { } /** * @return array */ public function sanitize() { } } class TaxClassRequest extends \FluentCart\Framework\Foundation\RequestGuard { public function rules() { } public function messages() { } public function sanitize() { } } class TaxCountryStatusRequest extends \FluentCart\Framework\Foundation\RequestGuard { public function rules(): array { } public function sanitize(): array { } } class TaxRateRequest extends \FluentCart\Framework\Foundation\RequestGuard { public function rules() { } public function sanitize() { } } class UpdateSubscriptionRequest extends \FluentCart\Framework\Foundation\RequestGuard { public function beforeValidation() { } public function rules() { } public function messages() { } public function sanitize() { } } class UpgradePathSettingRequest extends \FluentCart\Framework\Foundation\RequestGuard { public function rules(): array { } /** * * @return array */ public function messages() { } /** * * @return array */ public function sanitize() { } } class UserRequest extends \FluentCart\Framework\Foundation\RequestGuard { /** * @return array */ public function rules() { } /** * @return array */ public function messages() { } /** * @return array */ public function sanitize() { } } } namespace FluentCart\App\Http\Routes { class WebRoutes { public static function register() { } public static function renderModalCheckout() { } public static function registerRoutes() { } private static function handleMainRoutes($page): bool { } private static function handleModalCheckout(): bool { } private static function handlePrintRoute($method): bool { } } } namespace FluentCart\App\Http\Rules { class MaxLengthRule { public function __invoke($attr, $value, $rules, $data, ...$params) { } } class MaxPostCodeRule { public function __invoke($attr, $value, $rules, $data, ...$params) { } } class SanitizeText { public function __invoke($attr, $value, $rules, $data, ...$params) { } } class SanitizeTextArea { public function __invoke($attr, $value, $rules, $data, ...$params) { } } } namespace FluentCart\App\Listeners { class Activity { public static function handle($event) { } protected static function guessActivityTitle($event): string { } } } namespace FluentCart\App\Listeners\FirstTimePluginActivation { class CreatePages { public static function handle(\FluentCart\App\Events\FirstTimePluginActivation $event) { } public static function createPages() { } } class ManagePayments { public static function handle(\FluentCart\App\Events\FirstTimePluginActivation $event) { } } class SetupStore { public static function handle(\FluentCart\App\Events\FirstTimePluginActivation $event) { } } } namespace FluentCart\App\Listeners { class IntegrationEventListener { protected $pushedIntegrationsCache = []; public function registerHooks() { } public function mapAllIntegrationActions($data, $hook) { } public function initOrderAsyncRunner($actionId) { } public function addJsToReceipt($data) { } public function runOrderActionsAjax() { } private function formatIntegrationFeed($feed, $hook, $addOns = null, $scope = 'product', $orderId = null) { } } } namespace FluentCart\App\Listeners\Order { class OrderBulkAction { public static function handle(\FluentCart\App\Events\Order\OrderBulkAction $event) { } } class OrderCreated { public static function handle(\FluentCart\App\Events\Order\OrderCreated $event) { } } class OrderDeleted { public static function handle(\FluentCart\App\Events\Order\OrderDeleted $event) { } } class OrderDeleting { public static function handle(\FluentCart\App\Events\Order\OrderDeleting $event) { } protected static function shouldRestoreStockOnOrderDelete(\FluentCart\App\Events\Order\OrderDeleting $event): bool { } protected static function buildDeleteRestoreMap($orders, $stockMetaByOrderId): array { } protected static function buildDeleteRestoreVariantUpdate($variation, int $restoreQty): array { } protected static function appendBundleChildRestoreUpdates(array &$updatedVariants, array &$affectedProductIds, $variation, int $restoreQty): void { } protected static function updateProductAvailabilityFromVariationStock(array $affectedProductIds): void { } } class OrderPaid { public static function handle(\FluentCart\App\Events\Order\OrderPaid $event) { } public static function maybeCreateUser(\FluentCart\App\Models\Order $order) { } } class OrderPaymentFailed { public static function handle(\FluentCart\App\Events\Order\OrderPaymentFailed $event) { } } class OrderRefunded { public static function handle(\FluentCart\App\Events\Order\OrderRefund $event) { } } class OrderUpdated { public static function handle(\FluentCart\App\Events\Order\OrderUpdated $event) { } public static function updateTransaction($oldOrder, $newOrder) { } } class RenewalOrderDeleted { public static function handle(\FluentCart\App\Events\Order\RenewalOrderDeleted $event) { } } } namespace FluentCart\App\Listeners\Subscription { class SubscriptionRenewed { public static function handle(\FluentCart\App\Events\Subscription\SubscriptionRenewed $event) { } } } namespace FluentCart\App\Listeners { class UpdateDefaultVariation { /** * @param $event \FluentCart\App\Events\ProductVariationsChanged */ public static function handle($event) { } /** * Set each product's default_variation_id to the FIRST variant by * serial_index — the first combination in the merchant's order. Always * recomputed on a variant-set change (generate / reorder / add / update / * remove), overriding any prior value including a manual pick. Intentionally * ignores stock_status and item_status: the default is purely the first * combination by order, in stock or not, active or not. null only when the * product has no variants. */ public static function updateForProducts(array $postIds) { } } class UpdateStock { /** * @param $event OrderUpdatedEvent | OrderCreatedEvent | OrderDeletedEvent */ public static function handle($event) { } private static function shouldSkipManageStock($variation): bool { } private static function prepareProductVariantsArray($item, $action, $status) { } } } namespace FluentCart\Framework\Support { interface CanBeEscapedWhenCastToString { /** * Indicate that the object's string representation should be escaped when __toString is invoked. * * @param bool $escape * @return $this */ public function escapeWhenCastingToString($escape = true); } interface JsonableInterface { /** * Convert the object to its JSON representation. * * @param int $options * @return string */ public function toJson($options = 0); } interface UrlRoutable { /** * Get the value of the model's route key. * * @return mixed */ public function getRouteKey(); /** * Get the route key for the model. * * @return string */ public function getRouteKeyName(); /** * Retrieve the model for a bound value. * * @param mixed $value * @param string|null $field * @return \FluentCart\Framework\Database\Orm\Model|null */ public function resolveRouteBinding($value, $field = null); } trait HelperFunctionsTrait { /** * Get the class base name * * @param mixed $class * @return string */ public static function classBasename($class) { } /** * Retrive all traits used by a class, including traits used by all of its parent classes. * @param string|object $class * @return array */ public static function classUsesRecursive($class) { } /** * Retrieve all traits used by a trait * @param string $trait * @return array */ public static function traitUsesRecursive($trait) { } } } namespace FluentCart\Framework\Database\Orm\Concerns { trait HasAttributes { /** * The model's attributes. * * @var array */ protected $attributes = []; /** * The model attribute's original state. * * @var array */ protected $original = []; /** * The changed model attributes. * * @var array */ protected $changes = []; /** * The attributes that should be cast. * * @var array */ protected $casts = []; /** * The attributes that have been cast using custom classes. * * @var array */ protected $classCastCache = []; /** * The attributes that have been cast using "Attribute" return type mutators. * * @var array */ protected $attributeCastCache = []; /** * The built-in, primitive cast types supported by Orm. * * @var string[] */ protected static $primitiveCastTypes = ['array', 'bool', 'boolean', 'collection', 'custom_datetime', 'date', 'datetime', 'decimal', 'double', 'encrypted', 'encrypted:array', 'encrypted:collection', 'encrypted:json', 'encrypted:object', 'float', 'immutable_date', 'immutable_datetime', 'immutable_custom_datetime', 'int', 'integer', 'json', 'object', 'real', 'string', 'timestamp']; /** * The attributes that should be mutated to dates. * * @deprecated Use the "casts" property * * @var array */ protected $dates = []; /** * The storage format of the model's date columns. * * @var string */ protected $dateFormat; /** * The accessors to append to the model's array form. * * @var array */ protected $appends = []; /** * Indicates whether attributes are snake cased on arrays. * * @var bool */ public static $snakeAttributes = true; /** * The cache of the mutated attributes for each class. * * @var array */ protected static $mutatorCache = []; /** * The cache of the "Attribute" return type marked mutated attributes for each class. * * @var array */ protected static $attributeMutatorCache = []; /** * The cache of the "Attribute" return type marked mutated, gettable attributes for each class. * * @var array */ protected static $getAttributeMutatorCache = []; /** * The cache of the "Attribute" return type marked mutated, settable attributes for each class. * * @var array */ protected static $setAttributeMutatorCache = []; /** * The encrypter instance that is used to encrypt attributes. * * @var \FluentCart\Framework\Encryption\Encrypter */ public static $encrypter; /** * Convert the model's attributes to an array. * * @return array */ public function attributesToArray() { } /** * Add the date attributes to the attributes array. * * @param array $attributes * @return array */ protected function addDateAttributesToArray(array $attributes) { } /** * Add the mutated attributes to the attributes array. * * @param array $attributes * @param array $mutatedAttributes * @return array */ protected function addMutatedAttributesToArray(array $attributes, array $mutatedAttributes) { } /** * Add the casted attributes to the attributes array. * * @param array $attributes * @param array $mutatedAttributes * @return array */ protected function addCastAttributesToArray(array $attributes, array $mutatedAttributes) { } /** * Get an attribute array of all arrayable attributes. * * @return array */ protected function getArrayableAttributes() { } /** * Get all of the appendable values that are arrayable. * * @return array */ protected function getArrayableAppends() { } /** * Get the model's relationships in array form. * * @return array */ public function relationsToArray() { } /** * Get an attribute array of all arrayable relations. * * @return array */ protected function getArrayableRelations() { } /** * Get an attribute array of all arrayable values. * * @param array $values * @return array */ protected function getArrayableItems(array $values) { } /** * Determine whether an attribute exists on the model. * * @param string $key * @return bool */ public function hasAttribute($key) { } /** * Get an attribute from the model. * * @param string $key * @return mixed */ public function getAttribute($key) { } /** * Either throw a missing attribute exception or * return null depending on Orm's configuration. * * @param string $key * @return null * * @throws \FluentCart\Framework\Database\Orm\MissingAttributeException */ protected function throwMissingAttributeExceptionIfApplicable($key) { } /** * Get a plain attribute (not a relationship). * * @param string $key * @return mixed */ public function getAttributeValue($key) { } /** * Get an attribute from the $attributes array. * * @param string $key * @return mixed */ protected function getAttributeFromArray($key) { } /** * Get a relationship. * * @param string $key * @return mixed */ public function getRelationValue($key) { } /** * Determine if the given key is a relationship method on the model. * * @param string $key * @return bool */ public function isRelation($key) { } /** * Handle a lazy loading violation. * * @param string $key * @return mixed */ protected function handleLazyLoadingViolation($key) { } /** * Get a relationship value from a method. * * @param string $method * @return mixed * * @throws \LogicException */ protected function getRelationshipFromMethod($method) { } /** * Determine if a get mutator exists for an attribute. * * @param string $key * @return bool */ public function hasGetMutator($key) { } /** * Determine if a "Attribute" return type marked mutator exists for an attribute. * * @param string $key * @return bool */ public function hasAttributeMutator($key) { } /** * Determine if a "Attribute" return type marked get mutator exists for an attribute. * * @param string $key * @return bool */ public function hasAttributeGetMutator($key) { } /** * Get the value of an attribute using its mutator. * * @param string $key * @param mixed $value * @return mixed */ protected function mutateAttribute($key, $value) { } /** * Get the value of an "Attribute" return type marked attribute using its mutator. * * @param string $key * @param mixed $value * @return mixed */ protected function mutateAttributeMarkedAttribute($key, $value) { } /** * Get the value of an attribute using its mutator for array conversion. * * @param string $key * @param mixed $value * @return mixed */ protected function mutateAttributeForArray($key, $value) { } /** * Merge new casts with existing casts on the model. * * @param array $casts * @return $this */ public function mergeCasts($casts) { } /** * Cast an attribute to a native PHP type. * * @param string $key * @param mixed $value * @return mixed */ protected function castAttribute($key, $value) { } /** * Cast the given attribute using a custom cast class. * * @param string $key * @param mixed $value * @return mixed */ protected function getClassCastableAttributeValue($key, $value) { } /** * Cast the given attribute to an enum. * * @param string $key * @param mixed $value * @return mixed */ protected function getEnumCastableAttributeValue($key, $value) { } /** * Get the type of cast for a model attribute. * * @param string $key * @return string */ protected function getCastType($key) { } /** * Increment or decrement the given attribute using the custom cast class. * * @param string $method * @param string $key * @param mixed $value * @return mixed */ protected function deviateClassCastableAttribute($method, $key, $value) { } /** * Serialize the given attribute using the custom cast class. * * @param string $key * @param mixed $value * @return mixed */ protected function serializeClassCastableAttribute($key, $value) { } /** * Determine if the cast type is a custom date time cast. * * @param string $cast * @return bool */ protected function isCustomDateTimeCast($cast) { } /** * Determine if the cast type is an immutable custom date time cast. * * @param string $cast * @return bool */ protected function isImmutableCustomDateTimeCast($cast) { } /** * Determine if the cast type is a decimal cast. * * @param string $cast * @return bool */ protected function isDecimalCast($cast) { } /** * Set a given attribute on the model. * * @param string $key * @param mixed $value * @return mixed */ public function setAttribute($key, $value) { } /** * Determine if a set mutator exists for an attribute. * * @param string $key * @return bool */ public function hasSetMutator($key) { } /** * Determine if an "Attribute" return type marked set mutator exists for an attribute. * * @param string $key * @return bool */ public function hasAttributeSetMutator($key) { } /** * Set the value of an attribute using its mutator. * * @param string $key * @param mixed $value * @return mixed */ protected function setMutatedAttributeValue($key, $value) { } /** * Set the value of a "Attribute" return type marked attribute using its mutator. * * @param string $key * @param mixed $value * @return mixed */ protected function setAttributeMarkedMutatedAttributeValue($key, $value) { } /** * Determine if the given attribute is a date or date castable. * * @param string $key * @return bool */ protected function isDateAttribute($key) { } /** * Set a given JSON attribute on the model. * * @param string $key * @param mixed $value * @return $this */ public function fillJsonAttribute($key, $value) { } /** * Set the value of a class castable attribute. * * @param string $key * @param mixed $value * @return void */ protected function setClassCastableAttribute($key, $value) { } /** * Set the value of an enum castable attribute. * * @param string $key * @param \BackedEnum $value * @return void */ protected function setEnumCastableAttribute($key, $value) { } /** * Get an array attribute with the given key and value set. * * @param string $path * @param string $key * @param mixed $value * @return $this */ protected function getArrayAttributeWithValue($path, $key, $value) { } /** * Get an array attribute or return an empty array if it is not set. * * @param string $key * @return array */ protected function getArrayAttributeByKey($key) { } /** * Cast the given attribute to JSON. * * @param string $key * @param mixed $value * @return string */ protected function castAttributeAsJson($key, $value) { } /** * Encode the given value as JSON. * * @param mixed $value * @return string */ protected function asJson($value) { } /** * Decode the given JSON back into an array or object. * * @param string $value * @param bool $asObject * @return mixed */ public function fromJson($value, $asObject = false) { } /** * Decrypt the given encrypted string. * * @param string $value * @return mixed */ public function fromEncryptedString($value) { } /** * Cast the given attribute to an encrypted string. * * @param string $key * @param mixed $value * @return string */ protected function castAttributeAsEncryptedString($key, $value) { } /** * Set the encrypter instance that will be used to encrypt attributes. * * @param \FluentCart\Framework\Encryption\Encrypter $encrypter * @return void */ public static function encryptUsing($encrypter) { } /** * Decode the given float. * * @param mixed $value * @return mixed */ public function fromFloat($value) { } /** * Return a decimal as string. * * @param float $value * @param int $decimals * @return string */ protected function asDecimal($value, $decimals) { } /** * Return a timestamp as DateTime object with time set to 00:00:00. * * @param mixed $value * @return \FluentCart\Framework\Support\DateTime; */ protected function asDate($value) { } /** * Return a timestamp as DateTime object. * * @param mixed $value * @return \FluentCart\Framework\Support\DateTime; */ protected function asDateTime($value) { } /** * Determine if the given value is a standard date format. * * @param string $value * @return bool */ protected function isStandardDateFormat($value) { } /** * Convert a DateTime to a storable string. * * @param mixed $value * @return string|null */ public function fromDateTime($value) { } /** * Return a timestamp as unix timestamp. * * @param mixed $value * @return int */ protected function asTimestamp($value) { } /** * Prepare a date for array / JSON serialization. * * @param \DateTimeInterface $date * @return string */ protected function serializeDate(\DateTimeInterface $date) { } /** * Get the attributes that should be converted to dates. * * @return array */ public function getDates() { } /** * Get the format for database stored dates. * * @return string */ public function getDateFormat() { } /** * Set the date format used by the model. * * @param string $format * @return $this */ public function setDateFormat($format) { } /** * Determine whether an attribute should be cast to a native type. * * @param string $key * @param array|string|null $types * @return bool */ public function hasCast($key, $types = null) { } /** * Get the casts array. * * @return array */ public function getCasts() { } /** * Determine whether a value is Date / DateTime castable for inbound manipulation. * * @param string $key * @return bool */ protected function isDateCastable($key) { } /** * Determine whether a value is Date / DateTime custom-castable for inbound manipulation. * * @param string $key * @return bool */ protected function isDateCastableWithCustomFormat($key) { } /** * Determine whether a value is JSON castable for inbound manipulation. * * @param string $key * @return bool */ protected function isJsonCastable($key) { } /** * Determine whether a value is an encrypted castable for inbound manipulation. * * @param string $key * @return bool */ protected function isEncryptedCastable($key) { } /** * Determine if the given key is cast using a custom class. * * @param string $key * @return bool * * @throws \FluentCart\Framework\Database\Orm\InvalidCastException */ protected function isClassCastable($key) { } /** * Determine if the given key is cast using an enum. * * @param string $key * @return bool */ protected function isEnumCastable($key) { } /** * Determine if the key is deviable using a custom class. * * @param string $key * @return bool * * @throws \FluentCart\Framework\Database\Orm\InvalidCastException */ protected function isClassDeviable($key) { } /** * Determine if the key is serializable using a custom class. * * @param string $key * @return bool * * @throws \FluentCart\Framework\Database\Orm\InvalidCastException */ protected function isClassSerializable($key) { } /** * Resolve the custom caster class for a given key. * * @param string $key * @return mixed */ protected function resolveCasterClass($key) { } /** * Parse the given caster class, removing any arguments. * * @param string $class * @return string */ protected function parseCasterClass($class) { } /** * Merge the cast class and attribute cast attributes back into the model. * * @return void */ protected function mergeAttributesFromCachedCasts() { } /** * Merge the cast class attributes back into the model. * * @return void */ protected function mergeAttributesFromClassCasts() { } /** * Merge the cast class attributes back into the model. * * @return void */ protected function mergeAttributesFromAttributeCasts() { } /** * Normalize the response from a custom class caster. * * @param string $key * @param mixed $value * @return array */ protected function normalizeCastClassResponse($key, $value) { } /** * Get all of the current attributes on the model. * * @return array */ public function getAttributes() { } /** * Get all of the current attributes on the model for an insert operation. * * @return array */ protected function getAttributesForInsert() { } /** * Set the array of model attributes. No checking is done. * * @param array $attributes * @param bool $sync * @return $this */ public function setRawAttributes(array $attributes, $sync = false) { } /** * Get the model's original attribute values. * * @param string|null $key * @param mixed $default * @return mixed|array */ public function getOriginal($key = null, $default = null) { } /** * Get the model's original attribute values. * * @param string|null $key * @param mixed $default * @return mixed|array */ protected function getOriginalWithoutRewindingModel($key = null, $default = null) { } /** * Get the model's raw original attribute values. * * @param string|null $key * @param mixed $default * @return mixed|array */ public function getRawOriginal($key = null, $default = null) { } /** * Get a subset of the model's attributes. * * @param array|mixed $attributes * @return array */ public function only($attributes) { } /** * Sync the original attributes with the current. * * @return $this */ public function syncOriginal() { } /** * Sync a single original attribute with its current value. * * @param string $attribute * @return $this */ public function syncOriginalAttribute($attribute) { } /** * Sync multiple original attribute with their current values. * * @param array|string $attributes * @return $this */ public function syncOriginalAttributes($attributes) { } /** * Sync the changed attributes. * * @return $this */ public function syncChanges() { } /** * Determine if the model or any of the given attribute(s) have been modified. * * @param array|string|null $attributes * @return bool */ public function isDirty($attributes = null) { } /** * Determine if the model or all the given attribute(s) have remained the same. * * @param array|string|null $attributes * @return bool */ public function isClean($attributes = null) { } /** * Determine if the model or any of the given attribute(s) have been modified. * * @param array|string|null $attributes * @return bool */ public function wasChanged($attributes = null) { } /** * Determine if any of the given attributes were changed. * * @param array $changes * @param array|string|null $attributes * @return bool */ protected function hasChanges($changes, $attributes = null) { } /** * Get the attributes that have been changed since the last sync. * * @return array */ public function getDirty() { } /** * Get the attributes that were changed. * * @return array */ public function getChanges() { } /** * Determine if the new and old values for a given key are equivalent. * * @param string $key * @return bool */ public function originalIsEquivalent($key) { } /** * Transform a raw model value using mutators, casts, etc. * * @param string $key * @param mixed $value * @return mixed */ protected function transformModelValue($key, $value) { } /** * Append attributes to query when building a query. * * @param array|string $attributes * @return $this */ public function append($attributes) { } /** * Set the accessors to append to model arrays. * * @param array $appends * @return $this */ public function setAppends(array $appends) { } /** * Return whether the accessor attribute has been appended. * * @param string $attribute * @return bool */ public function hasAppended($attribute) { } /** * Get the mutated attributes for a given instance. * * @return array */ public function getMutatedAttributes() { } /** * Extract and cache all the mutated attributes of a class. * * @param string $class * @return void */ public static function cacheMutatedAttributes($class) { } /** * Get all of the attribute mutator methods. * * @param mixed $class * @return array */ protected static function getMutatorMethods($class) { } /** * Get all of the "Attribute" return typed attribute mutator methods. * * @param mixed $class * @return array */ protected static function getAttributeMarkedMutatorMethods($class) { } } trait HasEvents { /** * The event map for the model. * * Allows for object-based events for native Orm events. * * @var array */ protected $dispatchesEvents = []; /** * User exposed observable events. * * These are extra user-defined events observers may subscribe to. * * @var array */ protected $observables = []; /** * Register observers with the model. * * @param object|array|string $classes * @return void * * @throws \RuntimeException */ public static function observe($classes) { } /** * Register a single observer with the model. * * @param object|string $class * @return void * * @throws \RuntimeException */ protected function registerObserver($class) { } /** * Resolve the observer's class name from an object or string. * * @param object|string $class * @return string * * @throws \InvalidArgumentException */ private function resolveObserverClassName($class) { } /** * Get the observable event names. * * @return array */ public function getObservableEvents() { } /** * Set the observable event names. * * @param array $observables * @return $this */ public function setObservableEvents(array $observables) { } /** * Add an observable event name. * * @param array|mixed $observables * @return void */ public function addObservableEvents($observables) { } /** * Remove an observable event name. * * @param array|mixed $observables * @return void */ public function removeObservableEvents($observables) { } /** * Register a model event with the dispatcher. * * @param string $event * @param \Closure|string $callback * @return void */ protected static function registerModelEvent($event, $callback) { } /** * Fire the given event for the model. * * @param string $event * @param bool $halt * @return mixed */ protected function fireModelEvent($event, $halt = true) { } /** * Fire a custom model event for the given event. * * @param string $event * @param string $method * @return mixed|null */ protected function fireCustomModelEvent($event, $method) { } /** * Filter the model event results. * * @param mixed $result * @return mixed */ protected function filterModelEventResults($result) { } /** * Register a retrieved model event with the dispatcher. * * @param \Closure|string $callback * @return void */ public static function retrieved($callback) { } /** * Register a saving model event with the dispatcher. * * @param \Closure|string $callback * @return void */ public static function saving($callback) { } /** * Register a saved model event with the dispatcher. * * @param \Closure|string $callback * @return void */ public static function saved($callback) { } /** * Register an updating model event with the dispatcher. * * @param \Closure|string $callback * @return void */ public static function updating($callback) { } /** * Register an updated model event with the dispatcher. * * @param \Closure|string $callback * @return void */ public static function updated($callback) { } /** * Register a creating model event with the dispatcher. * * @param \Closure|string $callback * @return void */ public static function creating($callback) { } /** * Register a created model event with the dispatcher. * * @param \Closure|string $callback * @return void */ public static function created($callback) { } /** * Register a replicating model event with the dispatcher. * * @param \Closure|string $callback * @return void */ public static function replicating($callback) { } /** * Register a deleting model event with the dispatcher. * * @param \Closure|string $callback * @return void */ public static function deleting($callback) { } /** * Register a deleted model event with the dispatcher. * * @param \Closure|string $callback * @return void */ public static function deleted($callback) { } /** * Remove all the event listeners for the model. * * @return void */ public static function flushEventListeners() { } /** * Get the event map for the model. * * @return array */ public function dispatchesEvents() { } /** * Get the event dispatcher instance. * * @return \FluentCart\Framework\Events\Dispatcher */ public static function getEventDispatcher() { } /** * Set the event dispatcher instance. * * @param \FluentCart\Framework\Events\Dispatcher $dispatcher * @return void */ public static function setEventDispatcher(\FluentCart\Framework\Events\DispatcherInterface $dispatcher) { } /** * Unset the event dispatcher for models. * * @return void */ public static function unsetEventDispatcher() { } /** * Execute a callback without firing any model events for any model type. * * @param callable $callback * @return mixed */ public static function withoutEvents(callable $callback) { } } trait HasGlobalScopes { /** * Register a new global scope on the model. * * @param \FluentCart\Framework\Database\Orm\Scope|\Closure|string $scope * @param \Closure|null $implementation * @return mixed * * @throws \InvalidArgumentException */ public static function addGlobalScope($scope, ?\Closure $implementation = null) { } /** * Register multiple global scopes on the model. * * @param array $scopes * @return void */ public static function addGlobalScopes(array $scopes) { } /** * Determine if a model has a global scope. * * @param \FluentCart\Framework\Database\Orm\Scope|string $scope * @return bool */ public static function hasGlobalScope($scope) { } /** * Get a global scope registered with the model. * * @param \FluentCart\Framework\Database\Orm\Scope|string $scope * @return \FluentCart\Framework\Database\Orm\Scope|\Closure|null */ public static function getGlobalScope($scope) { } /** * Set the current global scopes. * * @param array $scopes * @return void */ public static function setAllGlobalScopes($scopes) { } /** * Get the global scopes for this class instance. * * @return array */ public function getGlobalScopes() { } } trait HasRelationships { /** * The loaded relationships for the model. * * @var array */ protected $relations = []; /** * The relationships that should be touched on save. * * @var array */ protected $touches = []; /** * The many to many relationship methods. * * @var string[] */ public static $manyMethods = ['belongsToMany', 'morphToMany', 'morphedByMany']; /** * The relation resolver callbacks. * * @var array */ protected static $relationResolvers = []; /** * Get the dynamic relation resolver if defined or inherited, or return null. * * @param string $class * @param string $key * @return mixed */ public function relationResolver($class, $key) { } /** * Define a dynamic relation resolver. * * @param string $name * @param \Closure $callback * @return void */ public static function resolveRelationUsing($name, \Closure $callback) { } /** * Define a one-to-one relationship. * * @param string $related * @param string|null $foreignKey * @param string|null $localKey * @return \FluentCart\Framework\Database\Orm\Relations\HasOne */ public function hasOne($related, $foreignKey = null, $localKey = null) { } /** * Instantiate a new HasOne relationship. * * @param \FluentCart\Framework\Database\Orm\Builder $query * @param \FluentCart\Framework\Database\Orm\Model $parent * @param string $foreignKey * @param string $localKey * @return \FluentCart\Framework\Database\Orm\Relations\HasOne */ protected function newHasOne(\FluentCart\Framework\Database\Orm\Builder $query, \FluentCart\Framework\Database\Orm\Model $parent, $foreignKey, $localKey) { } /** * Define a has-one-through relationship. * * @param string $related * @param string $through * @param string|null $firstKey * @param string|null $secondKey * @param string|null $localKey * @param string|null $secondLocalKey * @return \FluentCart\Framework\Database\Orm\Relations\HasOneThrough */ public function hasOneThrough($related, $through, $firstKey = null, $secondKey = null, $localKey = null, $secondLocalKey = null) { } /** * Instantiate a new HasOneThrough relationship. * * @param \FluentCart\Framework\Database\Orm\Builder $query * @param \FluentCart\Framework\Database\Orm\Model $farParent * @param \FluentCart\Framework\Database\Orm\Model $throughParent * @param string $firstKey * @param string $secondKey * @param string $localKey * @param string $secondLocalKey * @return \FluentCart\Framework\Database\Orm\Relations\HasOneThrough */ protected function newHasOneThrough(\FluentCart\Framework\Database\Orm\Builder $query, \FluentCart\Framework\Database\Orm\Model $farParent, \FluentCart\Framework\Database\Orm\Model $throughParent, $firstKey, $secondKey, $localKey, $secondLocalKey) { } /** * Define a polymorphic one-to-one relationship. * * @param string $related * @param string $name * @param string|null $type * @param string|null $id * @param string|null $localKey * @return \FluentCart\Framework\Database\Orm\Relations\MorphOne */ public function morphOne($related, $name, $type = null, $id = null, $localKey = null) { } /** * Instantiate a new MorphOne relationship. * * @param \FluentCart\Framework\Database\Orm\Builder $query * @param \FluentCart\Framework\Database\Orm\Model $parent * @param string $type * @param string $id * @param string $localKey * @return \FluentCart\Framework\Database\Orm\Relations\MorphOne */ protected function newMorphOne(\FluentCart\Framework\Database\Orm\Builder $query, \FluentCart\Framework\Database\Orm\Model $parent, $type, $id, $localKey) { } /** * Define an inverse one-to-one or many relationship. * * @param string $related * @param string|null $foreignKey * @param string|null $ownerKey * @param string|null $relation * @return \FluentCart\Framework\Database\Orm\Relations\BelongsTo */ public function belongsTo($related, $foreignKey = null, $ownerKey = null, $relation = null) { } /** * Instantiate a new BelongsTo relationship. * * @param \FluentCart\Framework\Database\Orm\Builder $query * @param \FluentCart\Framework\Database\Orm\Model $child * @param string $foreignKey * @param string $ownerKey * @param string $relation * @return \FluentCart\Framework\Database\Orm\Relations\BelongsTo */ protected function newBelongsTo(\FluentCart\Framework\Database\Orm\Builder $query, \FluentCart\Framework\Database\Orm\Model $child, $foreignKey, $ownerKey, $relation) { } /** * Define a polymorphic, inverse one-to-one or many relationship. * * @param string|null $name * @param string|null $type * @param string|null $id * @param string|null $ownerKey * @return \FluentCart\Framework\Database\Orm\Relations\MorphTo */ public function morphTo($name = null, $type = null, $id = null, $ownerKey = null) { } /** * Define a polymorphic, inverse one-to-one or many relationship. * * @param string $name * @param string $type * @param string $id * @param string $ownerKey * @return \FluentCart\Framework\Database\Orm\Relations\MorphTo */ protected function morphEagerTo($name, $type, $id, $ownerKey) { } /** * Define a polymorphic, inverse one-to-one or many relationship. * * @param string $target * @param string $name * @param string $type * @param string $id * @param string $ownerKey * @return \FluentCart\Framework\Database\Orm\Relations\MorphTo */ protected function morphInstanceTo($target, $name, $type, $id, $ownerKey) { } /** * Instantiate a new MorphTo relationship. * * @param \FluentCart\Framework\Database\Orm\Builder $query * @param \FluentCart\Framework\Database\Orm\Model $parent * @param string $foreignKey * @param string $ownerKey * @param string $type * @param string $relation * @return \FluentCart\Framework\Database\Orm\Relations\MorphTo */ protected function newMorphTo(\FluentCart\Framework\Database\Orm\Builder $query, \FluentCart\Framework\Database\Orm\Model $parent, $foreignKey, $ownerKey, $type, $relation) { } /** * Retrieve the actual class name for a given morph class. * * @param string $class * @return string */ public static function getActualClassNameForMorph($class) { } /** * Guess the "belongs to" relationship name. * * @return string */ protected function guessBelongsToRelation() { } /** * Create a pending has-many-through or has-one-through relationship. * * @template TIntermediateModel of \FluentCart\Framework\Database\Orm\Model * * @param string|\FluentCart\Framework\Database\Orm\Relations\HasMany|\FluentCart\Framework\Database\Orm\Relations\HasOne $relationship * @return ( * $relationship is string * ? \FluentCart\Framework\Database\Orm\PendingHasThroughRelationship<\FluentCart\Framework\Database\Orm\Model, $this> * : \FluentCart\Framework\Database\Orm\PendingHasThroughRelationship * ) */ public function through($relationship) { } /** * Define a one-to-many relationship. * * @param string $related * @param string|null $foreignKey * @param string|null $localKey * @return \FluentCart\Framework\Database\Orm\Relations\HasMany */ public function hasMany($related, $foreignKey = null, $localKey = null) { } /** * Instantiate a new HasMany relationship. * * @param \FluentCart\Framework\Database\Orm\Builder $query * @param \FluentCart\Framework\Database\Orm\Model $parent * @param string $foreignKey * @param string $localKey * @return \FluentCart\Framework\Database\Orm\Relations\HasMany */ protected function newHasMany(\FluentCart\Framework\Database\Orm\Builder $query, \FluentCart\Framework\Database\Orm\Model $parent, $foreignKey, $localKey) { } /** * Define a has-many-through relationship. * * @param string $related * @param string $through * @param string|null $firstKey * @param string|null $secondKey * @param string|null $localKey * @param string|null $secondLocalKey * @return \FluentCart\Framework\Database\Orm\Relations\HasManyThrough */ public function hasManyThrough($related, $through, $firstKey = null, $secondKey = null, $localKey = null, $secondLocalKey = null) { } /** * Instantiate a new HasManyThrough relationship. * * @param \FluentCart\Framework\Database\Orm\Builder $query * @param \FluentCart\Framework\Database\Orm\Model $farParent * @param \FluentCart\Framework\Database\Orm\Model $throughParent * @param string $firstKey * @param string $secondKey * @param string $localKey * @param string $secondLocalKey * @return \FluentCart\Framework\Database\Orm\Relations\HasManyThrough */ protected function newHasManyThrough(\FluentCart\Framework\Database\Orm\Builder $query, \FluentCart\Framework\Database\Orm\Model $farParent, \FluentCart\Framework\Database\Orm\Model $throughParent, $firstKey, $secondKey, $localKey, $secondLocalKey) { } /** * Define a polymorphic one-to-many relationship. * * @param string $related * @param string $name * @param string|null $type * @param string|null $id * @param string|null $localKey * @return \FluentCart\Framework\Database\Orm\Relations\MorphMany */ public function morphMany($related, $name, $type = null, $id = null, $localKey = null) { } /** * Instantiate a new MorphMany relationship. * * @param \FluentCart\Framework\Database\Orm\Builder $query * @param \FluentCart\Framework\Database\Orm\Model $parent * @param string $type * @param string $id * @param string $localKey * @return \FluentCart\Framework\Database\Orm\Relations\MorphMany */ protected function newMorphMany(\FluentCart\Framework\Database\Orm\Builder $query, \FluentCart\Framework\Database\Orm\Model $parent, $type, $id, $localKey) { } /** * Define a many-to-many relationship. * * @param string $related * @param string|null $table * @param string|null $foreignPivotKey * @param string|null $relatedPivotKey * @param string|null $parentKey * @param string|null $relatedKey * @param string|null $relation * @return \FluentCart\Framework\Database\Orm\Relations\BelongsToMany */ public function belongsToMany($related, $table = null, $foreignPivotKey = null, $relatedPivotKey = null, $parentKey = null, $relatedKey = null, $relation = null) { } /** * Instantiate a new BelongsToMany relationship. * * @param \FluentCart\Framework\Database\Orm\Builder $query * @param \FluentCart\Framework\Database\Orm\Model $parent * @param string $table * @param string $foreignPivotKey * @param string $relatedPivotKey * @param string $parentKey * @param string $relatedKey * @param string|null $relationName * @return \FluentCart\Framework\Database\Orm\Relations\BelongsToMany */ protected function newBelongsToMany(\FluentCart\Framework\Database\Orm\Builder $query, \FluentCart\Framework\Database\Orm\Model $parent, $table, $foreignPivotKey, $relatedPivotKey, $parentKey, $relatedKey, $relationName = null) { } /** * Define a polymorphic many-to-many relationship. * * @template TRelatedModel of \FluentCart\Framework\Database\Orm\Model * * @param class-string $related * @param string $name * @param string|null $table * @param string|null $foreignPivotKey * @param string|null $relatedPivotKey * @param string|null $parentKey * @param string|null $relatedKey * @param string|null $relation * @param bool $inverse * * @return \FluentCart\Framework\Database\Orm\Relations\MorphToMany */ public function morphToMany($related, $name, $table = null, $foreignPivotKey = null, $relatedPivotKey = null, $parentKey = null, $relatedKey = null, $relation = null, $inverse = false) { } /** * Instantiate a new MorphToMany relationship. * * @param \FluentCart\Framework\Database\Orm\Builder $query * @param \FluentCart\Framework\Database\Orm\Model $parent * @param string $name * @param string $table * @param string $foreignPivotKey * @param string $relatedPivotKey * @param string $parentKey * @param string $relatedKey * @param string|null $relationName * @param bool $inverse * @return \FluentCart\Framework\Database\Orm\Relations\MorphToMany */ protected function newMorphToMany(\FluentCart\Framework\Database\Orm\Builder $query, \FluentCart\Framework\Database\Orm\Model $parent, $name, $table, $foreignPivotKey, $relatedPivotKey, $parentKey, $relatedKey, $relationName = null, $inverse = false) { } /** * Define a polymorphic, inverse many-to-many relationship. * * @template TRelatedModel of \FluentCart\Framework\Database\Orm\Model * * @param class-string $related * @param string $name * @param string|null $table * @param string|null $foreignPivotKey * @param string|null $relatedPivotKey * @param string|null $parentKey * @param string|null $relatedKey * @param string|null $relation * * @return \FluentCart\Framework\Database\Orm\Relations\MorphToMany */ public function morphedByMany($related, $name, $table = null, $foreignPivotKey = null, $relatedPivotKey = null, $parentKey = null, $relatedKey = null, $relation = null) { } /** * Get the relationship name of the belongsToMany relationship. * * @return string|null */ protected function guessBelongsToManyRelation() { } /** * Get the joining table name for a many-to-many relation. * * @param string $related * @param \FluentCart\Framework\Database\Orm\Model|null $instance * @return string */ public function joiningTable($related, $instance = null) { } /** * Get this model's half of the intermediate table name for belongsToMany relationships. * * @return string */ public function joiningTableSegment() { } /** * Determine if the model touches a given relation. * * @param string $relation * @return bool */ public function touches($relation) { } /** * Touch the owning relations of the model. * * @return void */ public function touchOwners() { } /** * Get the polymorphic relationship columns. * * @param string $name * @param string $type * @param string $id * @return array */ protected function getMorphs($name, $type, $id) { } /** * Get the class name for polymorphic relations. * * @return string */ public function getMorphClass() { } /** * Create a new model instance for a related model. * * @param string $class * @return mixed */ protected function newRelatedInstance($class) { } /** * Create a new model instance for a related "through" model. * * @param string $class * @return mixed */ protected function newRelatedThroughInstance($class) { } /** * Get all the loaded relations for the instance. * * @return array */ public function getRelations() { } /** * Get a specified relationship. * * @param string $relation * @return mixed */ public function getRelation($relation) { } /** * Determine if the given relation is loaded. * * @param string $key * @return bool */ public function relationLoaded($key) { } /** * Set the given relationship on the model. * * @param string $relation * @param mixed $value * @return $this */ public function setRelation($relation, $value) { } /** * Unset a loaded relationship. * * @param string $relation * @return $this */ public function unsetRelation($relation) { } /** * Set the entire relations array on the model. * * @param array $relations * @return $this */ public function setRelations(array $relations) { } /** * Duplicate the instance and unset all the loaded relations. * * @return $this */ public function withoutRelations() { } /** * Unset all the loaded relations for the instance. * * @return $this */ public function unsetRelations() { } /** * Get the relationships that are touched on save. * * @return array */ public function getTouchedRelations() { } /** * Set the relationships that are touched on save. * * @param array $touches * @return $this */ public function setTouchedRelations(array $touches) { } } trait HasTimestamps { /** * Indicates if the model should be timestamped. * * @var bool */ public $timestamps = true; /** * The list of models classes that have timestamps temporarily disabled. * * @var array */ protected static $ignoreTimestampsOn = []; /** * Update the model's update timestamp. * * @param string|null $attribute * @return bool */ public function touch($attribute = null) { } /** * Update the model's update timestamp without raising any events. * * @param string|null $attribute * @return bool */ public function touchQuietly($attribute = null) { } /** * Update the creation and update timestamps. * * @return void */ public function updateTimestamps() { } /** * Set the value of the "created at" attribute. * * @param mixed $value * @return $this */ public function setCreatedAt($value) { } /** * Set the value of the "updated at" attribute. * * @param mixed $value * @return $this */ public function setUpdatedAt($value) { } /** * Get a fresh timestamp for the model. * * @see https://developer.wordpress.org/reference/functions/current_time/ */ public function freshTimestamp() { } /** * Get a fresh timestamp for the model. * * @return string */ public function freshTimestampString() { } /** * Determine if the model uses timestamps. * * @return bool */ public function usesTimestamps() { } /** * Get the name of the "created at" column. * * @return string|null */ public function getCreatedAtColumn() { } /** * Get the name of the "updated at" column. * * @return string|null */ public function getUpdatedAtColumn() { } /** * Get the fully qualified "created at" column. * * @return string|null */ public function getQualifiedCreatedAtColumn() { } /** * Get the fully qualified "updated at" column. * * @return string|null */ public function getQualifiedUpdatedAtColumn() { } /** * Disable timestamps for the current class during the given callback scope. * * @param callable $callback * @return mixed */ public static function withoutTimestamps(callable $callback) { } /** * Disable timestamps for the given model classes during the given callback scope. * * @param array $models * @param callable $callback * @return mixed */ public static function withoutTimestampsOn($models, $callback) { } /** * Determine if the given model is ignoring timestamps / touches. * * @param string|null $class * @return bool */ public static function isIgnoringTimestamps($class = null) { } } trait HasUniqueIds { /** * Indicates if the model uses unique ids. * * @var bool */ public $usesUniqueIds = false; /** * Determine if the model uses unique ids. * * @return bool */ public function usesUniqueIds() { } /** * Generate unique keys for the model. * * @return void */ public function setUniqueIds() { } /** * Generate a new key for the model. * * @return string */ public function newUniqueId() { } /** * Get the columns that should receive a unique identifier. * * @return array */ public function uniqueIds() { } } trait HidesAttributes { /** * The attributes that should be hidden for serialization. * * @var array */ protected $hidden = []; /** * The attributes that should be visible in serialization. * * @var array */ protected $visible = []; /** * Get the hidden attributes for the model. * * @return array */ public function getHidden() { } /** * Set the hidden attributes for the model. * * @param array $hidden * @return $this */ public function setHidden(array $hidden) { } /** * Get the visible attributes for the model. * * @return array */ public function getVisible() { } /** * Set the visible attributes for the model. * * @param array $visible * @return $this */ public function setVisible(array $visible) { } /** * Make the given, typically hidden, attributes visible. * * @param array|string|null $attributes * @return $this */ public function makeVisible($attributes) { } /** * Make the given, typically hidden, attributes visible if the given truth test passes. * * @param bool|\Closure $condition * @param array|string|null $attributes * @return $this */ public function makeVisibleIf($condition, $attributes) { } /** * Make the given, typically visible, attributes hidden. * * @param array|string|null $attributes * @return $this */ public function makeHidden($attributes) { } /** * Make the given, typically visible, attributes hidden if the given truth test passes. * * @param bool|\Closure $condition * @param array|string|null $attributes * @return $this */ public function makeHiddenIf($condition, $attributes) { } } trait GuardsAttributes { /** * The attributes that are mass assignable. * * @var string[] */ protected $fillable = []; /** * The attributes that aren't mass assignable. * * @var string[]|bool */ protected $guarded = ['*']; /** * Indicates if all mass assignment is enabled. * * @var bool */ protected static $unguarded = false; /** * The actual columns that exist on the database and can be guarded. * * @var array */ protected static $guardableColumns = []; /** * Get the fillable attributes for the model. * * @return array */ public function getFillable() { } /** * Set the fillable attributes for the model. * * @param array $fillable * @return $this */ public function fillable(array $fillable) { } /** * Merge new fillable attributes with existing fillable attributes on the model. * * @param array $fillable * @return $this */ public function mergeFillable(array $fillable) { } /** * Get the guarded attributes for the model. * * @return array */ public function getGuarded() { } /** * Set the guarded attributes for the model. * * @param array $guarded * @return $this */ public function guard(array $guarded) { } /** * Merge new guarded attributes with existing guarded attributes on the model. * * @param array $guarded * @return $this */ public function mergeGuarded(array $guarded) { } /** * Disable all mass assignable restrictions. * * @param bool $state * @return void */ public static function unguard($state = true) { } /** * Enable the mass assignment restrictions. * * @return void */ public static function reguard() { } /** * Determine if the current state is "unguarded". * * @return bool */ public static function isUnguarded() { } /** * Run the given callable while being unguarded. * * @param callable $callback * @return mixed */ public static function unguarded(callable $callback) { } /** * Determine if the given attribute may be mass assigned. * * @param string $key * @return bool */ public function isFillable($key) { } /** * Determine if the given key is guarded. * * @param string $key * @return bool */ public function isGuarded($key) { } /** * Determine if the given column is a valid, guardable column. * * @param string $key * @return bool */ protected function isGuardableColumn($key) { } /** * Determine if the model is totally guarded. * * @return bool */ public function totallyGuarded() { } /** * Get the fillable attributes of a given array. * * @param array $attributes * @return array */ protected function fillableFromArray(array $attributes) { } } } namespace FluentCart\Framework\Support { trait ForwardsCalls { /** * Forward a method call to the given object. * * @param mixed $object * @param string $method * @param array $parameters * @return mixed * * @throws \BadMethodCallException */ protected function forwardCallTo($object, $method, $parameters) { } /** * Forward a method call to the given object, returning $this if the forwarded call returned itself. * * @param mixed $object * @param string $method * @param array $parameters * @return mixed * * @throws \BadMethodCallException */ protected function forwardDecoratedCallTo($object, $method, $parameters) { } /** * Throw a bad method call exception for the given method. * * @param string $method * @return void * * @throws \BadMethodCallException */ protected static function throwBadMethodCallException($method) { } } } namespace FluentCart\Framework\Database\Orm { abstract class Model implements \FluentCart\Framework\Support\ArrayableInterface, \ArrayAccess, \FluentCart\Framework\Support\CanBeEscapedWhenCastToString, \FluentCart\Framework\Support\JsonableInterface, \JsonSerializable, \FluentCart\Framework\Support\UrlRoutable { use \FluentCart\Framework\Support\HelperFunctionsTrait; use \FluentCart\Framework\Database\Orm\Concerns\HasAttributes, \FluentCart\Framework\Database\Orm\Concerns\HasEvents, \FluentCart\Framework\Database\Orm\Concerns\HasGlobalScopes, \FluentCart\Framework\Database\Orm\Concerns\HasRelationships, \FluentCart\Framework\Database\Orm\Concerns\HasTimestamps, \FluentCart\Framework\Database\Orm\Concerns\HasUniqueIds, \FluentCart\Framework\Database\Orm\Concerns\HidesAttributes, \FluentCart\Framework\Database\Orm\Concerns\GuardsAttributes, \FluentCart\Framework\Support\ForwardsCalls; /** * The connection name for the model. * * @var string|null */ protected $connection; /** * The table associated with the model. * * @var string */ protected $table; /** * The primary key for the model. * * @var string */ protected $primaryKey = 'id'; /** * The "type" of the primary key ID. * * @var string */ protected $keyType = 'int'; /** * Indicates if the IDs are auto-incrementing. * * @var bool */ public $incrementing = true; /** * The relations to eager load on every query. * * @var array */ protected $with = []; /** * The relationship counts that should be eager loaded on every query. * * @var array */ protected $withCount = []; /** * Indicates whether lazy loading will be prevented on this model. * * @var bool */ public $preventsLazyLoading = false; /** * The number of models to return for pagination. * * @var int */ protected $perPage = 15; /** * Indicates if the model exists. * * @var bool */ public $exists = false; /** * Indicates if the model was inserted during the current request lifecycle. * * @var bool */ public $wasRecentlyCreated = false; /** * Indicates that the object's string representation should be escaped when __toString is invoked. * * @var bool */ protected $escapeWhenCastingToString = false; /** * The connection resolver instance. * * @var \FluentCart\Framework\Database\ConnectionResolverInterface */ protected static $resolver; /** * The event dispatcher instance. * * @var \FluentCart\Framework\Events\Dispatcher */ protected static $dispatcher; /** * The array of booted models. * * @var array */ protected static $booted = []; /** * The array of trait initializers that will be called on each new instance. * * @var array */ protected static $traitInitializers = []; /** * The array of global scopes on the model. * * @var array */ protected static $globalScopes = []; /** * The list of models classes that should not be affected with touch. * * @var array */ protected static $ignoreOnTouch = []; /** * Indicates whether lazy loading should be restricted on all models. * * @var bool */ protected static $modelsShouldPreventLazyLoading = false; /** * Indicates if an exception should be thrown instead of * silently discarding non-fillable attributes. * * @var bool */ protected static $modelsShouldPreventSilentlyDiscardingAttributes = false; /** * Indicates if an exception should be thrown when trying * to access a missing attribute on a retrieved model. * * @var bool */ protected static $modelsShouldPreventAccessingMissingAttributes = false; /** * The name of the "created at" column. * * @var string|null */ const CREATED_AT = 'created_at'; /** * The name of the "updated at" column. * * @var string|null */ const UPDATED_AT = 'updated_at'; /** * Create a new Orm model instance. * * @param array $attributes * @return void */ public function __construct(array $attributes = []) { } /** * Check if the model needs to be booted and if so, do it. * * @return void */ protected function bootIfNotBooted() { } /** * Perform any actions required before the model boots. * * @return void */ protected static function booting() { } /** * Bootstrap the model and its traits. * * @return void */ protected static function boot() { } /** * Boot all of the bootable traits on the model. * * @return void */ protected static function bootTraits() { } /** * Initialize any initializable traits on the model. * * @return void */ protected function initializeTraits() { } /** * Perform any actions required after the model boots. * * @return void */ protected static function booted() { } /** * Clear the list of booted models so they will be re-booted. * * @return void */ public static function clearBootedModels() { } /** * Disables relationship model touching for the current class during given callback scope. * * @param callable $callback * @return void */ public static function withoutTouching(callable $callback) { } /** * Disables relationship model touching for the given model classes during given callback scope. * * @param array $models * @param callable $callback * @return void */ public static function withoutTouchingOn(array $models, callable $callback) { } /** * Determine if the given model is ignoring touches. * * @param string|null $class * @return bool */ public static function isIgnoringTouch($class = null) { } /** * Indicate that models should prevent lazy loading, silently discarding attributes, and accessing missing attributes. * * @param bool $shouldBeStrict * @return void */ public static function shouldBeStrict(bool $shouldBeStrict = true) { } /** * Prevent model relationships from being lazy loaded. * * @param bool $value * @return void */ public static function preventLazyLoading($value = true) { } /** * Prevent non-fillable attributes from being silently discarded. * * @param bool $value * @return void */ public static function preventSilentlyDiscardingAttributes($value = true) { } /** * Prevent accessing missing attributes on retrieved models. * * @param bool $value * @return void */ public static function preventAccessingMissingAttributes($value = true) { } /** * Fill the model with an array of attributes. * * @param array $attributes * @return $this * * @throws \FluentCart\Framework\Database\Orm\MassAssignmentException */ public function fill(array $attributes) { } /** * Fill the model with an array of attributes. Force mass assignment. * * @param array $attributes * @return $this */ public function forceFill(array $attributes) { } /** * Qualify the given column name by the model's table. * * @param string $column * @return string */ public function qualifyColumn($column) { } /** * Qualify the given columns with the model's table. * * @param array $columns * @return array */ public function qualifyColumns($columns) { } /** * Create a new instance of the given model. * * @param array $attributes * @param bool $exists * @return static */ public function newInstance($attributes = [], $exists = false) { } /** * Create a new model instance that is existing. * * @param array $attributes * @param string|null $connection * @return static */ public function newFromBuilder($attributes = [], $connection = null, $args = []) { } /** * Begin querying the model on a given connection. * * @param string|null $connection * @return \FluentCart\Framework\Database\Orm\Builder */ public static function on($connection = null) { } /** * Begin querying the model on the write connection. * * @return \FluentCart\Framework\Database\Query\Builder */ public static function onWriteConnection() { } /** * Get all of the models from the database. * * @param array|mixed $columns * @return \FluentCart\Framework\Database\Orm\Collection|static[] */ public static function all($columns = ['*']) { } /** * Begin querying a model with eager loading. * * @param array|string $relations * @return \FluentCart\Framework\Database\Orm\Builder */ public static function with($relations) { } /** * Eager load relations on the model. * * @param array|string $relations * @return $this */ public function load($relations) { } /** * Eager load relationships on the polymorphic relation of a model. * * @param string $relation * @param array $relations * @return $this */ public function loadMorph($relation, $relations) { } /** * Eager load relations on the model if they are not already eager loaded. * * @param array|string $relations * @return $this */ public function loadMissing($relations) { } /** * Eager load relation's column aggregations on the model. * * @param array|string $relations * @param string $column * @param string $function * @return $this */ public function loadAggregate($relations, $column, $function = null) { } /** * Eager load relation counts on the model. * * @param array|string $relations * @return $this */ public function loadCount($relations) { } /** * Eager load relation max column values on the model. * * @param array|string $relations * @param string $column * @return $this */ public function loadMax($relations, $column) { } /** * Eager load relation min column values on the model. * * @param array|string $relations * @param string $column * @return $this */ public function loadMin($relations, $column) { } /** * Eager load relation's column summations on the model. * * @param array|string $relations * @param string $column * @return $this */ public function loadSum($relations, $column) { } /** * Eager load relation average column values on the model. * * @param array|string $relations * @param string $column * @return $this */ public function loadAvg($relations, $column) { } /** * Eager load related model existence values on the model. * * @param array|string $relations * @return $this */ public function loadExists($relations) { } /** * Eager load relationship column aggregation on the polymorphic relation of a model. * * @param string $relation * @param array $relations * @param string $column * @param string $function * @return $this */ public function loadMorphAggregate($relation, $relations, $column, $function = null) { } /** * Eager load relationship counts on the polymorphic relation of a model. * * @param string $relation * @param array $relations * @return $this */ public function loadMorphCount($relation, $relations) { } /** * Eager load relationship max column values on the polymorphic relation of a model. * * @param string $relation * @param array $relations * @param string $column * @return $this */ public function loadMorphMax($relation, $relations, $column) { } /** * Eager load relationship min column values on the polymorphic relation of a model. * * @param string $relation * @param array $relations * @param string $column * @return $this */ public function loadMorphMin($relation, $relations, $column) { } /** * Eager load relationship column summations on the polymorphic relation of a model. * * @param string $relation * @param array $relations * @param string $column * @return $this */ public function loadMorphSum($relation, $relations, $column) { } /** * Eager load relationship average column values on the polymorphic relation of a model. * * @param string $relation * @param array $relations * @param string $column * @return $this */ public function loadMorphAvg($relation, $relations, $column) { } /** * Increment a column's value by a given amount. * * @param string $column * @param float|int $amount * @param array $extra * @return int */ protected function increment($column, $amount = 1, array $extra = []) { } /** * Decrement a column's value by a given amount. * * @param string $column * @param float|int $amount * @param array $extra * @return int */ protected function decrement($column, $amount = 1, array $extra = []) { } /** * Run the increment or decrement method on the model. * * @param string $column * @param float|int $amount * @param array $extra * @param string $method * @return int */ protected function incrementOrDecrement($column, $amount, $extra, $method) { } /** * Update the model in the database. * * @param array $attributes * @param array $options * @return bool */ public function update(array $attributes = [], array $options = []) { } /** * Update the model in the database within a transaction. * * @param array $attributes * @param array $options * @return bool * * @throws \Throwable */ public function updateOrFail(array $attributes = [], array $options = []) { } /** * Update the model in the database without raising any events. * * @param array $attributes * @param array $options * @return bool */ public function updateQuietly(array $attributes = [], array $options = []) { } /** * Save the model and all of its relationships. * * @return bool */ public function push() { } /** * Save the model to the database without raising any events. * * @param array $options * @return bool */ public function saveQuietly(array $options = []) { } /** * Save the model to the database. * * @param array $options * @return bool */ public function save(array $options = []) { } /** * Save the model to the database within a transaction. * * @param array $options * @return bool * * @throws \Throwable */ public function saveOrFail(array $options = []) { } /** * Perform any actions that are necessary after the model is saved. * * @param array $options * @return void */ protected function finishSave(array $options) { } /** * Perform a model update operation. * * @param \FluentCart\Framework\Database\Orm\Builder $query * @return bool */ protected function performUpdate(\FluentCart\Framework\Database\Orm\Builder $query) { } /** * Set the keys for a select query. * * @param \FluentCart\Framework\Database\Orm\Builder $query * @return \FluentCart\Framework\Database\Orm\Builder */ protected function setKeysForSelectQuery($query) { } /** * Get the primary key value for a select query. * * @return mixed */ protected function getKeyForSelectQuery() { } /** * Set the keys for a save update query. * * @param \FluentCart\Framework\Database\Orm\Builder $query * @return \FluentCart\Framework\Database\Orm\Builder */ protected function setKeysForSaveQuery($query) { } /** * Get the primary key value for a save query. * * @return mixed */ protected function getKeyForSaveQuery() { } /** * Perform a model insert operation. * * @param \FluentCart\Framework\Database\Orm\Builder $query * @return bool */ protected function performInsert(\FluentCart\Framework\Database\Orm\Builder $query) { } /** * Insert the given attributes and set the ID on the model. * * @param \FluentCart\Framework\Database\Orm\Builder $query * @param array $attributes * @return void */ protected function insertAndSetId(\FluentCart\Framework\Database\Orm\Builder $query, $attributes) { } /** * Destroy the models for the given IDs. * * @param \FluentCart\Framework\Support\Collection|array|int|string $ids * @return int */ public static function destroy($ids) { } /** * Delete the model from the database. * * @return bool|null * * @throws \LogicException */ public function delete() { } /** * Delete the model from the database within a transaction. * * @return bool|null * * @throws \Throwable */ public function deleteOrFail() { } /** * Force a hard delete on a soft deleted model. * * This method protects developers from running forceDelete when the trait is missing. * * @return bool|null */ public function forceDelete() { } /** * Perform the actual delete query on this model instance. * * @return void */ protected function performDeleteOnModel() { } /** * Begin querying the model. * * @return \FluentCart\Framework\Database\Orm\Builder */ public static function query() { } /** * Get a new query builder for the model's table. * * @return \FluentCart\Framework\Database\Orm\Builder */ public function newQuery() { } /** * Get a new query builder that doesn't have any global scopes or eager loading. * * @return \FluentCart\Framework\Database\Orm\Builder|static */ public function newModelQuery() { } /** * Get a new query builder with no relationships loaded. * * @return \FluentCart\Framework\Database\Orm\Builder */ public function newQueryWithoutRelationships() { } /** * Register the global scopes for this builder instance. * * @param \FluentCart\Framework\Database\Orm\Builder $builder * @return \FluentCart\Framework\Database\Orm\Builder */ public function registerGlobalScopes($builder) { } /** * Get a new query builder that doesn't have any global scopes. * * @return \FluentCart\Framework\Database\Orm\Builder|static */ public function newQueryWithoutScopes() { } /** * Get a new query instance without a given scope. * * @param \FluentCart\Framework\Database\Orm\Scope|string $scope * @return \FluentCart\Framework\Database\Orm\Builder */ public function newQueryWithoutScope($scope) { } /** * Get a new query to restore one or more models by their queueable IDs. * * @param array|int $ids * @return \FluentCart\Framework\Database\Orm\Builder */ public function newQueryForRestoration($ids) { } /** * Create a new Orm query builder for the model. * * @param \FluentCart\Framework\Database\Query\Builder $query * @return \FluentCart\Framework\Database\Orm\Builder|static */ public function newOrmBuilder($query) { } /** * Get a new query builder instance for the connection. * * @return \FluentCart\Framework\Database\Query\Builder */ protected function newBaseQueryBuilder() { } /** * Create a new Orm Collection instance. * * @param array $models * @return \FluentCart\Framework\Database\Orm\Collection */ public function newCollection(array $models = []) { } /** * Create a new pivot model instance. * * @param \FluentCart\Framework\Database\Orm\Model $parent * @param array $attributes * @param string $table * @param bool $exists * @param string|null $using * @return \FluentCart\Framework\Database\Orm\Relations\Pivot */ public function newPivot(self $parent, array $attributes, $table, $exists, $using = null) { } /** * Determine if the model has a given scope. * * @param string $scope * @return bool */ public function hasNamedScope($scope) { } /** * Apply the given named scope if possible. * * @param string $scope * @param array $parameters * @return mixed */ public function callNamedScope($scope, array $parameters = []) { } /** * Convert the model instance to an array. * * @return array */ public function toArray() { } /** * Convert the model instance to JSON. * * @param int $options * @return string * * @throws \FluentCart\Framework\Database\Orm\JsonEncodingException */ public function toJson($options = 0) { } /** * Convert the object into something JSON serializable. * * @return array */ #[\ReturnTypeWillChange] public function jsonSerialize() { } /** * Reload a fresh model instance from the database. * * @param array|string $with * @return static|null */ public function fresh($with = []) { } /** * Reload the current model instance with fresh attributes from the database. * * @return $this */ public function refresh() { } /** * Clone the model into a new, non-existing instance. * * @param array|null $except * @return static */ public function replicate(?array $except = null) { } /** * Determine if two models have the same ID and belong to the same table. * * @param \FluentCart\Framework\Database\Orm\Model|null $model * @return bool */ public function is($model) { } /** * Determine if two models are not the same. * * @param \FluentCart\Framework\Database\Orm\Model|null $model * @return bool */ public function isNot($model) { } /** * Get the database connection for the model. * * @return \FluentCart\Framework\Database\Query\WPDBConnection */ public function getConnection() { } /** * Get the current connection name for the model. * * @return string|null */ public function getConnectionName() { } /** * Set the connection associated with the model. * * @param string|null $name * @return $this */ public function setConnection($name) { } /** * Resolve a connection instance. * * @param string|null $connection * @return \FluentCart\Framework\Database\Query\WPDBConnection */ public static function resolveConnection($connection = null) { } /** * Get the connection resolver instance. * * @return \FluentCart\Framework\Database\ConnectionResolverInterface */ public static function getConnectionResolver() { } /** * Set the connection resolver instance. * * @param \FluentCart\Framework\Database\ConnectionResolverInterface $resolver * @return void */ public static function setConnectionResolver(\FluentCart\Framework\Database\ConnectionResolverInterface $resolver) { } /** * Unset the connection resolver for models. * * @return void */ public static function unsetConnectionResolver() { } /** * Get the table associated with the model. * * @return string */ public function getTable() { } /** * Set the table associated with the model. * * @param string $table * @return $this */ public function setTable($table) { } /** * Get the primary key for the model. * * @return string */ public function getKeyName() { } /** * Set the primary key for the model. * * @param string $key * @return $this */ public function setKeyName($key) { } /** * Get the table qualified key name. * * @return string */ public function getQualifiedKeyName() { } /** * Get the auto-incrementing key type. * * @return string */ public function getKeyType() { } /** * Set the data type for the primary key. * * @param string $type * @return $this */ public function setKeyType($type) { } /** * Get the value indicating whether the IDs are incrementing. * * @return bool */ public function getIncrementing() { } /** * Set whether IDs are incrementing. * * @param bool $value * @return $this */ public function setIncrementing($value) { } /** * Get the value of the model's primary key. * * @return mixed */ public function getKey() { } /** * Get the value of the model's route key. * * @return mixed */ public function getRouteKey() { } /** * Get the route key for the model. * * @return string */ public function getRouteKeyName() { } /** * Retrieve the model for a bound value. * * @param mixed $value * @param string|null $field * @return \FluentCart\Framework\Database\Orm\Model|null */ public function resolveRouteBinding($value, $field = null) { } /** * Retrieve the model for a bound value. * * @param \FluentCart\Framework\Database\Orm\Model $query * @param mixed $value * @param string|null $field * @return \FluentCart\Framework\Database\Orm\Builder */ public function resolveRouteBindingQuery($query, $value, $field = null) { } /** * Get the default foreign key name for the model. * * @return string */ public function getForeignKey() { } /** * Get the number of models to return per page. * * @return int */ public function getPerPage() { } /** * Set the number of models to return per page. * * @param int $perPage * @return $this */ public function setPerPage($perPage) { } /** * Determine if lazy loading is disabled. * * @return bool */ public static function preventsLazyLoading() { } /** * Determine if discarding guarded attribute fills is disabled. * * @return bool */ public static function preventsSilentlyDiscardingAttributes() { } /** * Determine if accessing missing attributes is disabled. * * @return bool */ public static function preventsAccessingMissingAttributes() { } /** * Get the columns of the model (optionally with detail). * * @return array */ public static function getColumns($details = false) { } /** * Dynamically retrieve attributes on the model. * * @param string $key * @return mixed */ public function __get($key) { } /** * Dynamically set attributes on the model. * * @param string $key * @param mixed $value * @return void */ public function __set($key, $value) { } /** * Determine if the given attribute exists. * * @param mixed $offset * @return bool */ #[\ReturnTypeWillChange] public function offsetExists($offset) { } /** * Get the value for a given offset. * * @param mixed $offset * @return mixed */ #[\ReturnTypeWillChange] public function offsetGet($offset) { } /** * Set the value for a given offset. * * @param mixed $offset * @param mixed $value * @return void */ #[\ReturnTypeWillChange] public function offsetSet($offset, $value) { } /** * Unset the value for a given offset. * * @param mixed $offset * @return void */ #[\ReturnTypeWillChange] public function offsetUnset($offset) { } /** * Determine if an attribute or relation exists on the model. * * @param string $key * @return bool */ public function __isset($key) { } /** * Unset an attribute on the model. * * @param string $key * @return void */ public function __unset($key) { } /** * Get the relation resolver callback. * * @param string $method * @return mixed */ public function getRelationResolver($method) { } /** * Handle dynamic method calls into the model. * * @param string $method * @param array $parameters * @return mixed */ public function __call($method, $parameters) { } /** * Handle dynamic static method calls into the model. * * @param string $method * @param array $parameters * @return mixed */ public static function __callStatic($method, $parameters) { } /** * Convert the model to its string representation. * * @return string */ public function __toString() { } /** * Indicate that the object's string representation should be escaped when __toString is invoked. * * @param bool $escape * @return self */ public function escapeWhenCastingToString($escape = true) { } /** * Prepare the object for serialization. * * @return array */ public function __sleep() { } /** * When a model is being unserialized, check if it needs to be booted. * * @return void */ public function __wakeup() { } } } namespace FluentCart\App\Models { class Model extends \FluentCart\Framework\Database\Orm\Model { protected $primaryKey = 'id'; protected $guarded = ['id', 'ID']; public function freshTimestamp() { } /** * Return a timestamp as DateTime object. * * @param mixed $value * @return \FluentCart\Framework\Support\DateTime; */ protected function asDateTime($value) { } public function scopeInJson($query, $column, $value) { } } } namespace FluentCart\App\Models\Concerns { /** * @method static \FluentCart\Framework\Database\Orm\Builder search(array $query = []) * @see dev-docs/search-trait.md */ trait CanSearch { /** * WHERE $column LIKE %$value% query. * * @param \FluentCart\Framework\Database\Orm\Builder $query * @param $column * @param $value * @param string $boolean * * @return \FluentCart\Framework\Database\Orm\Builder */ public function scopeWhereLike(\FluentCart\Framework\Database\Orm\Builder $query, $column, $value, string $boolean = 'and'): \FluentCart\Framework\Database\Orm\Builder { } /** * WHERE $column LIKE $value% query. * * @param \FluentCart\Framework\Database\Orm\Builder $query * @param $column * @param $value * @param string $boolean * * @return \FluentCart\Framework\Database\Orm\Builder */ public function scopeWhereBeginsWith(\FluentCart\Framework\Database\Orm\Builder $query, $column, $value, string $boolean = 'and'): \FluentCart\Framework\Database\Orm\Builder { } /** * WHERE $column LIKE %$value query. * * @param \FluentCart\Framework\Database\Orm\Builder $query * @param $column * @param $value * @param string $boolean * * @return \FluentCart\Framework\Database\Orm\Builder */ public function scopeWhereEndsWith(\FluentCart\Framework\Database\Orm\Builder $query, $column, $value, string $boolean = 'and'): \FluentCart\Framework\Database\Orm\Builder { } /** * @param array $params * @param \FluentCart\Framework\Database\Orm\Builder $query * * @return \FluentCart\Framework\Database\Orm\Builder */ public function scopeSearch(\FluentCart\Framework\Database\Orm\Builder $query, array $params): \FluentCart\Framework\Database\Orm\Builder { } /** * @param \FluentCart\Framework\Database\Orm\Builder $query * @param array $groups * * @return \FluentCart\Framework\Database\Orm\Builder */ public function scopeGroupSearch(\FluentCart\Framework\Database\Orm\Builder $query, array $groups): \FluentCart\Framework\Database\Orm\Builder { } /** * @param array $params * @return bool */ private function checkValueIsNull(array $params): bool { } public function getSearchable(): array { } } } namespace FluentCart\App\Models { class Activity extends \FluentCart\App\Models\Model { use \FluentCart\App\Models\Concerns\CanSearch; protected $table = 'fct_activity'; protected $primaryKey = 'id'; protected $guarded = ['id']; protected $fillable = ['status', 'log_type', 'module_id', 'module_type', 'module_name', 'title', 'content', 'user_id', 'read_status', 'created_by']; protected $casts = ['module_id' => 'integer']; /** * Get the parent activity model (order etc). */ public function activity(): \FluentCart\Framework\Database\Orm\Relations\MorphTo { } public function user(): \FluentCart\Framework\Database\Orm\Relations\HasOne { } } } namespace FluentCart\App\Models\Concerns { trait CanUpdateBatch { public static function scopeBatchUpdate(\FluentCart\Framework\Database\Orm\Builder $query, $values, $index = null) { } } } namespace FluentCart\App\Models { /** * AppliedCoupon Model - DB Model for Applied Coupons table * * Database Model * * @package FluentCart\App\Models * * @version 1.0.0 */ class AppliedCoupon extends \FluentCart\App\Models\Model { use \FluentCart\App\Models\Concerns\CanUpdateBatch; protected $table = 'fct_applied_coupons'; protected $primaryKey = 'id'; protected $guarded = ['id']; protected $fillable = ['order_id', 'coupon_id', 'code', 'amount']; public function order() { } public function coupon() { } public function setSettingsAttribute($value) { } public function getSettingsAttribute($value) { } public function setOtherInfoAttribute($value) { } public function getOtherInfoAttribute($value) { } public function setCategoriesAttribute($value) { } public function getCategoriesAttribute($value) { } public function setProductsAttribute($value) { } public function getProductsAttribute($value) { } } /** * Attributes Group Model - DB Model for Attributes Group eg: color, size etc * * Database Model * * @package FluentCart\App\Models * * @version 1.0.0 */ class AttributeGroup extends \FluentCart\App\Models\Model { use \FluentCart\App\Models\Concerns\CanSearch, \FluentCart\App\Models\Concerns\CanUpdateBatch; public static function boot() { } protected $table = 'fct_atts_groups'; protected $fillable = ['title', 'slug', 'description', 'settings', 'serial']; protected $casts = ['is_system' => 'boolean']; public function setSettingsAttribute($value) { } public function getSettingsAttribute($value) { } /** * hasMany: Group has many Terms * * @return \FluentCart\Framework\Database\Orm\Relations\HasMany */ public function terms() { } public function usedTerms() { } public function scopeApplyCustomFilters($query, $filters) { } } /** * Attributes Relations Model - DB Model for Attributes Terms to Specific Variations * Maybe we don't need this model. For now, it's here * * Database Model * * @package FluentCart\App\Models * * @version 1.0.0 */ class AttributeRelation extends \FluentCart\App\Models\Model { protected $table = 'fct_atts_relations'; protected $fillable = ['group_id', 'term_id', 'object_id']; public function group() { } public function term() { } public function productDetails() { } } /** * Attributes Terms Model - DB Model for Attributes Terms eg for Size: Small, Medium, Large * * Database Model * * @package FluentCart\App\Models * * @version 1.0.0 */ class AttributeTerm extends \FluentCart\App\Models\Model { use \FluentCart\App\Models\Concerns\CanSearch, \FluentCart\App\Models\Concerns\CanUpdateBatch; protected $table = 'fct_atts_terms'; protected $fillable = ['group_id', 'serial', 'title', 'slug', 'description', 'settings']; public function setSettingsAttribute($value) { } public function getSettingsAttribute($value) { } public function group() { } public function scopeApplyCustomFilters($query, $filters) { } } } namespace FluentCart\App\Models\BatchQuery { interface BatchInterface { /** * Update multiple rows. * * @param \FluentCart\Framework\Database\Orm\Model $table * @param array $values * @param string|null $index * @param bool $raw * @return mixed */ public function update(\FluentCart\Framework\Database\Orm\Model $table, array $values, ?string $index = null, bool $raw = false); /** * Update multiple rows with two index. * * @param \FluentCart\Framework\Database\Orm\Model $table * @param array $values * @param string|null $index * @param string|null $index2 * @param bool $raw * @return mixed */ public function updateWithTwoIndex(\FluentCart\Framework\Database\Orm\Model $table, array $values, ?string $index = null, ?string $index2 = null, bool $raw = false); } class Batch implements \FluentCart\App\Models\BatchQuery\BatchInterface { protected $db; public function __construct() { } public function update(\FluentCart\Framework\Database\Orm\Model $table, array $values, ?string $index = null, bool $raw = false) { } /** * Update multiple rows * @param \FluentCart\Framework\Database\Orm\Model $table * @param array $values * @param string $index * @param string|null $index2 * @param bool $raw * @return bool|int * * @desc * Example * $table = 'users'; * $value = [ * [ * 'id' => 1, * 'status' => 'active', * 'nickname' => 'Mohammad' * ] , * [ * 'id' => 5, * 'status' => 'deactive', * 'nickname' => 'Ghanbari' * ] , * ]; * $index = 'id'; * $index2 = 'user_id'; * */ public function updateWithTwoIndex(\FluentCart\Framework\Database\Orm\Model $table, array $values, ?string $index = null, ?string $index2 = null, bool $raw = false) { } /** * Get the full table name. * * @param \FluentCart\Framework\Database\Orm\Model $model * @return string */ private function getFullTableName(\FluentCart\Framework\Database\Orm\Model $model): string { } } class Common { /** * Escape values according to mysql. * * @param $fieldValue * @return array|string|string[] */ public static function mysqlEscape($fieldValue) { } /** * Disable Backtick. * * @param $drive * @return boolean */ public static function disableBacktick($drive) { } protected static function safeJsonString($fieldValue) { } protected static function is_json($str): bool { } protected static function safeJson($jsonData, $asArray = false) { } } } namespace FluentCart\App\Models { /** * Cart Session Model - DB Model for Carts * * Database Model * * @package FluentCart\App\Models * * @version 1.0.0 */ class Cart extends \FluentCart\App\Models\Model { use \FluentCart\App\Models\Concerns\CanSearch; protected $primaryKey = 'cart_hash'; public $incrementing = false; protected $table = 'fct_carts'; protected $hidden = ['order_id', 'customer_id', 'user_id']; /** * Static cache for loaded cart data with bundle children * Keyed by cart_hash (primary key) * * @var array */ private static $cache = []; /** * Per-request cache for computed fees. * @var array|null */ private $cachedFees = null; /** * Recursion guard for getFees() to prevent infinite loops. * @var bool */ private $isCalculatingFees = false; /** * The attributes that are mass assignable. * * @var array */ protected $fillable = ['customer_id', 'user_id', 'order_id', 'cart_hash', 'checkout_data', 'cart_data', 'utm_data', 'coupons', 'first_name', 'last_name', 'email', 'stage', 'cart_group', 'user_agent', 'ip_address', 'completed_at', 'deleted_at']; public static function boot() { } public function setCheckoutDataAttribute($settings) { } public function getCheckoutDataAttribute($settings) { } public function setCouponsAttribute($coupons) { } public function getCouponsAttribute($coupons) { } public function setCartDataAttribute($settings) { } public function getCartDataAttribute($data): array { } /** * Attach a resolved `variation_display_title` to each cart item — the cart-side * mirror of OrderItem's appended accessor. Holds the labeled attribute * combination ("Color: Red | Size: XS") resolved from the item's frozen * other_info['item_attributes'] snapshot, falling back to the variation * title when no attributes resolve. * * @param array $items * @return array */ protected static function appendVariationDisplayTitle(array $items): array { } public function setUtmDataAttribute($utmData) { } public function getUtmDataAttribute($utmData) { } /** * One2One: Order belongs to one Customer * * @return \FluentCart\Framework\Database\Orm\Relations\BelongsTo */ public function customer(): \FluentCart\Framework\Database\Orm\Relations\BelongsTo { } /** * One2One: Order belongs to one Customer * * @return \FluentCart\Framework\Database\Orm\Relations\BelongsTo */ public function order(): \FluentCart\Framework\Database\Orm\Relations\BelongsTo { } public function scopeStageNotCompleted($query) { } public function isLocked() { } public function addItem($item = [], $replacingIndex = null) { } public function removeItem($variationId, $extraArgs = [], $triggerEvent = true) { } public function addByVariation(\FluentCart\App\Models\ProductVariation $variation, $config = []) { } public function addByCustom(array $variation, array $config = []) { } public function guessCustomer() { } public function reValidateCoupons() { } public function removeCoupon($removeCodes = []) { } public function applyCoupon($codes = []) { } protected function hasZeroRecurringAmount(array $cartItems) { } public function getDiscountLines($revalidate = false) { } public function hasSubscription() { } public function requireShipping() { } public function getShippingTotal() { } /** * Get all fees for this cart. * Reads persistent fees from checkout_data.fees and merges with * dynamically computed fees from the fluent_cart/cart/fees filter. * Uses per-request caching to avoid redundant DB reads and filter evaluations. * * @return array Validated fee items */ public function getFees(): array { } /** * Get only the persistent (stored) fees from checkout_data. * * @return array */ public function getStoredFees(): array { } /** * Add a fee to the cart. Persists immediately to the database. * If a fee with the same source:key already exists, it will be updated. * * Usage: * $cart->addFee([ * 'key' => 'processing_fee', * 'label' => 'Processing Fee', * 'amount' => 450, // cents, must be positive * 'source' => 'dynamic-pricing', * 'taxable' => false, * 'meta' => ['rule_id' => 42], * ]); * * @param array $fee Fee data with required keys: key, label, amount * @return bool Whether the fee was added successfully */ public function addFee(array $fee): bool { } /** * Remove a fee from the cart by key (and optionally source). * Persists immediately to the database. * * @param string $key The fee key to remove * @param string|null $source Optional source filter. If null, removes all fees with this key. * @return bool Whether any fee was removed */ public function removeFee(string $key, ?string $source = null): bool { } /** * Remove all fees from a specific source. * Useful for addons to clear their fees before recalculating. * * @param string $source The source identifier * @return void */ public function removeFeesBySource(string $source): void { } /** * Get the total of all fees in cents. * * @return int */ public function getFeeTotal(): int { } /** * Build cart-data-compatible items for fee items. * Used by the tax module to calculate tax on taxable fees * through the same pipeline as product items. * * @return array */ public function getFeeCartItems(): array { } /** * Convert a validated fee array into a cart-data-compatible line item. * Single source of truth for fee item structure — used by both * getFeeCartItems() and TaxModule::calculateCartTax(). * * @param array $fee Validated fee array * @return array Cart-data-compatible item */ public static function buildFeeCartItem(array $fee): array { } /** * Clear the per-request fee cache. * Call this after modifying fees or cart data. * * @return void */ public function clearFeeCache(): void { } /** * Validate and deduplicate an array of fees. * * @param array $fees Raw fee items * @return array Validated fee items */ private function validateFees(array $fees): array { } public function getItemsSubtotal() { } private static bool $calculatingTotal = false; public function getEstimatedTotal($extraAmount = 0) { } /** * Raw total calculation without hooks (used for recursion guard). */ private function getEstimatedTotalRaw($extraAmount = 0) { } /** * Get full cart context data for dynamic pricing and other addons. */ public function getContextData(): array { } public function getEstimatedRecurringTotal() { } public function findExistingItemAndIndex($objectId, $extraArgs = []) { } public function getShippingAddress() { } public function getBillingAddress() { } public function isZeroPayment() { } public function isShipToDifferent() { } // Unique hook handling protected function uniqueHooks($hooks) { } public function addDraftCreatedActions($hooks) { } public function addSuccessActions($hooks) { } public function addCartNotices($notices) { } } } namespace FluentCart\App\Models\Concerns { trait HasActivity { public function activities(): \FluentCart\Framework\Database\Orm\Relations\MorphMany { } } } namespace FluentCart\App\Models\Connection { class ConnectionManager { public static function connect(&$app) { } } } namespace FluentCart\App\Models { class Coupon extends \FluentCart\App\Models\Model { use \FluentCart\App\Models\Concerns\CanSearch, \FluentCart\App\Models\Concerns\HasActivity; protected $table = 'fct_coupons'; protected $primaryKey = 'id'; protected $guarded = ['id']; protected $fillable = ['parent', 'title', 'code', 'status', 'type', 'conditions', 'amount', 'stackable', 'priority', 'use_count', 'notes', 'show_on_checkout', 'start_date', 'end_date']; protected $casts = ['max_uses' => 'integer']; public function setConditionsAttribute($value) { } public function getConditionsAttribute($value) { } // public function setMaxPerCustomer($value){ // //dd($value); // return empty($value)? $value: ((intval)($value)); // } // public function getMaxPerCustomer($value){ // return empty($value)? ((intval)($value)): $value; // } public function appliedCoupons() { } public function orders(): \FluentCart\Framework\Database\Orm\Relations\BelongsToMany { } public function setSettingsAttribute($value) { } public function getSettingsAttribute($value) { } public function setOtherInfoAttribute($value) { } public function getOtherInfoAttribute($value) { } public function setCategoriesAttribute($value) { } public function getCategoriesAttribute($value) { } public function setProductsAttribute($value) { } public function getProductsAttribute($value) { } public function getEndDate() { } public function getStatus() { } public function setStatus($value) { } public function getMeta($metaKey, $default = null) { } public function updateMeta($metaKey, $metaValue) { } public function scopeActive($query) { } public function isRecurringDiscount() { } } /** * Customer Model - DB Model for Customers * * Database Model * * @package FluentCart\App\Models * * @version 1.0.0 */ class Customer extends \FluentCart\App\Models\Model { use \FluentCart\App\Models\Concerns\CanSearch, \FluentCart\App\Models\Concerns\CanUpdateBatch; protected $table = 'fct_customers'; protected $appends = ['full_name', 'photo', 'country_name', 'formatted_address', 'user_link']; /** * The attributes that are mass assignable. * * @var array */ protected $fillable = ['user_id', 'contact_id', 'email', 'first_name', 'last_name', 'status', 'purchase_value', 'purchase_count', 'ltv', 'first_purchase_date', 'last_purchase_date', 'aov', 'notes', 'uuid', 'country', 'city', 'state', 'postcode']; protected $searchable = ['first_name', 'last_name', 'email']; public function setPurchaseValueAttribute($value) { } public function getPurchaseValueAttribute($value) { } public static function boot() { } public function scopeOfActive($query) { } public function scopeOfArchived($query) { } /** * todo - contact_id ? - do we need it anymore? */ public function orders() { } public function success_order_items() { } public function subscriptions() { } public function shipping_address() { } public function billing_address() { } public function primary_shipping_address(): \FluentCart\Framework\Database\Orm\Relations\HasOne { } public function primary_billing_address(): \FluentCart\Framework\Database\Orm\Relations\HasOne { } /** * Accessor to get dynamic full_name attribute * * @return string */ public function getFullNameAttribute() { } /** * Accessor method to get the user's avatar URL using their email, * with a size of 100x100 pixels. * * @return string */ public function getPhotoAttribute() { } /** * Accessor method to get the country's name with country code, * * @return string */ public function getCountryNameAttribute(): string { } public function recountStats() { } public function recountStat() { } /** * Local scope to filter subscribers by search/query string * * @param \FluentCart\Framework\Database\Query\Builder $query * @param string $search * * @return \FluentCart\Framework\Database\Query\Builder $query */ public function scopeSearchBy($query, $search) { } public function scopeApplyCustomFilters($query, $filters) { } public function updateCustomerStatus($newStatus) { } /** * Get the customer's label. */ public function labels(): \FluentCart\Framework\Database\Orm\Relations\MorphMany { } /** * Define the relationship with the User model. */ public function wpUser(): \FluentCart\Framework\Database\Orm\Relations\BelongsTo { } public function getWpUserId($recheck = false) { } public function getFormattedAddressAttribute(): array { } public function getUserLinkAttribute() { } public function getMeta($metaKey, $default = null) { } public function updateMeta($metaKey, $metaValue) { } public function getWpUser() { } public function scopeSearchByFullName($query, $data) { } } /** * Order Model - DB Model for Orders * * Database Model * * @package FluentCart\App\Models * * @version 1.0.0 */ class CustomerAddresses extends \FluentCart\App\Models\Model { use \FluentCart\App\Models\Concerns\CanSearch; protected $table = 'fct_customer_addresses'; protected $appends = ['formatted_address', 'company_name', 'vat_number', 'legal_registration_id']; /** * The attributes that are mass assignable. * * @var array */ protected $fillable = ['customer_id', 'is_primary', 'type', 'status', 'label', 'name', 'address_1', 'address_2', 'city', 'state', 'postcode', 'country', 'phone', 'email', 'meta']; public function setMetaAttribute($value) { } public function getMetaAttribute($value) { } public function setCompanyNameAttribute($value) { } public function getCompanyNameAttribute() { } public function setLegalRegistrationIdAttribute($value) { } public function getLegalRegistrationIdAttribute() { } public function setVatNumberAttribute($value) { } public function getVatNumberAttribute() { } public function scopeOfActive($query) { } public function scopeOfArchived($query) { } public function customer() { } public function getFormattedAddressAttribute(): array { } public function getFormattedDataForCheckout($prefix = 'billing_') { } } /** * Meta Model - DB Model for Meta table * * Database Model * * @package FluentCart\App\Models * * @version 1.0.0 */ class CustomerMeta extends \FluentCart\App\Models\Model { protected $table = 'fct_customer_meta'; protected $primaryKey = 'id'; protected $guarded = ['id']; protected $fillable = ['customer_id', 'meta_key', 'meta_value']; public function setMetaValueAttribute($value) { } public function getMetaValueAttribute($value) { } public function customer() { } } class DynamicModel extends \FluentCart\App\Models\Model { use \FluentCart\App\Models\Concerns\CanSearch; public function __construct($attributes = [], $table = null) { } protected $guarded = []; } /** * Label Model - DB Model for Label table * * Database Model * * @package FluentCart\App\Models * * @version 1.0.0 */ class Label extends \FluentCart\App\Models\Model { protected $table = 'fct_label'; protected $fillable = ['value']; protected $casts = ['id' => 'integer']; public function setValueAttribute($value) { } public function getValueAttribute($value) { } } /** * Label Relationship Model - DB Model for Label Relationship table * * Database Model * * @package FluentCart\App\Models * * @version 1.0.0 */ class LabelRelationship extends \FluentCart\App\Models\Model { protected $table = 'fct_label_relationships'; protected $fillable = ['label_id', 'labelable_id', 'labelable_type']; protected $casts = ['label_id' => 'integer']; /** * Get the parent labelable model (order etc). */ public function labelable(): \FluentCart\Framework\Database\Orm\Relations\MorphTo { } } /** * Meta Model - DB Model for Meta table * * Database Model * * @package FluentCart\App\Models * * @version 1.0.0 */ class Meta extends \FluentCart\App\Models\Model { protected $table = 'fct_meta'; protected $primaryKey = 'id'; protected $guarded = ['id']; protected $fillable = ['object_type', 'object_id', 'meta_key', 'meta_value']; public function setMetaValueAttribute($meta_value) { } public function getMetaValueAttribute($value) { } public function scopeProductCategoryTaxOverrides(\FluentCart\Framework\Database\Orm\Builder $query) { } public function scopeForTaxOverrideCountry(\FluentCart\Framework\Database\Orm\Builder $query, $countryCode) { } public function scopeForTaxOverrideCountries(\FluentCart\Framework\Database\Orm\Builder $query, array $countryCodes) { } public function scopeForTaxOverrideState(\FluentCart\Framework\Database\Orm\Builder $query, $stateCode) { } public function scopeForTaxOverrideCategoryId(\FluentCart\Framework\Database\Orm\Builder $query, $categoryId) { } public function scopeForTaxOverrideCity(\FluentCart\Framework\Database\Orm\Builder $query, $city) { } public function scopeForTaxOverridePostcode(\FluentCart\Framework\Database\Orm\Builder $query, $postcode) { } public function scopeForTaxOverrideClassId(\FluentCart\Framework\Database\Orm\Builder $query, $classId) { } public function scopeLegacyTaxOverrideObjectId(\FluentCart\Framework\Database\Orm\Builder $query) { } public function scopeUserTheme(\FluentCart\Framework\Database\Orm\Builder $query) { } public function scopeUpgradeablePath($query, $productId) { } public function upgradeableVariants() { } } /** * Order Model - DB Model for Orders * * Database Model * * @package FluentCart\App\Models * * @version 1.0.0 */ class Order extends \FluentCart\App\Models\Model { use \FluentCart\App\Models\Concerns\CanSearch, \FluentCart\App\Models\Concerns\HasActivity, \FluentCart\App\Models\Concerns\CanUpdateBatch; protected $table = 'fct_orders'; public static function boot() { } /** * Generate a short, human-usable order handle: 12 uppercase alphanumeric * characters (e.g. A7K2P9X4M1Q8), stored in the `uuid` column and shown as * "#A7K2P9X4M1Q8" on the UI. Existing orders keep their legacy md5 uuids. * * Uniqueness is best-effort at the application level: a chunk of * candidates is generated and filtered against the table with a single * whereIn query (no per-candidate round-trips). There is intentionally no * DB unique constraint on `fct_orders.uuid`, so this check is NOT atomic — * two concurrent inserts could theoretically race on the same candidate. * Given the 36^12 (~4.7x10^18) space, a real collision is astronomically * unlikely, but not cryptographically guaranteed. If a hard guarantee is * ever required, add a unique index on the column and retry creation on a * duplicate-key error. * * @return string */ public static function generateOrderUuid() { } protected $fillable = ['status', 'parent_id', 'invoice_no', 'receipt_number', 'fulfillment_type', 'type', 'customer_id', 'payment_method', 'payment_method_title', 'payment_status', 'currency', 'subtotal', 'discount_tax', 'manual_discount_total', 'coupon_discount_total', 'shipping_tax', 'shipping_total', 'fee_total', 'tax_total', 'tax_behavior', 'total_amount', 'rate', 'note', 'ip_address', 'completed_at', 'refunded_at', 'total_refund', 'uuid', 'created_at', 'refunded_at', 'total_paid', 'mode', 'shipping_status', 'config']; protected $searchable = ['id', 'total_amount', 'status', 'payment_method', 'payment_status', 'created_at', 'updated_at']; protected $casts = ['subtotal' => 'double', 'discount_tax' => 'double', 'manual_discount_total' => 'double', 'coupon_discount_total' => 'double', 'shipping_tax' => 'double', 'shipping_total' => 'double', 'fee_total' => 'double', 'tax_total' => 'double', 'tax_behavior' => 'integer', 'total_amount' => 'double', 'customer_id' => 'integer']; public function parentOrder(): \FluentCart\Framework\Database\Orm\Relations\BelongsTo { } public function children(): \FluentCart\Framework\Database\Orm\Relations\HasMany { } public function transactions(): \FluentCart\Framework\Database\Orm\Relations\HasMany { } public function subscriptions(): \FluentCart\Framework\Database\Orm\Relations\HasMany { } public function order_items(): \FluentCart\Framework\Database\Orm\Relations\HasMany { } /** * Get only product order items (excludes fees, signup fees, and other non-product items). * Use this in all display contexts where product line items are shown. * * @return \FluentCart\Framework\Support\Collection */ public function getProductItems() { } /** * Get fee order items for this order. * * @return \FluentCart\Framework\Database\Orm\Relations\HasMany */ public function feeItems(): \FluentCart\Framework\Database\Orm\Relations\HasMany { } /** * Get applied fees as a simple array (for display purposes). * * @return array */ public function getAppliedFees(): array { } public function setConfigAttribute($value) { } public function getConfigAttribute($value) { } /** * Retrieves a filtered list of `order_items` based on priority rules for `payment_type`. * * The function applies the following logic in descending order of precedence: * * 1. **Priority 1: Onetime Items** * - If `order_items` contain `payment_type` as `onetime`, return only those items. * * 2. **Priority 2: Subscription Items** * - If there are no `onetime` items, return `subscription` items only if: * - There is no `signup_fee` or `adjustment` for the same order. * - This ensures `subscription` items are returned only when no other higher priority types are present. * * 3. **Priority 3: Adjustment Items** * - If there are no `onetime` or `subscription` items, return `adjustment` items only if: * - `subscription` items exist for the same order. * - This prioritizes `adjustment` items when both `adjustment` and `subscription` are present. * * The function uses `whereExists` and `whereNotExists` subqueries to apply these priority rules. * - `whereExists` checks for the presence of certain `payment_type` values in the `order_items` table. * - `whereNotExists` ensures exclusion of specific `payment_type` values if higher priority types are present. * * @return \FluentCart\Framework\Database\Orm\Relations\HasMany * The filtered `order_items` relationship, ordered by the specified priority rules. */ public function filteredOrderItems(): \FluentCart\Framework\Database\Orm\Relations\HasMany { } public function customer(): \FluentCart\Framework\Database\Orm\Relations\BelongsTo { } public function orderMeta(): \FluentCart\Framework\Database\Orm\Relations\HasMany { } public function orderTaxRates(): \FluentCart\Framework\Database\Orm\Relations\HasMany { } public function appliedCoupons(): \FluentCart\Framework\Database\Orm\Relations\HasMany { } public function usedCoupons(): \FluentCart\Framework\Database\Orm\Relations\HasManyThrough { } public function shipping_address(): \FluentCart\Framework\Database\Orm\Relations\HasOne { } public function billing_address(): \FluentCart\Framework\Database\Orm\Relations\HasOne { } public function order_addresses(): \FluentCart\Framework\Database\Orm\Relations\HasMany { } public function licenses(): \FluentCart\Framework\Database\Orm\Relations\HasMany { } public function scopeSearchBy($query, $search) { } public function scopeOfPaymentStatus($query, $status) { } public function scopeOfOrderStatus($query, $status) { } public function scopeOfShippingStatus($query, $status) { } public function scopeOfOrderType($query, $type) { } public function scopeOfPaymentMethod($query, $methodName) { } public function scopeApplyCustomFilters($query, $filters) { } public function updateStatus($key, $newStatus) { } public function updatePaymentStatus($newStatus) { } public function getMeta($metaKey, $defaultValue = false) { } public function updateMeta($metaKey, $value) { } public function deleteMeta($metaKey) { } public function getBusinessInfo(): array { } public function getPrimaryOrderTaxRate() { } public function getReversedTaxTotal() { } public function isB2BOrder(): bool { } public function getIsB2BOrderAttribute(): bool { } public function isReverseChargeTaxOrder(): bool { } public function getOrderRcMode(): string { } public function getDisplayTaxLines(): array { } public function getDisplayTaxLinesAttribute(): array { } public function getDisplayShippingTaxLines(): array { } public function getDisplayShippingTaxLinesAttribute(): array { } protected function normalizeOrderTaxRateMeta(array $meta, int $taxRateId): array { } public function getCustomerTaxNumber(): string { } public function getTaxSummaryAttribute(): array { } public function getBusinessInfoAttribute(): array { } public function getIsReverseChargeTaxOrderAttribute(): bool { } public function getCustomerTaxNumberAttribute(): string { } public function hasValidatedCustomerTaxNumber(): bool { } public function getCustomerTaxName(): string { } public function getTotalPaidAmount() { } public function getTotalRefundAmount() { } public function recountTotalPaidAndRefund() { } public function syncOrderAfterRefund($type, $refundedAmount) { } public function updateRefundedItems($refundedItemIds, $refundedAmount) { } public function recountTotalPaid() { } /** * Get the order's label. */ public function labels(): \FluentCart\Framework\Database\Orm\Relations\MorphMany { } public function getLatestTransactionAttribute() { } public function renewals(): \FluentCart\Framework\Database\Orm\Relations\HasMany { } public function isSubscription(): bool { } public function getViewUrl($type = 'customer') { } public function getLatestTransaction() { } public function currentSubscription(): ?\FluentCart\App\Models\Subscription { } public function getDownloads($scope = 'email'): array { } public function getLicenses($with = ['product', 'productVariant']) { } public function getDownloadsById($orderId): array { } public function getReceiptViewUrl() { } public function getReceiptDownloadUrl() { } public function addLog($title, $description = '', $type = 'info', $by = '') { } public function canBeRefunded(): bool { } public function generateReceiptNumber() { } public function orderOperation(): \FluentCart\Framework\Database\Orm\Relations\HasOne { } public function canBeDeleted() { } } /** * OrderItem Model - DB Model for Order Items * * Database Model * * @package FluentCart\App\Models * * @version 1.0.0 */ class OrderAddress extends \FluentCart\App\Models\Model { protected $table = 'fct_order_addresses'; /** * The attributes that are mass assignable. * * @var array */ protected $fillable = ['id', 'order_id', 'type', 'name', 'address_1', 'address_2', 'city', 'state', 'postcode', 'country', 'meta']; protected $appends = ['email', 'first_name', 'last_name', 'full_name', 'formatted_address', 'company_name', 'vat_number', 'legal_registration_id', 'phone', 'label']; public function setMetaAttribute($value) { } public function getMetaAttribute($value) { } public function getFullNameAttribute(): ?string { } public function getFirstNameAttribute(): ?string { } public function getLastNameAttribute(): ?string { } public function order(): \FluentCart\Framework\Database\Orm\Relations\BelongsTo { } public function getEmailAttribute(): ?string { } public function getFormattedAddressAttribute(): array { } public function getFormattedAddress($filtered = false): array { } public function getAddressAsText($isHtml = false, $includeName = true, $separator = ', '): string { } public function getFormattedDataForCheckout($prefix = 'billing_') { } public function setCompanyNameAttribute($value) { } public function getCompanyNameAttribute() { } public function setVatNumberAttribute($value) { } public function getVatNumberAttribute() { } public function setLegalRegistrationIdAttribute($value) { } public function getLegalRegistrationIdAttribute() { } public function setLabelAttribute($value) { } public function getLabelAttribute() { } public function setPhoneAttribute($value) { } public function getPhoneAttribute() { } } /** * Meta Model - DB Model for Meta table * * Database Model * * @package FluentCart\App\Models * * @version 1.0.0 */ class OrderDownloadPermission extends \FluentCart\App\Models\Model { protected $table = 'fct_order_download_permissions'; protected $primaryKey = 'id'; protected $guarded = ['id']; protected $fillable = ['order_id', 'variation_id', 'customer_id', 'download_id', 'download_count', 'download_limit', 'access_expires']; public function order() { } public function customer() { } } /** * OrderItem Model - DB Model for Order Items * * Database Model * * @package FluentCart\App\Models * * @version 1.0.0 */ class OrderItem extends \FluentCart\App\Models\Model { use \FluentCart\App\Models\Concerns\CanSearch, \FluentCart\App\Models\Concerns\CanUpdateBatch; protected $table = 'fct_order_items'; /** * The attributes that are mass assignable. * * @var array */ protected $fillable = ['order_id', 'post_id', 'fulfillment_type', 'fulfilled_quantity', 'post_title', 'title', 'object_id', 'cart_index', 'quantity', 'unit_price', 'cost', 'subtotal', 'tax_amount', 'discount_total', 'refund_total', 'line_total', 'rate', 'other_info', 'line_meta', 'referrer', 'object_type', 'payment_type', 'created_at']; protected $appends = ['payment_info', 'setup_info', 'is_custom', 'variation_display_title']; protected $casts = ['unit_price' => 'double', 'cost' => 'double', 'subtotal' => 'double', 'tax_amount' => 'double', 'shipping_charge' => 'double', 'discount_total' => 'double', 'line_total' => 'double', 'refund_total' => 'double']; protected static function booted() { } protected function getFormattedTotalAttribute() { } public function getCouponDiscountAttribute() { } public function setOtherInfoAttribute($value) { } public function getOtherInfoAttribute($value) { } public function setLineMetaAttribute($value) { } public function getLineMetaAttribute($value) { } public function getFullNameAttribute($value) { } public function order() { } public function product() { } public function variants() { } public function product_downloads() { } public function createItem($orderItems) { } public function processCustom($product, $orderId) { } /** * Get subscription payment info if available * * @return string */ public function getPaymentInfoAttribute(): string { } /** * Get subscription setup info if available * * @return string */ public function getSetupInfoAttribute(): string { } /** * Helper method to get subscription info * * @param string $type 'payment' or 'setup' * @return string */ private function getSubscriptionInfo(string $type): string { } public function productImage(): \FluentCart\Framework\Database\Orm\Relations\HasOne { } public function variantImages(): \FluentCart\Framework\Database\Orm\Relations\HasOne { } public function getIsCustomAttribute() { } public function getViewUrlAttribute() { } public function getDisplayTitle() { } /** * Labeled attribute combination resolved from the frozen * other_info['item_attributes'] snapshot, e.g. "Color: Red | Size: XS". * Falls back to the stored variation title when no attribute snapshot * resolves (custom/simple items, or attrs whose groups were removed). * * @return string */ public function getVariationDisplayTitleAttribute() { } } /** * Order Meta Model - DB Model for Order Meta table * * Database Model * * @package FluentCart\App\Models * * @version 1.0.0 */ class OrderMeta extends \FluentCart\App\Models\Model { use \FluentCart\App\Models\Concerns\CanSearch; protected $table = 'fct_order_meta'; protected $fillable = ['order_id', 'meta_key', 'meta_value']; public function setMetaValueAttribute($value) { } public function getMetaValueAttribute($value) { } /** * One2One: OrderTransaction belongs to one Order * * @return \FluentCart\Framework\Database\Orm\Relations\BelongsTo */ public function order() { } public function updateMeta($metaKey, $metaValue) { } } /** * Meta Model - DB Model for Meta table * * Database Model * * @package FluentCart\App\Models * * @version 1.0.0 */ class OrderOperation extends \FluentCart\App\Models\Model { protected $table = 'fct_order_operations'; protected $primaryKey = 'id'; protected $guarded = ['id']; protected $fillable = ['order_id', 'created_via', 'has_tax', 'has_discount', 'coupons_counted', 'emails_sent', 'sales_recorded', 'utm_campaign', 'utm_term', 'utm_source', 'utm_content', 'utm_medium', 'utm_id', 'cart_hash', 'refer_url']; public function setMetaAttribute($value) { } public function getMetaAttribute($value) { } public function order(): \FluentCart\Framework\Database\Orm\Relations\BelongsTo { } } /** * Meta Model - DB Model for Meta table * * Database Model * * * @version 1.0.0 */ class OrderTaxRate extends \FluentCart\App\Models\Model { protected $table = 'fct_order_tax_rate'; protected $primaryKey = 'id'; protected $guarded = ['id']; protected $fillable = ['order_id', 'tax_rate_id', 'shipping_tax', 'order_tax', 'total_tax', 'meta', 'filed_at']; public function setMetaAttribute($value) { } public function getMetaAttribute($value) { } public function order() { } public function tax_rate() { } public function scopeValidOrder($query) { } } /** * OrderTransaction Model - DB Model for Transactions * * Database Model * * @package FluentCart\App\Models * * @version 1.0.0 */ class OrderTransaction extends \FluentCart\App\Models\Model { use \FluentCart\App\Models\Concerns\CanSearch; protected $table = 'fct_order_transactions'; protected $appends = ['url', 'refundable']; /** * The attributes that are mass assignable. * * @var array */ protected $fillable = ['order_id', 'order_type', 'vendor_charge_id', 'payment_method', 'payment_mode', 'payment_method_type', 'currency', 'transaction_type', 'subscription_id', 'card_last_4', 'card_brand', 'status', 'total', 'rate', 'meta', 'uuid', 'created_at']; protected $searchable = ['id', 'total', 'status', 'payment_method', 'currency', 'created_at', 'updated_at']; public function setMetaAttribute($value) { } public function getMetaAttribute($value) { } public function subscription() { } public function order() { } public static function boot() { } public function getUrlAttribute($value) { } public function scopeOfStatus($query, $status) { } public function scopeOfPaymentMethod($query, $methodName) { } public function updateStatus($newStatus, $otherData = []) { } public static function bulkDeleteByOrderIds($ids, $params = []) { } public function orders(): \FluentCart\Framework\Database\Orm\Relations\HasOne { } public function getRefundableAttribute(): int { } public function getMaxRefundableAmount() { } public function getPaymentMethodText() { } public function getReceiptPageUrl($filtered = false) { } public function syncPendingTransaction() { } public function acceptDispute($args = []) { } public function scopeSearchByPayerEmail($query, $data) { } } /** * Product Model - DB Model for Products * * Database Model * * This model is intended to be use for relationships and DB query * For insert update we will use WordPress's native functions * * @package FluentCart\App\Models * * @version 1.0.0 */ class Product extends \FluentCart\App\Models\Model { use \FluentCart\App\Models\Concerns\CanSearch; protected $table = 'posts'; protected $primaryKey = 'ID'; protected $hidden = ['post_content_filtered', 'post_password', 'post_author', 'to_ping', 'pinged', 'post_parent', 'menu_order', 'post_mime_type', 'comment_count']; protected $fillable = ['post_content', 'post_title', 'post_excerpt', 'post_author', 'post_date', 'post_date_gmt', 'post_content_filtered', 'post_status', 'post_type', 'comment_status', 'ping_status', 'post_password', 'post_name', 'to_ping', 'pinged', 'post_modified', 'post_modified_gmt', 'post_parent', 'menu_order', 'post_mime_type', 'guid']; const UPDATED_AT = null; const CREATED_AT = null; protected $appends = ['thumbnail']; protected $searchable = ['post_title', 'post_status']; public static function boot() { } public function scopePublished($query) { } public function scopeStatusOf($query, $status) { } public function scopeAdminAll($query) { } /** * One2One: Product Details belongs to one Product * @return \FluentCart\Framework\Database\Orm\Relations\HasOne */ public function detail(): \FluentCart\Framework\Database\Orm\Relations\HasOne { } public function variants(): \FluentCart\Framework\Database\Orm\Relations\HasMany { } public function getHasSubscriptionAttribute() { } public function downloadable_files(): \FluentCart\Framework\Database\Orm\Relations\HasMany { } /** * One2One: Product belongs to one Post meta which is : Gallery Image * @return \FluentCart\Framework\Database\Orm\Relations\HasOne */ public function postmeta(): \FluentCart\Framework\Database\Orm\Relations\HasOne { } public function wp_terms(): \FluentCart\Framework\Database\Orm\Relations\HasMany { } public function orderItems(): \FluentCart\Framework\Database\Orm\Relations\HasMany { } public function getCategories() { } public function getTags() { } public function getMediaUrl($size = 'thumbnail') { } /* * Transforming old getters with accessor * Todo check */ public function getTagsAttribute($value) { } public function getCategoriesAttribute($value) { } public function getThumbnailAttribute() { } public function getViewUrlAttribute() { } public function getEditUrlAttribute() { } public function wpTerms() { } public function getTermByType($type) { } /* // Get Category Relationship */ public function categories() { } public function tags() { } /* * Todo: Discuss on below relation */ public function thumbUrl(): \FluentCart\Framework\Database\Orm\Relations\HasOne { } public function licensesMeta(): \FluentCart\Framework\Database\Orm\Relations\HasOne { } public function scopeCartable(\FluentCart\Framework\Database\Orm\Builder $query): \FluentCart\Framework\Database\Orm\Builder { } public function getProductMeta($metaKey, $objectType = null, $default = null) { } public function updateProductMeta($metaKey, $metaValue, $objectType = null) { } public function scopeApplyCustomSortBy($query, $sortKey, $sortType = 'DESC') { } public function scopeByVariantTypes($query, $type = null) { } public function scopeFilterByTaxonomy($query, $taxonomies) { } public function soldIndividually() { } public function isStock(): bool { } public function images(): array { } public function isBundleProduct(): bool { } public function scopeBundle($query) { } public function scopeNonBundle($query) { } public static function duplicateProduct($productId, array $options = []): int { } protected function performDuplicate(array $options = []): int { } public function integrations(): \FluentCart\Framework\Database\Orm\Relations\HasMany { } } /** * Product Details Model - DB Model for Product Details * * Database Model * * * @package FluentCart\App\Models * * @version 1.0.0 */ class ProductDetail extends \FluentCart\App\Models\Model { use \FluentCart\App\Models\Concerns\CanSearch, \FluentCart\App\Models\Concerns\CanUpdateBatch; protected $table = 'fct_product_details'; protected $guarded = ['id']; protected $fillable = ['post_id', 'fulfillment_type', 'min_price', 'max_price', 'default_variation_id', 'variation_type', 'stock_availability', 'other_info', 'default_media', 'manage_stock', 'manage_downloadable']; /** * The attributes that should be cast. * * @var array */ protected $casts = ['post_id' => 'integer', 'min_price' => 'double', 'max_price' => 'double']; protected $appends = ['featured_media', 'formatted_min_price', 'formatted_max_price']; public function setOtherInfoAttribute($value) { } public function getOtherInfoAttribute($value) { } protected function getFormattedMinPriceAttribute() { } protected function getFormattedMaxPriceAttribute() { } /** * One2One: Product Details belongs to one Product * * @return \FluentCart\Framework\Database\Orm\Relations\BelongsTo */ public function product(): \FluentCart\Framework\Database\Orm\Relations\BelongsTo { } /** * One2One: Product Details belongs to one Gallery Image * @return \FluentCart\Framework\Database\Orm\Relations\HasOne */ public function galleryImage(): \FluentCart\Framework\Database\Orm\Relations\HasOne { } // First element of Gallery Image which is considered as featured image public function getFeaturedMediaAttribute() { } public function variants(): \FluentCart\Framework\Database\Orm\Relations\HasMany { } public function attrMap(): \FluentCart\Framework\Database\Orm\Relations\HasMany { } public static function boot() { } public function setDefaultMediaAttribute($value) { } public function getDefaultMediaAttribute($value) { } public function hasPriceVariation() { } public function getStockAvailability($variationId = null) { } public function getMinPriceAttribute() { } public function getMaxPriceAttribute() { } } /** * Product Download Model - DB Model for Product Downloads * * Database Model * * * @package FluentCart\App\Models * * @version 1.0.0 */ class ProductDownload extends \FluentCart\App\Models\Model { use \FluentCart\App\Models\Concerns\CanSearch; protected $table = 'fct_product_downloads'; protected $fillable = [ 'post_id', 'product_variation_id', 'download_identifier', 'title', 'type', 'driver', 'file_name', 'file_path', 'file_url', 'file_size', // size in bytes 'settings', 'serial', ]; public function setSettingsAttribute($settings) { } public function getSettingsAttribute($settings) { } public function setProductVariationIdAttribute($variations) { } public function getProductVariationIdAttribute($value) { } /** * One2One: Dwonloadable Files belongs to one product * * @return \FluentCart\Framework\Database\Orm\Relations\BelongsTo */ public function product() { } public function download_permissions() { } public function getSignedDownloadUrl(): string { } } /** * Order Meta Model - DB Model for Order Meta table * * Database Model * * @package FluentCart\App\Models * * @version 1.0.0 */ class ProductMeta extends \FluentCart\App\Models\Model { protected $table = 'fct_product_meta'; protected $primaryKey = 'id'; protected $guarded = ['id']; protected $fillable = ['object_id', 'object_type', 'meta_key', 'meta_value']; public function setMetaValueAttribute($meta_value) { } public function getMetaValueAttribute($value) { } } /** * Product Details Model - DB Model for Product Details * * Database Model * * * @package FluentCart\App\Models * * @version 1.0.0 */ class ProductVariation extends \FluentCart\App\Models\Model { use \FluentCart\App\Models\Concerns\CanSearch, \FluentCart\App\Models\Concerns\CanUpdateBatch; protected $table = 'fct_product_variations'; protected $fillable = ['post_id', 'media_id', 'serial_index', 'sold_individually', 'variation_title', 'variation_identifier', 'sku', 'manage_stock', 'payment_type', 'stock_status', 'backorders', 'total_stock', 'available', 'committed', 'on_hold', 'fulfillment_type', 'item_status', 'manage_cost', 'item_price', 'item_cost', 'compare_price', 'other_info', 'downloadable', 'shipping_class']; /** * The attributes that should be cast. * * @var array */ protected $casts = ['post_id' => 'integer', 'media_id' => 'integer', 'item_cost' => 'double', 'item_price' => 'double', 'compare_price' => 'double', 'backorders' => 'integer', 'total_stock' => 'integer', 'available' => 'integer', 'committed' => 'integer', 'on_hold' => 'integer', 'sold_individually' => 'integer', 'serial_index' => 'integer', 'other_info' => 'array']; protected $appends = ['thumbnail']; public function getOtherInfoAttribute($value) { } protected static function booted() { } protected function getFormattedTotalAttribute() { } /** * One2One: Product Variation belongs to one Product * * @return \FluentCart\Framework\Database\Orm\Relations\BelongsTo */ public function product(): \FluentCart\Framework\Database\Orm\Relations\BelongsTo { } public function shippingClass(): \FluentCart\Framework\Database\Orm\Relations\BelongsTo { } /** * Labeled attribute combination for this variation, e.g. "Color: Red | Size: XS". * * Uses the batched `variation_display_title` when * AttributeHelper::attachVariationDisplayTitles() has already resolved it, * and otherwise resolves on demand — so callers get a correct value either * way, and a correctly batched caller costs no extra queries. * * @return string Falls back to the stored variation title. */ public function getVariationLabel(): string { } /** * Full display title for this variation: " - ". * * The catalogue-side counterpart to OrderItem::getDisplayTitle(), which * composes the same shape from a frozen line item. Product feeds, plan * names and CLI output all need the product name alongside the variation, * and each was concatenating it themselves. * * @return string */ public function getDisplayTitle(): string { } /** * One2One: Product Variation belongs to one Product detail * * @return \FluentCart\Framework\Database\Orm\Relations\BelongsTo */ public function product_detail() { } public function media() { } public function product_downloads(): \FluentCart\Framework\Database\Orm\Relations\HasMany { } public function attrRelations(): \FluentCart\Framework\Database\Orm\Relations\HasMany { } public function order_items() { } public function downloadable_files() { } public function upgrade_paths(): \FluentCart\Framework\Database\Orm\Relations\HasMany { } public function attrMap() { } public function getThumbnailAttribute() { } public function scopeGetWithShippingClass(\FluentCart\Framework\Database\Orm\Builder $query) { } public static function boot() { } /** * Check if the product variation can be purchased * * @param int $quantity * @return bool|\WP_Error */ public function canPurchase($quantity = 1) { } public function getSubscriptionTermsText($withComparePrice = false) { } public function getPurchaseUrl() { } public function soldIndividually() { } public function isStock(): bool { } /** * Check if all bundle children are in stock * * @return bool */ protected function isBundleChildrenInStock(): bool { } public function bundleChildren(): \FluentCart\App\Models\Relations\BundleChildrenRelation { } } } namespace FluentCart\App\Models\Query { class QueryParser { use \FluentCart\App\Models\Concerns\CanSearch; static function make(): \FluentCart\App\Models\Query\QueryParser { } public function parse(\FluentCart\Framework\Database\Orm\Builder $query, array $condition) { } private function resolveCondition($condition): string { } public function parseQuery(\FluentCart\Framework\Database\Orm\Builder $query, array $condition, $conditionType = 'and') { } public function handleCondition($query, $condition, $conditionTypeOriginal) { } public function handleOperator($query, $condition, $conditionType = 'and') { } public function handleRelation($query, $condition, $conditionType = 'and') { } } class Sort { static function make(): \FluentCart\App\Models\Query\Sort { } public function apply(\FluentCart\Framework\Database\Orm\Builder $query, array $sortCriteria) { } } } namespace FluentCart\Framework\Support { trait MacroableTrait { /** * The registered string macros. * * @var array */ protected static $macros = []; /** * Register a custom macro. * * @param string $name * @param object|callable $macro * @return void */ public static function macro($name, $macro) { } /** * Mix another object into the class. * * @param object $mixin * @param bool $replace * @return void * * @throws \ReflectionException */ public static function mixin($mixin, $replace = true) { } /** * Checks if macro is registered. * * @param string $name * @return bool */ public static function hasMacro($name) { } /** * Flush the existing macros. * * @return void */ public static function flushMacros() { } /** * Dynamically handle calls to the class. * * @param string $method * @param array $parameters * @return mixed * * @throws \BadMethodCallException */ public static function __callStatic($method, $parameters) { } /** * Dynamically handle calls to the class. * * @param string $method * @param array $parameters * @return mixed * * @throws \BadMethodCallException */ public function __call($method, $parameters) { } } } namespace FluentCart\Framework\Database\Orm\Relations { /** * @mixin \FluentCart\Framework\Database\Orm\Builder */ abstract class Relation { use \FluentCart\Framework\Support\HelperFunctionsTrait; use \FluentCart\Framework\Support\ForwardsCalls, \FluentCart\Framework\Support\MacroableTrait { __call as macroCall; } /** * The Orm query builder instance. * * @var \FluentCart\Framework\Database\Orm\Builder */ protected $query; /** * The parent model instance. * * @var \FluentCart\Framework\Database\Orm\Model */ protected $parent; /** * The related model instance. * * @var \FluentCart\Framework\Database\Orm\Model */ protected $related; /** * Indicates whether the eagerly loaded relation * should implicitly return an empty collection. * * @var bool */ protected $eagerKeysWereEmpty = false; /** * Indicates if the relation is adding constraints. * * @var bool */ protected static $constraints = true; /** * An array to map class names to their morph names in the database. * * @var array */ public static $morphMap = []; /** * Prevents morph relationships without a morph map. * * @var bool */ protected static $requireMorphMap = false; /** * The count of self joins. * * @var int */ protected static $selfJoinCount = 0; /** * Create a new relation instance. * * @param \FluentCart\Framework\Database\Orm\Builder $query * @param \FluentCart\Framework\Database\Orm\Model $parent * @return void */ public function __construct(\FluentCart\Framework\Database\Orm\Builder $query, \FluentCart\Framework\Database\Orm\Model $parent) { } /** * Run a callback with constraints disabled on the relation. * * @param \Closure $callback * @return mixed */ public static function noConstraints(\Closure $callback) { } /** * Set the base constraints on the relation query. * * @return void */ abstract public function addConstraints(); /** * Set the constraints for an eager load of the relation. * * @param array $models * @return void */ abstract public function addEagerConstraints(array $models); /** * Initialize the relation on a set of models. * * @param array $models * @param string $relation * @return array */ abstract public function initRelation(array $models, $relation); /** * Match the eagerly loaded results to their parents. * * @param array $models * @param \FluentCart\Framework\Database\Orm\Collection $results * @param string $relation * @return array */ abstract public function match(array $models, \FluentCart\Framework\Database\Orm\Collection $results, $relation); /** * Get the results of the relationship. * * @return mixed */ abstract public function getResults(); /** * Get the relationship for eager loading. * * @return \FluentCart\Framework\Database\Orm\Collection */ public function getEager() { } /** * Execute the query and get the first result if it's the sole matching record. * * @param array|string $columns * @return \FluentCart\Framework\Database\Orm\Model * * @throws \FluentCart\Framework\Database\Orm\ModelNotFoundException * @throws \FluentCart\Framework\Database\MultipleRecordsFoundException */ public function sole($columns = ['*']) { } /** * Execute the query as a "select" statement. * * @param array $columns * @return \FluentCart\Framework\Database\Orm\Collection */ public function get($columns = ['*']) { } /** * Touch all of the related models for the relationship. * * @return void */ public function touch() { } /** * Run a raw update against the base query. * * @param array $attributes * @return int */ public function rawUpdate(array $attributes = []) { } /** * Add the constraints for a relationship count query. * * @param \FluentCart\Framework\Database\Orm\Builder $query * @param \FluentCart\Framework\Database\Orm\Builder $parentQuery * @return \FluentCart\Framework\Database\Orm\Builder */ public function getRelationExistenceCountQuery(\FluentCart\Framework\Database\Orm\Builder $query, \FluentCart\Framework\Database\Orm\Builder $parentQuery) { } /** * Add the constraints for an internal relationship existence query. * * Essentially, these queries compare on column names like whereColumn. * * @param \FluentCart\Framework\Database\Orm\Builder $query * @param \FluentCart\Framework\Database\Orm\Builder $parentQuery * @param array|mixed $columns * @return \FluentCart\Framework\Database\Orm\Builder */ public function getRelationExistenceQuery(\FluentCart\Framework\Database\Orm\Builder $query, \FluentCart\Framework\Database\Orm\Builder $parentQuery, $columns = ['*']) { } /** * Get a relationship join table hash. * * @param bool $incrementJoinCount * @return string */ public function getRelationCountHash($incrementJoinCount = true) { } /** * Get all of the primary keys for an array of models. * * @param array $models * @param string|null $key * @return array */ protected function getKeys(array $models, $key = null) { } /** * Get the query builder that will contain the relationship constraints. * * @return \FluentCart\Framework\Database\Orm\Builder */ protected function getRelationQuery() { } /** * Get the underlying query for the relation. * * @return \FluentCart\Framework\Database\Orm\Builder */ public function getQuery() { } /** * Get the base query builder driving the Orm builder. * * @return \FluentCart\Framework\Database\Query\Builder */ public function getBaseQuery() { } /** * Get a base query builder instance. * * @return \FluentCart\Framework\Database\Query\Builder */ public function toBase() { } /** * Get the parent model of the relation. * * @return \FluentCart\Framework\Database\Orm\Model */ public function getParent() { } /** * Get the fully qualified parent key name. * * @return string */ public function getQualifiedParentKeyName() { } /** * Get the related model of the relation. * * @return \FluentCart\Framework\Database\Orm\Model */ public function getRelated() { } /** * Get the name of the "created at" column. * * @return string */ public function createdAt() { } /** * Get the name of the "updated at" column. * * @return string */ public function updatedAt() { } /** * Get the name of the related model's "updated at" column. * * @return string */ public function relatedUpdatedAt() { } /** * Add a whereIn eager constraint for the given set of model keys to be loaded. * * @param string $whereIn * @param string $key * @param array $modelKeys * @param \FluentCart\Framework\Database\Orm\Builder|null $query * @return void */ protected function whereInEager(string $whereIn, string $key, array $modelKeys, ?\FluentCart\Framework\Database\Orm\Builder $query = null) { } /** * Get the name of the "where in" method for eager loading. * * @param \FluentCart\Framework\Database\Orm\Model $model * @param string $key * @return string */ protected function whereInMethod(\FluentCart\Framework\Database\Orm\Model $model, $key) { } /** * Prevent polymorphic relationships from being used without model mappings. * * @param bool $requireMorphMap * @return void */ public static function requireMorphMap($requireMorphMap = true) { } /** * Determine if polymorphic relationships require explicit model mapping. * * @return bool */ public static function requiresMorphMap() { } /** * Define the morph map for polymorphic relations and require all morphed models to be explicitly mapped. * * @param array $map * @param bool $merge * @return array */ public static function enforceMorphMap(array $map, $merge = true) { } /** * Set or get the morph map for polymorphic relations. * * @param array|null $map * @param bool $merge * @return array */ public static function morphMap(?array $map = null, $merge = true) { } /** * Builds a table-keyed array from model class names. * * @param string[]|null $models * @return array|null */ protected static function buildMorphMapFromModels(?array $models = null) { } /** * Get the model associated with a custom polymorphic type. * * @param string $alias * @return string|null */ public static function getMorphedModel($alias) { } /** * Get the alias associated with a custom polymorphic class. * * @param string $className * @return int|string */ public static function getMorphAlias(string $className) { } /** * Handle dynamic method calls to the relationship. * * @param string $method * @param array $parameters * @return mixed */ public function __call($method, $parameters) { } /** * Force a clone of the underlying query builder when cloning. * * @return void */ public function __clone() { } } } namespace FluentCart\App\Models\Relations { class BundleChildrenRelation extends \FluentCart\Framework\Database\Orm\Relations\Relation { /** * The JSON column name * * @var string */ protected $jsonColumn; /** * The JSON key that contains child IDs * * @var string */ protected $jsonKey; /** * Create a new BundleChildrenRelation instance. * * @param \FluentCart\Framework\Database\Orm\Builder $query * @param \FluentCart\Framework\Database\Orm\Model $parent * @param string $jsonColumn * @param string $jsonKey * @return void */ public function __construct(\FluentCart\Framework\Database\Orm\Builder $query, \FluentCart\Framework\Database\Orm\Model $parent, $jsonColumn = 'other_info', $jsonKey = 'bundle_child_ids') { } /** * Set the base constraints on the relation query. * * @return void */ public function addConstraints() { } /** * Set the constraints for an eager load of the relation. * * @param array $models * @return void */ public function addEagerConstraints(array $models) { } /** * Initialize the relation on a set of models. * * @param array $models * @param string $relation * @return array */ public function initRelation(array $models, $relation) { } /** * Match the eagerly loaded results to their parents. * * @param array $models * @param \FluentCart\Framework\Database\Orm\Collection $results * @param string $relation * @return array */ public function match(array $models, \FluentCart\Framework\Database\Orm\Collection $results, $relation) { } /** * Get the results of the relationship. * * @return mixed */ public function getResults() { } /** * Get the child IDs from the parent model. * * @return array */ protected function getChildIds() { } /** * Get child IDs from a specific model. * * @param \FluentCart\Framework\Database\Orm\Model $model * @return array */ protected function getChildIdsFromModel(\FluentCart\Framework\Database\Orm\Model $model) { } /** * Add a basic where clause to the query. * * @param string $column * @param mixed $operator * @param mixed $value * @param string $boolean * @return $this */ public function where($column, $operator = null, $value = null, $boolean = 'and') { } } } namespace FluentCart\App\Models { /** * Meta Model - DB Model for Meta table * * Database Model * * @package FluentCart\App\Models * * @version 1.0.0 */ class ScheduledAction extends \FluentCart\App\Models\Model { protected $table = 'fct_scheduled_actions'; protected $primaryKey = 'id'; protected $guarded = ['id']; protected $fillable = ['scheduled_at', 'action', 'status', 'group', 'object_id', 'object_type', 'completed_at', 'retry_count', 'data', 'response_note']; public function setDataAttribute($value) { } public function getDataAttribute($value) { } } /** * Shipping Class Model - DB Model for Shipping Classes * * @package FluentCart\App\Models * @version 1.0.0 */ class ShippingClass extends \FluentCart\App\Models\Model { use \FluentCart\App\Models\Concerns\CanSearch; protected $table = 'fct_shipping_classes'; /** * The attributes that are mass assignable. * * @var array */ protected $fillable = ['name', 'description', 'cost', 'type', 'per_item']; /** * The attributes that should be cast. * * @var array */ protected $casts = ['cost' => 'float']; public function zones(): \FluentCart\Framework\Database\Orm\Relations\HasMany { } } /** * Shipping Method Model - DB Model for Shipping Methods * * @package FluentCart\App\Models * @version 1.0.0 */ class ShippingMethod extends \FluentCart\App\Models\Model { use \FluentCart\App\Models\Concerns\CanSearch; protected $table = 'fct_shipping_methods'; protected $appends = ['formatted_states']; /** * The attributes that are mass assignable. * * @var array */ protected $fillable = ['zone_id', 'title', 'type', 'settings', 'amount', 'is_enabled', 'order', 'states', 'meta']; protected $attributes = ['states' => '[]']; /** * The attributes that should be cast. * * @var array */ protected $casts = ['settings' => 'array', 'states' => 'array', 'is_enabled' => 'boolean']; /** * Get the zone that this method belongs to. */ public function zone(): \FluentCart\Framework\Database\Orm\Relations\BelongsTo { } public function scopeApplicableToCountry($query, $country, $state) { } /** * Get shipping methods applicable to a country, with post-filtering for multi-country selection zones. * * @param string $country * @param string|null $state * @return \FluentCart\Framework\Database\Orm\Collection */ public static function getApplicableForCountry(string $country, $state = null) { } public function getFormattedStatesAttribute() { } public function setMetaAttribute($value) { } public function getMetaAttribute($value) { } } /** * Shipping Zone Model - DB Model for Shipping Zones * * @package FluentCart\App\Models * @version 1.0.0 */ class ShippingZone extends \FluentCart\App\Models\Model { use \FluentCart\App\Models\Concerns\CanSearch; protected $table = 'fct_shipping_zones'; protected $appends = ['formatted_region']; /** * The attributes that are mass assignable. * * @var array */ protected $fillable = ['name', 'region', 'order', 'shipping_class_id', 'meta']; /** * Get the shipping methods for this zone. */ public function methods(): \FluentCart\Framework\Database\Orm\Relations\HasMany { } public function shippingClass(): \FluentCart\Framework\Database\Orm\Relations\BelongsTo { } /** * Check if this zone applies to a given country. * * @param string $country * @return bool */ public function appliesToCountry(string $country): bool { } public function setMetaAttribute($value) { } public function getMetaAttribute($value) { } public function getFormattedRegionAttribute() { } } /** * Meta Model - DB Model for Meta table * * Database Model * * @property string $uuid * * @package FluentCart\App\Models * * @version 1.0.0 */ class Subscription extends \FluentCart\App\Models\Model { use \FluentCart\App\Models\Concerns\HasActivity, \FluentCart\App\Models\Concerns\CanUpdateBatch; protected $table = 'fct_subscriptions'; protected $primaryKey = 'id'; protected $appends = ['url', 'payment_info', 'billingInfo', 'overridden_status', 'currency', 'reactivate_url', 'permissions', 'display_item_name', 'system_charge_state']; protected $guarded = ['id']; protected $fillable = ['customer_id', 'parent_order_id', 'product_id', 'item_name', 'variation_id', 'billing_interval', 'signup_fee', 'quantity', 'recurring_amount', 'recurring_tax_total', 'recurring_total', 'bill_times', 'bill_count', 'expire_at', 'trial_ends_at', 'canceled_at', 'restored_at', 'collection_method', 'trial_days', 'vendor_customer_id', 'vendor_plan_id', 'vendor_subscription_id', 'next_billing_date', 'status', 'original_plan', 'vendor_response', 'current_payment_method', 'config']; public static function boot() { } public function getNextBillingDateAttribute($value) { } public function getCanceledAtAttribute($value) { } public function getExpireAtAttribute($value) { } public function meta() { } public function customer(): \FluentCart\Framework\Database\Orm\Relations\BelongsTo { } public function product(): \FluentCart\Framework\Database\Orm\Relations\BelongsTo { } public function variation(): \FluentCart\Framework\Database\Orm\Relations\BelongsTo { } public function labels(): \FluentCart\Framework\Database\Orm\Relations\MorphMany { } public function license(): ?\FluentCart\Framework\Database\Orm\Relations\HasOne { } public function licenses(): ?\FluentCart\Framework\Database\Orm\Relations\HasMany { } public function transactions(): \FluentCart\Framework\Database\Orm\Relations\HasMany { } public function billing_addresses(): \FluentCart\Framework\Database\Orm\Relations\HasMany { } public function getConfigAttribute($value) { } public function setConfigAttribute($value) { } /** * Customer-facing display name. When the config['item_attributes'] snapshot * resolves it returns the product name with the labeled combination * ("Cake - Flavor: Vanilla | Weight: 500 g"); otherwise the raw item_name * (simple / pre-snapshot subscriptions). * * Presentation-only — it does NOT override the item_name column, so internal * and payment-gateway reads of $subscription->item_name keep the raw stored * value. Use this only at customer-facing display sites. * * The model is passed to the resolver so attribute-display filters (e.g. for * simple-variation / third-party attributes) get the item context they need. * * @return string */ public function getDisplayItemNameAttribute() { } public function getUrlAttribute($value) { } // use this to override the status of the subscription for any custom use case /** * current use case: If the orignal plan(product variation) has no trial days but the subscription status is 'trialing' * it can happens upon discount applied / proration on plan change, * use overriden status to show the correct status for customer */ public function getOverriddenStatusAttribute($value) { } /** * Auto-charge bookkeeping for system subscriptions (attempt count, next retry, * last error, processing marker). Null for every other collection method — * guarded before the meta lookup so manual/automatic subscriptions pay nothing. */ public function getSystemChargeStateAttribute() { } public function getHasPendingSkipAttribute(): bool { } public function getLastSkippedPeriodAttribute() { } public function getBillingInfoAttribute($value) { } public function getPaymentMethodText() { } public function product_detail(): \FluentCart\Framework\Database\Orm\Relations\BelongsTo { } public function order(): \FluentCart\Framework\Database\Orm\Relations\BelongsTo { } public function getBusinessInfoAttribute(): array { } public function getIsReverseChargeTaxOrderAttribute(): bool { } /** * Get the currency for the subscription * * @return string */ public function getCurrencyAttribute(): string { } /** * Get subscription payment info if available * * @return string */ public function getPaymentInfoAttribute(): string { } /** * Get subscription permissions for the current user * Returns what actions can be performed on this subscription * * @return array */ public function getPermissionsAttribute(): array { } /** * Check if this is a manual subscription * * @return bool */ public function isManual(): bool { } /** * Check if this is a system (auto-charged, store-billed) subscription * * @return bool */ public function isSystem(): bool { } /** * Manual and system subscriptions are both billed by FluentCart's invoice * engine (renewal invoices, overdue escalation, admin invoice actions). * System additionally auto-charges a stored token per invoice. * * @return bool */ public function usesRenewalEngine(): bool { } /** * Store-billed (manual/system) with a future due date has nothing to charge yet — * reactivation should flip the subscription active locally instead of checkout. * * @return bool */ public function shouldSubscriptionActiveLocally(): bool { } /** * Helper method to get subscription info * * @return string */ private function getSubscriptionInfo(): string { } public function addLog($title, $description = '', $type = 'info', $by = '') { } public function getDownloads() { } public function getMeta($metaKey, $default = null) { } public function updateMeta($metaKey, $metaValue) { } public function deleteMeta($metaKey) { } public function getLatestTransaction() { } public function canUpgrade() { } public function canUpdatePaymentMethod() { } public function canSwitchPaymentMethod() { } public function switchablePaymentMethods() { } public function canPause() { } /** * A skip is pending when the current upcoming period was reached by an admin * skip that has not yet elapsed — next_billing_date still equals the value the * last skip set. Blocks stacking another skip onto the same pending window. * * @return bool */ public function hasPendingSkip(): bool { } public function canResume() { } public function pauseSubscription($reason = '') { } public function resumeSubscription($reason = '') { } public function canUpdateDetails() { } /** * Update subscription details (for manual subscriptions) * * Allowed fields for manual subscriptions: * - recurring_total: Update the next invoice/payment amount (in cents) * - bill_times: Update the number of billing cycles (0 = unlimited) * - billing_interval: Change billing frequency (daily, weekly, monthly, etc.) * - expire_at: Update expiration date * - trial_days: Update trial period * - next_billing_date: Update next billing date * * @param array $data * @return true|\WP_Error */ public function updateSubscription(array $data) { } /** * Whether this subscription can be reactivated. * * Status-based for BOTH manual and automatic subscriptions — no gateway * supportedFeatures branch on purpose. Manual reactivation is a local status * flip; automatic reactivation runs through the Pro re-checkout flow * (SubscriptionRenewalHandler builds an instant cart and the customer pays * again), which works with any gateway. Gating on a gateway feature here * would hide the customer-facing reactivate URL for Stripe/PayPal/etc. * * @return bool */ public function canReactivate() { } /** * @deprecated Use canReactivate(). Kept as a backward-compatible alias. * @return bool */ public function canReactive() { } public function getReactivationNonceAction() { } public function getReactivateUrl() { } public function getReactivateUrlAttribute() { } public function getViewUrl($type = 'customer') { } public function hasAccessValidity() { } public function reSyncFromRemote() { } public function cancelRemoteSubscription($args = []) { } public function getCurrentRenewalAmount() { } /** * Cycles the remote (vendor) plan must bill at INITIAL checkout. * With a simulated trial the first installment is already collected outside * the remote recurring cycles (one-time charge, paid/free trial cycle), so * the remote plan only needs bill_times - 1. * * Only valid at initial checkout — do NOT use for renewals/reactivation * (payment-method switching also sets is_trial_days_simulated; renewal flows * must use getRequiredBillTimes() which is bill_count based). * * @return int 0 means unlimited */ public function getInitialRemoteBillTimes() { } public function getRequiredBillTimes() { } /** * Canonical bill_count formula. Every writer of bill_count must go through * this — a separate ad hoc count (e.g. StripeGateway\SubscriptionsManager * previously) silently drops the offset/deduction corrections below and * reports a wrong count until the next recompute. * * total > 0 CHARGE transactions linked to this subscription, adjusted for * the two one-time corrections decided at creation (see * CheckoutProcessor::syncInitialCycleCounting): * - billed_cycles_offset: free simulated-trial first cycle consumed a * cycle without producing a total > 0 transaction. * - billed_cycles_deduction: real-trial signup-fee-only charge is a * total > 0 transaction but isn't a billed cycle. */ public function calculateBillCount() { } /** * Installment / split-pay plan: a finite-term subscription (a lifetime * license paid off in a fixed number of charges), as opposed to an * open-ended recurring subscription. The canonical structural signal is * bill_times > 0 (0 = infinite/open-ended). Reused across analytics, * filters and lifecycle handling — do NOT reintroduce title-string * ("Split") matching, which the data does not reliably carry. * * @return bool */ public function isInstallment() { } /** * Installments still owed: 0 for open-ended plans, or once the term is * fully paid. * * @return int */ public function installmentsRemaining() { } /** * Has a finite installment plan collected every scheduled charge (end of * term)? Open-ended plans never reach term end. * * @return bool */ public function hasReachedTermEnd() { } /** * Full committed price of an installment contract: recurring_total x * bill_times, in cents. 0 for open-ended plans (no fixed total). This is * the per-row form of the SUM(recurring_total * bill_times) used by the * subscription analytics aggregate. * * @return int */ public function totalContractValue() { } /** * Filter by plan type: 'installment' (finite term, bill_times > 0), * 'recurring' (open-ended, bill_times = 0) or anything else (no filter). * The bill_times threshold is kept identical to isInstallment() so the SQL * and PHP definitions never drift apart. */ public function scopeOfPlanType($query, $planType) { } public function getReactivationTrialDays() { } public function guessNextBillingDate($forced = false) { } /** * Check and expire subscriptions past their grace period * * This method is called by the hourly scheduler to automatically expire * subscriptions that have missed payments and are past their grace period. * * Processes all candidates in batches to avoid memory issues. * The query example works as follows: * SELECT * FROM subscriptions WHERE status IN ('active', 'trialing', 'canceled', 'expiring', 'past_due') AND next_billing_date IS NOT NULL AND id > 0 -- last processed ID for batch cursor AND next_billing_date < DATE_SUB( '2026-02-17 10:00:00', INTERVAL ( CASE billing_interval WHEN 'daily' THEN 1 WHEN 'weekly' THEN 3 WHEN 'monthly' THEN 7 WHEN 'quarterly' THEN 15 WHEN 'half_yearly' THEN 15 WHEN 'yearly' THEN 15 ELSE 7 END ) DAY ) ORDER BY id ASC LIMIT 100; * * @param int $batchSize Number of subscriptions to process per batch * @return array Statistics about processed subscriptions */ public static function checkAndExpireSubscriptions($batchSize = 100) { } } /** * Order Meta Model - DB Model for Order Meta table * * Database Model * * @package FluentCart\App\Models * * @version 1.0.0 */ class SubscriptionMeta extends \FluentCart\App\Models\Model { protected $table = 'fct_subscription_meta'; protected $fillable = ['subscription_id', 'meta_key', 'meta_value']; public function setMetaValueAttribute($value) { } public function getMetaValueAttribute($value) { } public function product_detail() { } } /** * Meta Model - DB Model for Meta table * * Database Model * * @package FluentCart\App\Models * * @version 1.0.0 */ class TaxClass extends \FluentCart\App\Models\Model { protected $table = 'fct_tax_classes'; protected $primaryKey = 'id'; protected $guarded = ['id']; protected $fillable = ['title', 'meta', 'slug']; protected static function booted() { } protected static function generateUniqueSlug($title, $ignoreId = null) { } public function setMetaAttribute($value) { } public function getMetaAttribute($value) { } } /** * Meta Model - DB Model for Meta table * * Database Model * * @package FluentCart\App\Models * * @version 1.0.0 */ class TaxRate extends \FluentCart\App\Models\Model { protected $table = 'fct_tax_rates'; public $timestamps = false; protected $primaryKey = 'id'; protected $guarded = ['id']; protected $fillable = ['class_id', 'country', 'state', 'postcode', 'city', 'rate', 'name', 'group', 'priority', 'is_compound', 'for_shipping', 'for_order', 'class_id']; protected $appends = ['formatted_state']; public function tax_class() { } public function getFormattedStateAttribute() { } } class User extends \FluentCart\App\Models\Model { protected $table = 'users'; /** * The primary key for the model. * * @var string */ protected $primaryKey = 'ID'; protected $guarded = ['password']; /** * Check if the user has a specific permission. * @param string|array $permission * @return bool */ public function userCan($permission): bool { } /** * Check if the user has a specific permission. * @param string|array $permission * @return bool */ public function userCanAny($permission): bool { } /** * @todo: Move this to Pro Plugin's Controller */ public function setStoreRole($role) { } public function customer(): \FluentCart\Framework\Database\Orm\Relations\HasOne { } } } namespace FluentCart\App\Models\WpModels { class PostMeta extends \FluentCart\App\Models\Model { protected $table = 'postmeta'; /** * The primary key for the model. * * @var string */ protected $primaryKey = 'post_id'; protected $fillable = ['post_id', 'meta_key', 'meta_value']; public function setMetaValueAttribute($value) { } public function getMetaValueAttribute($value) { } } class Term extends \FluentCart\App\Models\Model { use \FluentCart\App\Models\Concerns\CanSearch; protected $table = 'terms'; /** * The primary key for the model. * * @var string */ protected $primaryKey = 'term_id'; public function taxonomy(): \FluentCart\Framework\Database\Orm\Relations\HasOne { } /** * Get the taxonomies for the term */ public function taxonomies() { } /** * Get products associated with this term */ public function products() { } } class TermRelationship extends \FluentCart\App\Models\Model { use \FluentCart\App\Models\Concerns\CanSearch; protected $table = 'term_relationships'; protected $primaryKey = 'term_taxonomy_id'; public function taxonomy() { } public function products() { } } class TermTaxonomy extends \FluentCart\App\Models\Model { use \FluentCart\App\Models\Concerns\CanSearch; protected $table = 'term_taxonomy'; protected $primaryKey = 'term_id'; public function termRelationships() { } /** * Get the term that owns the taxonomy */ public function term() { } /** * Get the parent taxonomy */ public function parent() { } public function taxonomy() { } /** * Get child taxonomies */ public function children() { } /** * Get all relationships for this taxonomy */ public function relationships() { } /** * Get all products for this taxonomy */ public function products() { } } } namespace FluentCart\App\Modules\Coupon { class CouponHandler { public function register() { } public function applyCoupon($appliedCouponList, $orderTotal) { } public function storeAppliedCouponData($appliedCouponList = [], $appliedDiscountsList = [], $orderId = null) { } public function show_coupon() { } } } namespace FluentCart\App\Modules\Data { class ProductDataSetup { protected static $productsCache = []; public function boot() { } public function maybeSetupProductData($post) { } public static function getProductModel($postId) { } public static function setProductsCache($products) { } } class ProductQuery { private array $queryArgs = []; public function __construct($args = []) { } public function getDefaultFilters() { } public function setDefultFilters($filters = []) { } public function getParsedArgs() { } public function getQuery() { } public function get() { } public function getConnectedTerms($types = [], $formatted = true) { } } } namespace FluentCart\App\Modules\IntegrationActions { abstract class BaseIntegrationAction { public string $slug; private static array $actions = []; public function __construct() { } public function init() { } public function registerHooks() { } public function register(): array { } abstract public function handle(); abstract public function getSlug(): string; } class GlobalIntegrationActionHandler { public function register() { } public function init() { } public static function getAll() { } } } namespace FluentCart\App\Modules\Integrations { class AddOnModule { /** * Show the add-ons list. */ public static function showAddOns(): array { } public function updateAddOnsStatus($request): array { } public static function getPremiumAddOns(): array { } public static function getFluentCrm(): array { } // public static function isModuleEnabled($module = 'slack') // { // $globalModules = fct_get_option('fluent_cart_global_integrations'); // return $globalModules && isset($globalModules[$module]) && $globalModules[$module] == 'yes'; // } public static function getFluentSupport() { } } abstract class BaseIntegrationManager { protected $title = ''; protected $description = ''; protected $integrationKey = ''; protected $priority = 10; protected $runOnBackgroundForProduct = true; protected $runOnBackgroundForGlobal = true; public $logo = ''; public $hasGlobalMenu = false; public $category = 'crm'; public $disableGlobalSettings = false; public $installable = ''; public $scopes = ['global', 'product']; public $integrationId = null; public function __construct($title, $integrationKey, $priority = 10) { } final public function register() { } public function getInfo() { } abstract function processAction($order, $eventData); public function actionFields(): array { } public function notify($feed, $order, $customer) { } abstract public function getIntegrationDefaults($settings); abstract public function getSettingsFields($settings, $args = []); public function validateFeedData($data, $args) { } public function isConfigured() { } public function getApiSettings() { } protected function getSelectedTagIds($data, $inputData, $simpleKey = 'tag_ids', $routingId = 'tag_ids_selection_type', $routersKey = 'tag_routers') { } protected function evaluateRoutings($routings, $inputData) { } public function parseSmartCode($text, \FluentCart\App\Models\Order $order) { } } } namespace FluentCart\App\Modules\Integrations\FluentPlugins { class FluentCRMConnect extends \FluentCart\App\Modules\Integrations\BaseIntegrationManager { protected $runOnBackgroundForProduct = false; public function __construct() { } public function maybeSetNameEmailAtCheckout($fields) { } public function isConfigured() { } public function getApiSettings() { } public function getIntegrationDefaults($settings) { } public function getSettingsFields($settings, $args = []) { } /* * For Handling Notifications broadcast */ public function processAction($order, $eventData) { } /** * Internal methods */ private function getTags() { } private function getLists() { } } class FluentCRMDeepIntegration { private $importKey = 'fluent_cart'; public function init() { } /** * @param \FluentCrm\Framework\Database\Orm\Builder|\FluentCrm\Framework\Database\Query\Builder $query * @param array $filters * @return \FluentCrm\Framework\Database\Orm\Builder|\FluentCrm\Framework\Database\Query\Builder */ public function applyAdvancedFilters($query, $filters) { } public function addAdvancedFilterOptions($groups) { } private function applyFilter($query, $filter) { } public function handleProductSelectorAjax($options, $searchTerm, $includedIds = []) { } public function handleProductVariationsAjax($response, $reqestData = []) { } public function pushInfoWidgetToContact($widgets, $subscriber) { } public function getStatsHtml($customer) { } } class FluentCommunityConnect extends \FluentCart\App\Modules\Integrations\BaseIntegrationManager { protected $runOnBackgroundForProduct = false; public $category = 'lms'; public function __construct() { } public function isConfigured() { } public function getApiSettings() { } public function getIntegrationDefaults($settings) { } public function getSettingsFields($settings, $args = []) { } /* * For Handling Notifications broadcast */ public function processAction($order, $eventData) { } } class FluentSupportWidget { public function register() { } public function getPurchaseWidgets($widgets, $customer) { } } } namespace FluentCart\App\Modules\Integrations { class GlobalIntegrationSettings { public function getGlobalSettingsData($request) { } public function authenticateCredentials($request) { } public function saveGlobalSettingsData($request) { } // Get All the feeds for global integrations // This is used in the global integration settings page // It returns all the feeds that are registered with the global scope public function getFeeds() { } public function getNotificationFeeds() { } public function formatFeedsData($feeds): array { } public function formatFeedData($feed) { } // public function updateNotificationStatus($request) // { // $integrations = Arr::get($request, 'addons'); // fct_update_option('fluent_cart_global_integrations', $integrations); // return [ // 'message' => __('Integration successfully updated', 'fluent-cart') // ]; // } public function getIntegrationSettings($args, $feedType = 'global') { } public function prepareFeedData($data, $integrationId, $integrationName, $feedType = 'order_integration') { } public function validate($data, $integrationName) { } public function validateFields(array $fields, array $data): array { } public function saveIntegrationSettings($reuestData) { } public function deleteIntegrationFeed($request) { } public function getIntegrationList($request) { } public function chainedData($requestData) { } public function installPlugin($pluginSlug) { } public function changeStatus($request): array { } } class GlobalNotificationHandler { protected static $customerCache = []; protected static $transactionCache = []; protected static $orderCache = []; protected function getCustomer($customerId) { } protected function getTransaction($orderId) { } protected function getOrder($orderId) { } public function maybeHandleGlobalNotify($order, $customer, $targetHook, $group): void { } public function triggerNotification($feeds, $order, $customer, $targetHook = '', $group = 'integration', $object_type = 'order_integration'): void { } public function handleGlobalIntegration($action, $feed, $order, $customer, $transaction): void { } protected function getFeed($queue, $feedId) { } public function handleGlobalAsyncIntegration($queue): void { } /** * Process notification through global integration manager * * @param string $action * @param \FluentCart\App\Models\Meta|\FluentCart\App\Models\ProductMeta $feed * @param \FluentCart\App\Models\Order $order * @param \FluentCart\App\Models\Customer|null $customer * @param \FluentCart\App\Models\OrderTransaction|null $transaction * @return void */ protected function processNotification(string $action, $feed, \FluentCart\App\Models\Order $order, ?\FluentCart\App\Models\Customer $customer, ?\FluentCart\App\Models\OrderTransaction $transaction): void { } public function processFeedData($order, $feed) { } public function processIntegrationAction($queueId): void { } } class IntegrationHelper { public static function validateAndFormatIntegrationFeedSettings(array $integration, $args = []) { } public static function formatFeedDataForEditing($meta, $args = []) { } } } namespace FluentCart\App\Modules\MCP { /** * Single source of truth for every FluentCart MCP ability. * * Each tool class owns its own `definitions()` slice (schema next to code); * this class merges them, wraps every execute_callback — rejecting undeclared * input params up front and converting unhandled exceptions into structured * WP_Errors the agent can read (instead of the adapter's generic "Tool * execution failed") — and registers each as a WP ability. * * Pro tools are NOT listed here — FluentCart Pro pushes its abilities via the * `fluent_cart/mcp_loaded` action + `fluent_cart/mcp_ability_names` filter. */ class AbilitiesRegistrar { /** Tool classes that expose a static definitions() method. */ private static function toolClasses() { } public static function getDefinitions() { } public static function register() { } /** * Register one ability definition with the Abilities API. Kept separate * from register() so its try/catch stays a thin skip-and-continue shell. */ private static function registerAbility($name, $definition) { } /** * Translate a tool's readable snake_case behavior hints into the MCP tool * annotation keys clients actually read. * * Tool classes declare intent as readonly / destructive / idempotent / * open_world / title. The MCP spec names them readOnlyHint / destructiveHint * / idempotentHint / openWorldHint, and the WP MCP adapter forwards * meta.annotations VERBATIM (it does not translate), so an unmapped * 'readonly' key would never reach a client as a real hint. Unknown keys * (e.g. a stray 'bulk') are dropped rather than emitted as noise a client * cannot act on. * * @param array $annotations snake_case behavior hints from the tool definition * @return array MCP-standard annotation keys */ private static function mapAnnotations($annotations) { } /** * Reject any input param this tool does not declare, instead of executing * with it silently dropped. input_schema sets no additionalProperties, so an * unknown key would otherwise pass validation and the agent would get a * full, plausible-looking result that is NOT filtered the way it asked — * the worst failure mode for an agent (a wrong number reads as a right one; * an error is recoverable). Sibling tools also name overlapping concepts * differently (list-orders: created_after/type; query-orders: start_date/ * order_type dimension), so carried-over names are a common, realistic slip, * not a rare typo. The error lists the accepted params so the agent can * self-correct in one step — richer than the schema validator's message, * which is why this is enforced here rather than via additionalProperties. * * @param string $toolName * @param mixed $params the raw input params * @param array $declaredParams input_schema property names this tool declares * @return \WP_Error|null null when all params are declared */ private static function rejectUnknownParams($toolName, $params, $declaredParams) { } /** * Append a meta.warnings entry when a requested per_page exceeded the tool's * ceiling and was clamped (the descriptions state each cap, but a stated cap * still deserves a runtime signal — the agent asked for 500 rows and must * know it got a 100-row page, not the full set). Detected generically by * comparing the request against meta.page.per_page, so every list and * query tool is covered without per-tool changes. Untouched when the result * isn't a paged success envelope. * * @param mixed $result the tool's return value * @param mixed $params the raw input params * @return mixed */ private static function annotateClampedPerPage($result, $params) { } /** * Convert any unhandled \Throwable from a tool into a structured WP_Error * carrying the real message (and, under WP_DEBUG, the file + a short trace). * Without this the agent only sees the adapter's generic failure surface and * retries blindly against tools that may have partially succeeded. */ private static function wrapExecuteCallback($toolName, $callback, $declaredParams = []) { } } /** * Bootstrap for FluentCart's Model Context Protocol (MCP) integration. * * Wires the WordPress Abilities API (core 6.9+) + the WP MCP Adapter, which is * provided by FluentHub (bundled) or the standalone mcp-adapter plugin — * whichever is present. FluentCart bundles nothing; it consumes whatever's * loaded. If neither is available we surface an admin notice rather than fail * silently. * * The whole surface is gated behind the `mcp_enabled` option (default off) — a * store owner turns it on in Settings → MCP and creates an application * password. Even when on, the endpoint stays behind WP auth + a FluentCart * role (transport gate) + per-ability permission checks. * * Instantiated from app/Hooks/actions.php under a `function_exists` + * `PermissionGate::isEnabled()` guard. */ class MCPInit { const SERVER_ID = 'fluent-cart'; /** * Bootstrap entry point, called once from app/Hooks/actions.php. * * MCP ships OFF; it's enabled in Settings → Features & addon → MCP. The * server itself is instantiated only when enabled, so there is zero overhead * by default. The Abilities-API / MCP-Adapter hooks inside init() fire only * when those systems are present (WP 6.9+ and FluentHub / mcp-adapter). * * Toolkit discovery and the settings card are registered UNCONDITIONALLY: * FluentHub needs to list FluentCart on its MCP page even while disabled * so the operator can toggle it on, and the card must be reachable to flip * the switch. Both are lightweight add_filter calls — no-ops unless applied. */ public static function boot() { } public function init() { } public function registerCategory() { } public function registerAbilities() { } /** * Register the dedicated FluentCart MCP server. Endpoint defaults to * /wp-json/fluent-cart/mcp (sibling to, but distinct from, the admin REST * namespace so it doesn't get caught by that policy stack). * * @param object $adapter The \WP\MCP\Core\McpAdapter instance. */ public function registerCustomServer($adapter) { } /** * Announce FluentCart to FluentHub's MCP page (Settings → MCP). * * FluentHub hardcodes FluentCRM but discovers every other product * through the `fluent_kit/mcp_products` + `fluent_kit/mcp_toggle_handlers` * filters. Without these, FluentCart's server is fully functional yet never * appears in the Toolkit's list — which is exactly the symptom here. * * Runs UNCONDITIONALLY (even when MCP is OFF) so the operator can see the * card and flip it on from the Toolkit; the toggle handler maps that switch * onto our `mcp_enabled` option. Both filters are cheap no-ops unless the * Toolkit actually applies them, so there's no cost when it's absent. */ public static function registerWithToolkit() { } /** * Register the MCP card on Settings → Features & addon. Runs UNCONDITIONALLY * (even when MCP is OFF) so the operator can find it and turn it on. The card * renders the McpSettings.vue component, which drives the settings/mcp* REST * endpoints (instant toggle + connection helpers) rather than the generic * module-settings save — though the on/off flag itself lives under the `mcp` * key of the shared modules blob (see PermissionGate::isEnabled/setEnabled). */ public static function registerModuleSettings() { } /** * Count of abilities the server exposes, including any pushed by Pro via the * `fluent_cart/mcp_ability_names` filter. Mirrors how the Toolkit counts * FluentCRM's tools. */ public static function toolsCount() { } /** Status key the Toolkit renders on the FluentCart card. */ public static function toolkitStatus() { } /** Stable endpoint URL for the Settings UI + connection-snippet generator. */ public static function getEndpointUrl() { } /** True when an MCP adapter + the Abilities API are both available. */ public static function adapterAvailable() { } public function maybeShowAdapterNotice() { } } } namespace FluentCart\App\Modules\MCP\Support { /** * Bridge between MCP tools and the admin UI's advanced filter engine * (BaseFilter + per-entity subclasses) — the same condition-group search the * admin list pages offer. * * Why a bridge instead of passing the raw payload through: the engine SILENTLY * skips malformed conditions (parseSearchGroups drops them) and SILENTLY * no-ops without Pro (applyAdvancedFilter early-returns) — both are the * "confidently wrong result" failure mode an agent can't detect. So this class * (1) validates every condition against the entity's live catalog and returns * a structured error the agent can self-correct from, (2) errors loudly when * Pro is absent, and (3) lets the agent send a lean {property, operator, * value} triple — the engine-internal fields (filter_type, relation, column) * are filled in from the catalog, never trusted from input. * * The catalog is derived live from each filter's advanceFilterOptions() * through the same `fluent_cart/{name}_filter_options` hook the engine itself * applies, so Pro/add-on providers (license, labels) appear automatically and * the schema can never drift from what actually executes. */ class AdvancedSearch { const MAX_GROUPS = 5; const MAX_CONDITIONS_PER_GROUP = 10; // Upper bound on the number of values inside a single condition, so a huge // whereIn / in_all fan-out cannot be built from one condition. const MAX_VALUES_PER_CONDITION = 100; // Catalog operator labels the SQL layer can't execute, mapped to what it // can (searchFromString would emit WHERE col equals ... otherwise). // Applied on non-custom conditions only: custom callbacks (searchByFullName, // searchByPayerEmail) consume their advertised labels verbatim. const OPERATOR_ALIASES = ['equals' => '=', 'not_equals' => '!=']; /** * Entities that expose advanced search, keyed by the public MCP name. * Each maps to its admin filter class, the capability that gates reading * it, and the list tool that accepts advanced_filters. * * @return array */ public static function entities(): array { } /** Entity names, for input_schema enums. */ public static function entityNames(): array { } private static function licensingAvailable(): bool { } // ----------------------------------------------------------------- // Schema (what get-search-schema returns) // ----------------------------------------------------------------- /** * The agent-facing search schema for one entity: every filterable property * with its operators, value type, options and hints, plus the payload * format and a worked example. * * @param string $entity * @return array|\WP_Error */ public static function schemaFor($entity) { } // ----------------------------------------------------------------- // Query building (what the list tools call) // ----------------------------------------------------------------- /** * Validate an agent-supplied advanced_filters payload and return a query * for the entity with the condition groups applied — ready for the calling * tool to add its own named filters, eager loads, sort, and pagination. * * @param string $entity * @param mixed $raw the advanced_filters input * @return array|\WP_Error { query: Builder, warnings: string[] } */ public static function buildQuery($entity, $raw) { } // ----------------------------------------------------------------- // Catalog — live property map per entity // ----------------------------------------------------------------- /** * Status properties whose admin dropdown is a curated subset of the values * the column can actually hold, mapped to the canonical enum that completes * them. The admin UI ships the short list on purpose (those are the statuses * a merchant filters by day to day); an agent needs the full set, because * "find the failed orders" is a normal question and the engine executes * WHERE status IN (...) against the raw column either way. * * MCP-side only — the shared fluent_cart/{name}_filter_options hook is left * untouched so the admin dropdowns keep their curated lists. */ const CANONICAL_OPTIONS = ['orders.order.status' => 'order_statuses', 'orders.order.payment_status' => 'payment_statuses', 'orders.order.type' => 'order_types', 'subscriptions.subscription.status' => 'subscription_statuses', 'subscriptions.subscription.billing_interval' => 'billing_intervals']; /** * provider.property => { provider, property, def } for one filter class, * through the same fluent_cart/{name}_filter_options hook the engine * applies, so Pro/add-on providers appear here exactly as they execute. * * $entity is used only to complete curated status option lists from the * canonical enums (see CANONICAL_OPTIONS); pass it so the schema the agent * reads and the values normalize() accepts stay the same list. */ private static function catalog($filterClass, $entity = ''): array { } /** * Union a curated status dropdown with its canonical enum, preserving the * catalog's labels for the values it already had. Returns the definition * unchanged for every property without a canonical counterpart. */ private static function completeOptions($entity, $key, array $def): array { } /** Money columns for the entity, so values can be documented/validated as store-currency decimals. */ private static function centColumnsFor($filterClass): array { } /** The column the engine will actually compare (relation column, explicit column, or the property itself). */ private static function effectiveColumn(array $def) { } /** Normalize the catalog's UI widget type into an agent-facing value kind. */ private static function valueKind(array $def, array $centColumns): string { } /** * The operators a property accepts — the same resolution the admin filter * UI applies (custom operator map first, then by widget type), constrained * to what the SQL layer actually executes. */ private static function resolveOperators(array $def): array { } // ----------------------------------------------------------------- // Validation + translation to the engine payload // ----------------------------------------------------------------- /** * Validate the raw agent payload and translate it into the exact structure * BaseFilter::parseSearchGroups() consumes. Returns * { groups: array, warnings: string[] } or a WP_Error naming the first * offending condition — never a silently-trimmed payload. */ private static function normalize($entity, $filterClass, $raw) { } /** True when every element looks like a condition object (flat list form). */ private static function isConditionList(array $raw): bool { } /** * Validate one condition and build the engine item. The engine-internal * fields (filter_type / relation / column) always come from the catalog * definition, never from the caller. * * @return array|\WP_Error */ private static function normalizeCondition($entity, $condition, array $catalog, array $centColumns, $groupNo, $conditionNo, array &$warnings) { } /** * Coerce/validate the value for the property's kind. Numeric scalars are * stringified deliberately: HandleRelationalFilter silently drops values * that are neither string nor array, so an integer 0 through a relation * filter would otherwise vanish without a trace. * * @return mixed|\WP_Error */ private static function normalizeValue(array $def, array $centColumns, $property, $operator, $value, array &$warnings) { } /** Cap a per-condition value array so a huge whereIn / in_all fan-out can't be built. */ private static function capValueArray($property, array $values, array &$warnings): array { } /** * The engine's mergeRelationFilters() unions same relation+property 'in' * conditions within a group into one whereIn (OR), which contradicts the * "conditions within a group are AND-ed" contract. Warn once per property so * the agent knows to use in_all for AND semantics. */ private static function warnOrMergedRelations(array $engineGroup, array &$warnings) { } /** A value outside the documented options isn't fatal (the engine matches it as-is) — but say so. */ private static function warnUnknownOption($property, array $values, array $known, array &$warnings) { } // ----------------------------------------------------------------- // Errors & hints // ----------------------------------------------------------------- private static function unknownEntityError($entity) { } private static function structureError($entity) { } private static function limitError($entity) { } private static function valueError($property, $expected) { } private static function idListHint(array $def): string { } /** Flatten a nested {value,label,children} option tree to a bounded [{id,label}] list. */ private static function flattenTree($tree, $cap = 100): array { } /** A worked, copy-adaptable example per core entity (null for add-on entities). */ private static function exampleFor($entity) { } } /** * FluentCRM contact context on the MCP's single-record customer and order tools. * * The admin already shows this: FluentCRM injects a "Contact Info" widget into * FluentCart's single-customer and single-order sidebars (its CustomerWidget * hooks `fluent_cart/widgets/customer` and `fluent_cart/widgets/single_order_page`). * An agent reading the same records over MCP saw none of it and had no tool to * ask for it, so "is this buyer subscribed, and what has marketing sent them?" * was unanswerable — the exact question the widget exists to answer. * * Shape follows that widget: contact status, lists, tags, and the emails/opens/ * clicks engagement counters, plus the CRM profile URL. * * Layering: * - The compact identity block (contact_id, status, contact_type, profile_url) * rides along on every get-customer / get-order call — ONE query, and it is * what makes the contact discoverable at all. * - lists, tags and engagement cost five more queries, so they arrive only on * include[] = crm_contact. Same key, more fields — never a second shape. * * Reading CRM models from FluentCart follows the existing precedent in * app/Modules/Integrations/FluentPlugins/FluentCRMDeepIntegration.php, and the * whole surface is gated on FluentCRM's own `fcrm_read_contacts` capability * through its PermissionManager — the same check the widget makes — so MCP can * never expose CRM data to a role the CRM itself would refuse. */ class CrmContact { const SECTION = 'crm_contact'; /** * FluentCart detects FluentCRM by the FLUENTCRM constant everywhere else * (Services/Integration.php, FluentCRMConnect::isConfigured, AddonsController). * The model + PermissionManager checks additionally guard against a partially * booted CRM, since we read both directly. */ public static function isAvailable() { } /** * Wire the section into both single-record tools. Called from MCPInit::init(). * * The availability check CANNOT run here: MCPInit boots from * app/Hooks/actions.php at plugin-file load time, and WordPress loads plugin * files alphabetically — fluent-cart before fluent-crm — so FLUENTCRM is not * defined yet and every check would report FluentCRM absent on a site that * has it. Defer to plugins_loaded, by which point every plugin file has run. * This is the same reason Services/Integration.php defers its own * defined('FLUENTCRM') gate to a later hook. * * Still early enough: the include[] enum is read when definitions() runs on * wp_abilities_api_init (fired from `init`), and the data filters fire at * request time — both after plugins_loaded. */ public static function register() { } /** Attach the hooks, once FluentCRM is known to be loaded. */ public static function registerNow() { } /** * @param array $sections * @return array */ public static function addSection($sections) { } /** * @param array $data the get-customer payload * @param array $context { customer: Customer, include: string[] } * @return array */ public static function attachToCustomer($data, $context) { } /** * The order's buyer is the contact. The customer relation is already loaded * by getOrder(); a guest order with no customer row simply has no contact. * * @param array $data the get-order payload * @param array $context { order: Order, include: string[] } * @return array */ public static function attachToOrder($data, $context) { } private static function wantsFull($context) { } /** * @param array $data * @param \FluentCart\App\Models\Customer $customer * @param bool $full * @return array */ private static function attach($data, $customer, $full) { } /** * Match a FluentCart customer to a CRM contact. * * Email first, so this can never disagree with the admin widget (which * matches on email alone). user_id is a fallback for the case the widget * misses: a buyer whose CRM contact was created under a different email but * the same WordPress account. * * @param \FluentCart\App\Models\Customer $customer * @return object|null */ private static function resolve($customer) { } /** * CRM timestamps, shifted to UTC. * * FluentCRM writes its timestamps with current_time('mysql') — WordPress * SITE time — and its ORM hydrates them carrying the site offset. Every other * date in an MCP payload is UTC (FluentCart stores GMT), and the store * context tells agents dates are ISO-8601 UTC. Passing these through * unconverted would put a contact's last_activity and an order's created_at * on different clocks in the same response — off by the site's offset, with * nothing in the payload to reveal it. * * @param mixed $value * @return string|null */ private static function utcDate($value) { } /** Lists/tags as {id, title} — the shape the admin widget renders as chips. */ private static function terms($collection) { } /** * Email engagement, with the two rates the widget computes in the browser * done here instead — an agent comparing "opens" across contacts with * different send volumes needs the rate, not the raw count. * * @param object $contact * @return array|null null when the CRM cannot produce stats for this contact */ private static function engagement($contact) { } } /** * Shared formatting + validation utilities for the FluentCart MCP module. * * Mirrors FluentCRM's MCPHelper role: every tool funnels its output through * here so responses are uniform, token-lean, and safe for an AI agent to * reason over. Three rules this file enforces everywhere: * * 1. Money leaves the boundary exactly once, never as raw cents. Detail * views get {amount, amount_cents, currency, display}; list rows get a * compact decimal + a shared meta.currency (see money() vs moneyCompact()). * 2. Dates are ISO-8601 UTC strings — never the raw DB datetime, never a * timezone-ambiguous value. * 3. Every successful tool returns the same envelope: a one-line `summary` * the agent can quote, the `data`, and `meta` (schema_version, paging, * currency, warnings, truncation). Errors return WP_Error so the adapter * surfaces them as isError results the agent can self-correct against. */ class MCPHelper { const SCHEMA_VERSION = '1.0'; // Default per-tool ceiling. Individual tools may opt up to HARD_MAX_PER_PAGE // when their rows are compact (see pagination()'s $maxPerPage). const MAX_PER_PAGE = 100; // Absolute ceiling no tool can exceed, however large a per_page it requests. const HARD_MAX_PER_PAGE = 200; const PREVIEW_CHARS = 150; /** * The canonical success envelope. Returning an array (not echoing) lets the * MCP Adapter serialize it into structuredContent + a text digest. * * @param string $summary One human-readable line. The agent quotes this; it * should answer the question, not restate the schema. * @param mixed $data The payload. * @param array $meta Merged into the meta block (paging, range, etc.). */ public static function envelope($summary, $data, array $meta = []) { } /** * Structured, self-correcting error. `code` is a stable machine string the * agent can branch on; `message` says what went wrong + what was expected; * `details` can carry hint / required_permission / current_state / next_tool. */ public static function error($code, $message, array $details = []) { } // ----------------------------------------------------------------- // Output schema (advertised to clients; not validated server-side) // ----------------------------------------------------------------- /** * JSON Schema fragment for the full money object returned by money(). Inlined * by each tool's output_schema (rather than a $ref) so it never depends on the * client validator resolving $defs across JSON-Schema draft versions. * * @return array */ public static function moneyDef() { } /** * JSON Schema for the shared meta block. Permissive (extra keys allowed) so a * tool can add its own meta (mode, date_basis, page, warnings, …) without a * client that validates structuredContent tripping on the extras. * * @param array $extraProps additional documented meta properties for this tool * @return array */ public static function metaSchema(array $extraProps = []) { } /** * Wrap a `data` schema in the canonical { summary, data, meta } envelope every * tool returns. * * `data` keys are DESCRIBED but not required: the fields[] projection may prune * them and summary_only omits records, so a client should treat declared data * keys as optional. The adapter advertises this to the model but does not * validate results against it, so it is documentation, not a runtime gate. * * @param array $dataSchema JSON Schema for the tool's data payload * @param array $metaProps extra documented meta properties * @return array */ public static function envelopeSchema(array $dataSchema, array $metaProps = []) { } // ----------------------------------------------------------------- // Money // ----------------------------------------------------------------- /** * Full money object for detail views. The agent never does cents math and * never mis-renders: `amount` is the decimal number for comparisons, * `display` is the ready-to-quote string. * * @param int|null $cents * @param string|null $currencyCode Falls back to the store currency. */ public static function money($cents, $currencyCode = null) { } /** * Formatted, agent-readable money string. Helper::toDecimal HTML-encodes the * currency sign (e.g. "$19.99"); we decode it so the agent sees "$19.99". */ public static function displayAmount($cents, $currencyCode = null) { } /** * Compact money for list rows: just the decimal number. The currency lives * once in meta.currency, so we don't repeat it on every row (token saving). * Only fall back to the full object when a result set spans currencies. */ public static function moneyCompact($cents) { } public static function currencyCode() { } /** * Full currency descriptor for get-store-context, so the agent can format * money itself when it wants to (zero-decimal currencies, separators, etc.). */ public static function currencyContext() { } // ----------------------------------------------------------------- // Dates // ----------------------------------------------------------------- /** * Normalize any stored datetime to an ISO-8601 UTC string. Accepts a * DateTime, a {date,timezone} object, or a Y-m-d H:i:s string (DB values * are GMT). Returns null for empty input so the key stays present. */ public static function toIso8601($value) { } // ----------------------------------------------------------------- // Text // ----------------------------------------------------------------- /** Strip HTML/markup to clean plain text — agents reason better over text than markup. */ public static function htmlToText($html) { } /** Truncated preview for list rows so descriptions/notes don't blow context. */ public static function preview($html, $chars = self::PREVIEW_CHARS) { } // ----------------------------------------------------------------- // Pagination // ----------------------------------------------------------------- /** * Clamp page/per_page from agent input. Defaults small (15) and caps at 100 * so a careless `per_page: 5000` can never flood the context window. * * $maxPerPage lets a specific tool raise its own ceiling above the shared * default (e.g. compact subscription rows tolerate 200) without lifting the * cap for every other list tool. It is itself clamped to MAX_PER_PAGE so a * caller can never push past the global guardrail. * * @return array{page:int, per_page:int} */ public static function pagination($params, $defaultPerPage = 15, $maxPerPage = self::MAX_PER_PAGE) { } /** * Build the meta.page block from a FluentCart Paginator (which exposes * current_page / per_page / total / last_page). Gives the agent everything * it needs to decide whether to fetch the next page. */ public static function pagingMeta($paginator) { } /** Total row count from a Paginator (uses ->total() method; array fallback). */ public static function paginatorTotal($paginator) { } /** Pull the row models out of a Paginator regardless of its concrete shape. */ public static function paginatorItems($paginator) { } // ----------------------------------------------------------------- // People / labels // ----------------------------------------------------------------- // ----------------------------------------------------------------- // Field selection // ----------------------------------------------------------------- /** * Project a record down to a caller-requested subset of top-level keys, to * shrink heavy payloads. Returns the record UNCHANGED when $fields is empty * or not an array (the default, backward-compatible behavior). Only keys that * actually exist are kept, in the record's own order; unknown requested keys * are ignored. Keys in $alwaysKeep (the record's identifier) are retained * regardless so a projected record is never anonymous. * * @param array $row * @param mixed $fields array of key names, or null/non-array for "all" * @param array $alwaysKeep keys to keep even if not requested (e.g. the id) */ public static function pickFields($row, $fields, array $alwaysKeep = []) { } /** "First Last " style name from a customer/person-ish model. */ public static function personName($model) { } } /** * Pure forward billing projection, shared by get-product-financials (via * ProductFinancialsCalculator) and get-upcoming-payments. Given per-subscription * anchors (next_billing_date), normalized intervals and finite remaining-bill * caps, it walks each subscription forward from as_of to a horizon and sums the * expected charges into calendar buckets — separating finite (split-pay) * installments from open-ended recurring renewals. * * The billing rules it encodes (single source of truth for both tools): * - Anchor on next_billing_date, never created_at. * - Step by the subscription's own interval. * - A finite (bill_times > 0) subscription stops after its remaining bills; * a perpetual one runs to the horizon. * * No WordPress, no models — plain arrays of integer cents, so it is unit-tested * without a database and both callers get identical numbers. * * PHP 7.4 safe: no null-safe, no match, no named args, no enums, no union types. */ class PaymentProjector { /** Seconds in a day (WP's DAY_IN_SECONDS may be absent when run outside WordPress). */ const DAY_SECONDS = 86400; /** Hard per-sub iteration cap (daily over 12 months ~ 366) so a bad interval/anchor can't spin. */ const MAX_EVENTS = 4000; /** * Project a set of subscription descriptors onto calendar buckets. * * A descriptor is: * [ * 'settlement' => 'finite'|'perpetual', * 'interval' => normalized interval string (monthly|quarterly|…), * 'recur' => int cents per charge, * 'remaining_bills' => int (finite) | -1 (perpetual/unbounded), * 'anchor' => 'Y-m-d H:i:s' UTC next-bill anchor, * ] * * @param array $projSubs descriptors (see above) * @param int $asOfTs unix ts — never bill before this instant * @param int $horizonEndTs unix ts — never bill after this instant * @param string $bucket 'day' | 'week' | 'month' * * @return array{ * buckets: array, * recurring_next_30d:int, recurring_next_90d:int, by_interval_next_30d: array * } buckets are period-sorted; the next_30d/90d scalars are relative to as_of. */ public static function project(array $projSubs, $asOfTs, $horizonEndTs, $bucket) { } /** * DateInterval-style modifier to advance one cycle. Calendar months for * monthly+, days for weekly/daily, a 30-day fallback for unknowns so an * unrecognized interval still projects rather than looping forever. Expects a * value already run through ProductFinancialsCalculator::normalizeInterval. */ public static function advanceModifier($interval) { } } /** * Maps MCP abilities to FluentCart's existing capability model. The MCP user * IS a WordPress user with a FluentCart shop role (super_admin / manager / * worker / accountant), so we never invent a parallel permission system — we * reuse PermissionManager, the same check the admin REST routes use. * * Two layers: * - transport(): can this user reach the FluentCart MCP endpoint at all? * - can()/canAny(): per-ability permission_callback gating. * * Annotations are UX hints only; THIS is the enforcement boundary. */ class PermissionGate { /** Per-ability check. Used inside permission_callback closures. */ public static function can($permission) { } /** True if the user holds ANY of the given capabilities. */ public static function canAny(array $permissions) { } /** * Transport gate for the `fluent-cart` server. Reaching the endpoint at all * requires (a) the feature is enabled and (b) the user holds at least a * read-level FluentCart role. The adapter's default is merely * current_user_can('read'), which is too loose for commerce data. * * Per-ability permission_callback still runs on top — a viewer who reaches * the endpoint still can't refund or mutate. */ public static function transport($request = null) { } /** * Any one of these means "has at least a FluentCart role." Kept as a method * (not a const) so it can grow without touching call sites. */ public static function readRoleCaps() { } /** Write-level caps — used by the optional two-server (admin) hardening. */ public static function writeRoleCaps() { } /** * The master on/off switch. Ships OFF; enabled from Settings → Features & * addon → MCP. * * Stored under the `mcp` key of the shared `fluent_cart_modules_settings` * option (autoloaded, so reading it here costs no extra query on init — * unlike a dedicated meta option, which the boot guard would query on every * request). Persisted via setEnabled(). */ public static function isEnabled() { } /** * Persist the master switch into the shared modules blob. Reads the RAW * option (not the defaults-merged view) and rewrites only the `mcp` key so * no other module's settings are touched. */ public static function setEnabled($enabled) { } } /** * Pure financial math for get-product-financials. NO WordPress, NO models, NO * __() — every method takes plain arrays and returns plain arrays of integer * cents, so the full spec §9 test matrix runs without a database. The tool * layer (ProductFinancialsTools) loads rows, normalizes them, calls compute(), * and wraps the cents through MCPHelper::money(). * * PHP 7.4 safe: no null-safe, no match, no named args, no enums, no union types. * * A normalized subscription row is: * [ * 'billing_interval' => 'monthly'|'quarterly'|'half_yearly'|'yearly'|'weekly'|'daily'|, * 'recurring_total' => int (cents), * 'bill_count' => int, * 'bill_times' => int, // 0 => perpetual, >0 => finite * 'status' => string, * 'next_billing_date' => 'Y-m-d H:i:s' (UTC) | null, * ] * * Settlement is derived from bill_times here (single source of truth) — callers * never pass it, exactly as Subscription::isInstallment() decides it. */ class ProductFinancialsCalculator { /** Average days in a Gregorian month; keeps $150/half_yearly and $300/yearly both at $25 MRR. */ const DAYS_PER_MONTH = 30.436875; /** Seconds in a day (WP's DAY_IN_SECONDS may be absent when run outside WordPress). */ const DAY_SECONDS = 86400; /** Statuses that never collected real money — excluded from every money figure. */ const NON_COLLECTING = ['intended', 'pending']; /** Canonical status set, seeded to 0 so status_breakdown is always complete. */ const STATUS_KEYS = ['active', 'trialing', 'paused', 'canceled', 'failing', 'expired', 'expiring', 'past_due', 'intended', 'pending', 'completed']; /** * Map an input interval onto the store's canonical value. Accepts the v1 * spec aliases (semiannual, annual) for caller convenience; passes real * values through untouched. */ public static function normalizeInterval($interval) { } /** * Split subscription rows into the ones matching $currency and the sorted, * de-duplicated list of OTHER currencies present. Comparison is * case-insensitive (gateways store 'usd'; we report 'USD'). Rows without a * currency are treated as the report currency (store default). Never mixes * currencies — the tool feeds only the kept rows to compute() and surfaces * the others in meta.other_currencies. * * @return array{0: array, 1: array} [keptRows, otherCurrencies] */ public static function filterByCurrency(array $rows, $currency) { } /** 'finite' (split-pay) when bill_times > 0, else 'perpetual' (open-ended). */ public static function settlement($billTimes) { } /** * How many months one billing cycle spans, for MRR normalization. Returns * null for an unknown interval so it is excluded from MRR (but still counted * and still projected onto the calendar by its day cadence). */ public static function intervalInMonths($interval) { } /** Normalized monthly run-rate contribution in cents (float). 0 for unknown intervals. */ public static function mrrContributionCents($recurringTotal, $interval) { } /** * Full financial rollup. See class doc for the row shape. $opts: * as_of 'Y-m-d H:i:s' UTC (default now) * horizon_months 3|6|12 (default 12) * bucket 'month'|'week' (default month) * forward_statuses array of statuses that feed forward metrics, or ['all'] * include_schedule bool — emit payment_schedule[] (30d/90d scalars always computed) * one_time ['gross'=>int,'refunds'=>int,'units'=>int,'orders'=>int] | null * * Returns all money as integer cents; the tool wraps it through money(). */ public static function compute(array $subscriptions, array $opts = []) { } /** * Project future charges onto calendar buckets. Returns: * schedule [ {period, finite_installments, recurring_renewals, total_expected} ] * recurring_next_30d/90d int cents of recurring renewals within 30/90 days of as_of * by_interval_next_30d [ interval => int cents ] recurring renewals within 30d */ private static function project(array $projSubs, $asOfTs, $horizonMonths, $bucket) { } } /** * Safety rails for mutating MCP tools. Annotations are UX hints, not safety — * this is where real protection lives for the sensitive writes (refund, cancel). * * Two mechanisms: * * 1. Dry-run + confirmation token. A destructive tool called with dry_run:true * computes the effect, binds it to the entity's CURRENT state (a fingerprint), * stashes a short-lived token, and returns a preview. To actually execute, * the caller passes that confirm_token back. If the entity changed in the * meantime, the fingerprint no longer matches and we force a fresh preview — * so an agent can never act on stale numbers (e.g. refund a balance that was * already refunded by someone else). * * 2. Idempotency keys. The caller passes an idempotency_key; the first execution * for that key is cached, and a retry with the same key returns the cached * result instead of charging/cancelling twice. This is the guard against an * agent re-issuing a refund after a timeout. * * CONTRACT (enforced by convention, not the framework): every ability whose * annotations include `destructive => true` MUST route its mutation through * confirm() (dry-run + confirm_token) and, for gateway/real-money actions, also * liveGatewayAllowed(), before mutating — and MUST expose `dry_run` and * `confirm_token` in its input_schema. Reversible CRUD writes (coupon, customer, * label, order-status) are intentionally NOT marked destructive and rely on * their permission_callback alone. When adding a new destructive ability (here * or in Pro, which registers under the same namespace via fluent_cart/mcp_loaded), * follow this contract — refund-order and change-subscription-status are the * reference implementations. */ class WriteGuard { const CONFIRM_TTL = 300; // 5 minutes to confirm a previewed action. const IDEM_TTL = 86400; // remember an idempotency key for a day. /** * Build a dry-run preview response with a confirmation token bound to the * entity's current state. * * @param string $tool Ability name (namespacing the token). * @param string $entityKey Stable id of the target, e.g. "order:42". * @param string $fingerprint A string capturing the mutable state we care * about (e.g. "paid:8000|refund:0"). If this * differs at execute time, the token is rejected. * @param array $preview The human/agent-facing preview payload. */ public static function preview($tool, $entityKey, $fingerprint, array $preview) { } /** * Validate a confirm_token against the entity's current fingerprint. * Returns true, or a WP_Error the agent can act on. * * @return true|\WP_Error */ public static function confirm($tool, $entityKey, $currentFingerprint, $token) { } /** * Run $fn at most once per idempotency key (per user + tool + entity). A * repeat call with the same key on the SAME entity returns the cached result. * If no key is supplied, $fn runs normally (no dedupe) — keys are recommended * but not forced. * * The key is entity-scoped so reusing one idempotency_key across different * records (e.g. "refund-1" for two orders) can't replay the first entity's * result and silently skip the second mutation. */ public static function idempotent($tool, $entityKey, $key, callable $fn) { } /** * True when a gateway action would hit live (real-money) mode. An unknown or * empty mode is treated as live — we fail safe rather than assume sandbox. */ public static function isLiveMode($paymentMode) { } /** * Gate real-money gateway mutations (refund, cancel). Test/sandbox records are * always allowed; LIVE requires explicit opt-in via the `mcp_allow_live_gateway` * option ('yes') or the `fluent_cart/mcp_allow_live_gateway` filter — so an * agent cannot fire a live refund/cancellation by default, even holding a * valid confirm_token. The dry_run preview still works in either mode. * * @return true|\WP_Error */ public static function liveGatewayAllowed($paymentMode) { } private static function confirmKey($tool, $entityKey) { } private static function idemKey($tool, $entityKey, $key) { } } } namespace FluentCart\App\Modules\MCP\Tools { /** * Discovery tools — the agent's entry point into a FluentCart store. * * `get-store-context` is the documented "call this first" tool. One call tells * the agent who it is, what it's allowed to do, the store's money/time * conventions, headline numbers, and every valid enum value — so it never has * to guess a status string or invent a currency format. It's cached (60s) and * invalidated when reference data changes, because it's called every session. * * `list-reference-data` is the on-demand lookup for the heavier reference lists * (coupons, labels, tax/shipping config) the agent only sometimes needs — kept * OUT of the context payload so the first call stays lean. * * Parameter philosophy: get-store-context takes nothing (zero friction, it's * discovery). list-reference-data takes only `kinds[]` — the agent asks for * exactly the lists it needs, and we return only the kinds its role can see. */ class ContextTools { const CACHE_TTL = 60; const CACHE_PREFIX = 'fluent_cart_mcp_context_'; // Baseline domain enums. The status families are re-read from the canonical // Status helper at runtime by enums() — this literal is only the fallback for // a family Status cannot answer for. Do not hand-maintain the status lists // here: an enum the agent trusts but the column can never hold turns every // filter built from it into a silent zero-row result. const ENUMS = [ // Status::getOrderStatuses() plus PERSISTED_ONLY_ORDER_STATUSES — see that // constant for why the canonical helper is not the whole set. // 'partial-refund' is deliberately absent: unlike the others below, no code // path writes it (the column COMMENT lists it, but nothing persists it). 'order_statuses' => ['draft', 'pending', 'processing', 'completed', 'on-hold', 'canceled', 'failed', 'refunded'], // Kept in sync with Status::getPaymentStatuses(); 'authorized' (card // authorized, not yet captured) and 'payment_scheduled' are valid // persisted statuses and must be listed so clients can filter them. 'payment_statuses' => ['pending', 'paid', 'partially_paid', 'failed', 'refunded', 'partially_refunded', 'authorized', 'payment_scheduled'], // 'none' = no shipping required (e.g. digital orders); reported when the // stored value is empty. It is read-only — change-order-status won't set it. 'shipping_statuses' => ['none', 'unshipped', 'shipped', 'delivered', 'unshippable'], 'order_types' => ['payment', 'renewal', 'subscription'], 'subscription_statuses' => ['pending', 'active', 'failing', 'paused', 'expired', 'expiring', 'canceled', 'trialing', 'intended', 'past_due', 'completed'], // installment = fixed-term split-pay plan (a lifetime license paid off in // a finite number of charges, bill_times > 0); recurring = open-ended // subscription (bill_times = 0). Derived from bill_times, never the title. 'plan_types' => ['installment', 'recurring'], 'billing_intervals' => ['daily', 'weekly', 'monthly', 'quarterly', 'half_yearly', 'yearly'], 'fulfillment_types' => ['physical', 'digital'], 'coupon_types' => ['fixed', 'percentage'], 'order_modes' => ['live', 'test'], ]; /** * Order statuses fct_orders.status genuinely holds that Status::getOrderStatuses() * does NOT list, because that helper answers "what may an admin SET an order to", * not "what can this column contain". * * An enum is wrong in two directions, and only one of them is loud. Listing a * value the column can never hold gives the agent a filter that silently returns * zero rows. OMITTING a value the column does hold is worse: those rows become * unreachable, and because the value is missing from the input_schema enum the * call is rejected outright, so the agent cannot even discover the rows exist. * * Each of these is written by a core path, verified in source: * - draft: the column DEFAULT (database/Migrations/OrdersMigrator.php). * - pending: every store-managed renewal invoice * (StoreManagedRenewal/Services/RenewalService.php:113). * - refunded: the WooCommerce migrator maps wc-refunded to it * (WooCommerceMigrator/Services/OrderMigrationService.php). * * So a store using store-managed renewals, or migrated from WooCommerce, has rows * the five-value helper cannot describe. Keep this list in step with the writers, * not with the admin dropdown. * * Note COD is NOT one of them: a COD checkout creates the order as 'on-hold' and * only its payment_status is pending. Cod::maybeUpdatePayments() looks like an * order-status writer but has no callers. */ const PERSISTED_ONLY_ORDER_STATUSES = ['draft', 'pending', 'refunded']; /** * The enums the agent is told to trust, with every status family re-read from * the canonical Status helper so this payload can never drift from what the * columns actually hold (a drifted enum is worse than a missing one — the * agent builds a valid-looking filter that always returns zero rows). * * Status::get*Statuses() are themselves filtered, so a Pro/add-on status * registered through those hooks shows up here automatically. * * @return array */ public static function enums() { } // Payment statuses that count as realized revenue. Centralized so every // tool (context, reports, aggregates) agrees on what "paid" means. const PAID_STATUSES = ['paid', 'partially_paid', 'partially_refunded']; /** * Ability definitions for this domain. The registrar merges every tool * class's definitions(), so a tool's schema lives next to its code. */ public static function definitions() { } public static function getContext($params = []) { } private static function buildContext($userId) { } /** * Headline numbers. Each metric is isolated in safeCount/safeSum so one * failing query (e.g. a model that doesn't exist on a given install) yields * null for that stat instead of breaking the whole discovery call. */ private static function buildStats() { } private static function safeCount(callable $fn) { } private static function safeMoney(callable $fn) { } /* translators: %1$s: revenue amount, %2$d: orders in 30 days, %3$d: total customers */ private static function summary($stats) { } /** Tells the agent what `kinds` it can pass to list-reference-data. */ private static function referenceKinds() { } /** * Task → tool routing table so an agent picks the right ability among ~30 * without trial and error, grouped by intent (discovery / find / load / * analytics / write). * * Derived from the LIVE registry so a newly registered tool can never * silently go missing — each is annotated with a curated "reach for this * when…" hint, and any tool without one still appears under its label. * Filterable so pro / add-on tools can slot themselves in. */ private static function toolIndex() { } private static function guidelines() { } /** * `list-reference-data` — heavier lookup lists, fetched on demand. * * @param array $params { kinds: string[] } — which lists to return. Each * kind is gated by its own capability; kinds the * caller can't see are reported in `skipped`, not * silently dropped, so the agent knows why. */ public static function listReferenceData($params = []) { } private static function skipWarnings($skipped) { } /** * Each kind is fetched behind a class_exists guard so a model that isn't * present on a given install returns [] rather than fataling. */ private static function fetchReferenceKind($kind) { } /** * Active payment gateways. Each gateway stores its own settings (there is no * single payment_settings option), so we read the registered gateway * instances from the GatewayManager and keep the ones with is_active=yes. */ private static function enabledGateways() { } /** Product categories from the WP taxonomy (best-effort across naming). */ private static function productCategories() { } /** * Clear the cached context for all users. Hooked from MCPInit onto the * events that change anything the context payload reports. */ public static function invalidateCache() { } } /** * Coupon tools (read). * * Parameter design: * - list-coupons filters on status, free-text (code/title), and the common * "which coupons are usable right now?" question via active_now, which * accounts for status + the start/end window in one flag. * - amount is returned raw alongside type, because a percentage coupon's amount * is a percent (10 = 10%) while a fixed coupon's is a currency value — the * agent must read `type` to interpret `amount`. We don't force a money shape * onto a value that may not be money. * * manage-coupon (create/update/deactivate) is a write tool and ships in the * write stage. */ class CouponTools { public static function definitions() { } public static function manageCoupon($params = []) { } private static function couponResult($result, $summary) { } /** * Coupon amount in the units the tool contract promises: a percentage value * for percentage coupons (stored as-is), a store-currency value for fixed * coupons (stored in cents, so divided back). Always numeric. */ private static function couponAmount($coupon) { } /** Validate a coupon amount against its type. Returns true or a WP_Error. */ private static function validateAmount($type, $amount) { } public static function listCoupons($params = []) { } private static function formatRow($coupon, $now) { } private static function validNow($coupon, $now) { } private static function allowed($params, $key, array $allowed, $default) { } private static function total($paginator) { } } /** * Customer tools — find customers, then load one's 360° view. * * Parameter design: * - list-customers filters on the metrics owners actually segment by (LTV, * purchase count, location, first/last purchase window). LTV/min_ltv are in * store currency, not cents. * - AOV is computed (ltv ÷ purchase_count) rather than read from the stored * column, so it's always internally consistent with the LTV we show. * - get-customer is lean by default (profile + metrics); orders, subscriptions, * addresses, labels, notes are opt-in via include[]. with_orders_limit * bounds the order history so a whale's account can't flood context. */ class CustomerTools { public static function definitions() { } /** * The sections get-customer's include[] accepts. Filterable so an add-on that * owns its own customer-scoped entity (Pro's licences, for one) can offer it * as an include instead of forcing the agent into a second list-* call and a * manual join by customer. * * A section added here MUST be populated by a listener on * fluent_cart/mcp_customer_data — an include the schema advertises but * nothing fills is worse than no include at all. * * @return array */ private static function includeSections() { } public static function upsertCustomer($params = []) { } private static function writableFields($params) { } public static function listCustomers($params = []) { } private static function formatRow($customer) { } private static function label($customer, $ltvCents) { } public static function getCustomer($params = []) { } private static function resolve($params) { } private static function addresses($customer) { } private static function addressList($addresses) { } private static function orders($customer, $limit) { } /** * Nested subscription rows. plan_type and the installment counters are the * same derivation list-subscriptions / get-subscription use (bill_times > 0), * carried here because otherwise the only way to tell a lifetime licence paid * in N installments from a genuine recurring plan on this payload was to * string-match "(Split Pay)" in item_name — the two are structurally * identical without it, and they are opposite kinds of revenue. */ private static function subscriptions($customer) { } private static function labels($customer) { } /** * The convenience location string, derived from the customer's primary * billing address rather than the fct_customers city/state/country columns. * * Those columns are a WRITE-ONCE snapshot: CustomerResource::create() seeds * them when the customer row is first inserted and nothing refreshes them * afterwards (CheckoutApi::updateExistingCustomer() deliberately touches only * user_id), and the value seeded at checkout can be the country the frontend * GUESSED from the browser timezone before the buyer typed anything. The * billing address is the value the buyer actually entered, so it wins; the * profile columns are the fallback for a customer with no address row. * * In practice the two rarely conflict — on the 2,320-customer reference store * they never do (zero rows where both are set and differ). What this ordering * buys is correctness when a stale snapshot DOES diverge, plus coverage: 7 * customers there have an address but no profile value, so reading the profile * alone would report no location for a customer whose address is on file. * location_source names which source produced the string, so an agent seeing * `location` next to an `addresses` include can tell whether they should agree. * * @return array { location: string|null, location_source: string|null } */ private static function locationBlock($customer) { } /** * The customer's primary billing address, falling back to any billing address * when none is flagged primary (real stores have both). Relations are checked * before loading so a caller that eager-loaded them (list-customers) pays no * per-row query. */ private static function billingAddress($customer) { } private static function aovCents($ltvCents, $count) { } private static function allowed($params, $key, array $allowed, $default) { } private static function total($paginator) { } private static function toDbDate($value) { } private static function invalidDateError($field) { } } /** * Label tools — the cross-entity tagging system. * * apply-labels attaches/detaches existing labels to an order, customer, or * subscription. It works on label IDs (from list-reference-data with * kind=labels), so it never needs to know how a label's value is stored. * * Parameter design: explicit add/remove delta arrays rather than a "set the * full list" payload — the agent rarely knows the current set, and deltas are * what it actually intends ("tag this order VIP"). We return the resulting set * so the agent can confirm. * * Managing label DEFINITIONS (create/rename/delete the labels themselves) is * deliberately not exposed yet — the underlying value column is a serialized * blob whose shape we don't want an agent guessing at. */ class LabelTools { const TYPE_MAP = ['order' => 'Order', 'customer' => 'Customer', 'subscription' => 'Subscription']; public static function definitions() { } public static function applyLabels($params = []) { } /** * Resolve label IDs to {id, title} so the caller doesn't need a follow-up * reference-data lookup. fct_label keeps its name in a (maybe-serialized) * `value` column — a plain string or an array {title|value, color}. */ private static function resolveLabels(array $ids) { } } /** * Order tools — find orders, then load one fully. * * Read surface (this file): list-orders (compact, filterable), get-order * (one order, include[]-driven), get-order-activity (the audit timeline). * * Parameter design notes for the agent's sake: * - list-orders takes FLAT, enum-constrained filters (status, payment_status, * …) rather than a freeform query object — the model negotiates against the * schema at selection time, so flat + enum means fewer wrong calls. * - Every filter is optional; omitting all returns the latest orders. Money * filters (min_total/max_total) are in store-currency decimals, not cents — * the agent thinks in dollars, we convert. * - get-order accepts a numeric order_id (what list-orders returns) OR a * uuid / invoice_no, so the agent never has to translate identifiers. * - get-order is lean by default (items + customer); heavier sections * (transactions, refunds, coupons, subscriptions, addresses) are opt-in via * include[] so one order can't silently flood the context window. */ class OrderTools { public static function definitions() { } // ----------------------------------------------------------------- // list-orders // ----------------------------------------------------------------- public static function listOrders($params = []) { } private static function applyFilters($query, $params) { } /** * Refund timestamp. Falls back to the latest refund transaction's date when * the order's own refunded_at column is empty but money was refunded — some * refund paths don't stamp the column. */ private static function refundedAt($order) { } /** * Report the shipping status, mapping an empty/NULL stored value to 'none' * (no shipping required — e.g. digital orders) so the value is always a * member of the advertised enum. */ private static function shippingStatusOut($order) { } /** Compact list row — only what's needed to scan and decide which to open. */ private static function formatRow($order) { } /** * Compact "what was ordered" list for list rows: every line item as * product_id, display title (incl. variation), and quantity — enough for the * agent to recognize an order's contents without a get-order round-trip. * Prices and refund/fulfillment detail stay in get-order. Uncapped: a single * order won't realistically carry enough lines to bloat the payload. */ private static function itemsSummary($order) { } /** Human-readable one-liner: "Order INV-1042 — Jane Doe — $89.00 — paid". */ private static function label($order, $customer) { } // ----------------------------------------------------------------- // get-order // ----------------------------------------------------------------- public static function getOrder($params = []) { } /** * The sections get-order's include[] accepts. Filterable so an integration * that owns order-adjacent context (the CRM contact behind the buyer, for * one) can offer it as an include rather than leaving the agent to guess * which other tool holds it. * * A section added here MUST be populated by a listener on * fluent_cart/mcp_order_data — an include the schema advertises but nothing * fills is worse than no include at all. * * @return array */ private static function includeSections() { } private static function resolveOrder($params) { } /** Full money breakdown — every line a money object (decimal + cents + display). */ private static function totals($order) { } private static function customerBlock($order) { } private static function itemsBlock($order) { } private static function addressesBlock($order) { } private static function transactionsBlock($order, $refundsOnly) { } private static function couponsBlock($order) { } private static function subscriptionsBlock($order) { } // ----------------------------------------------------------------- // get-order-activity // ----------------------------------------------------------------- public static function getOrderActivity($params = []) { } /** Classify an activity-log row into a coarse timeline event kind. */ private static function activityEvent($row) { } /** * Classify an activity row's money kind from its title so its amount can be * backfilled from the matching transaction. Title-only (not content) to avoid * false positives like a note that merely mentions "refund". */ private static function activityMoneyKind($title) { } /** * Amount of the transaction closest in time to $ts, from a pool of * ['ts' => int|null, 'amount' => money] entries. Returns null if $ts is unknown * or the pool is empty. Refund activity rows match only refund transactions and * payment rows only charges, so the nearest by time is the right money event. */ private static function nearestTxnAmount($ts, array $pool) { } /** Parse a stored GMT datetime to a UTC unix timestamp; null on empty/zero-date. */ private static function toTs($value) { } /** Human-readable title for a transaction timeline entry. */ private static function txnTitle($type, $txn) { } // ----------------------------------------------------------------- // change-order-status (write) // ----------------------------------------------------------------- public static function changeOrderStatus($params = []) { } // ----------------------------------------------------------------- // add-order-note (write) // ----------------------------------------------------------------- public static function addOrderNote($params = []) { } // ----------------------------------------------------------------- // refund-order (write, destructive — dry_run + idempotency) // ----------------------------------------------------------------- public static function refundOrder($params = []) { } // ----------------------------------------------------------------- // helpers // ----------------------------------------------------------------- private static function allowed($params, $key, array $allowed, $default) { } private static function total($paginator) { } private static function toDbDate($value) { } private static function invalidDateError($field) { } } /** * get-upcoming-payments — the renewal cohort view: expected billings grouped by * date over a window, separating finite (split-pay) installments from open-ended * recurring renewals, with an at_risk figure derived from past_due subscriptions * and the store's historical renewal success rate. * * It anchors on next_billing_date (never created_at), steps by each * subscription's interval, and stops finite plans at their remaining bills — * the exact projection get-product-financials uses, via the shared * PaymentProjector, so the two never disagree. * * Single-currency (defaults to store currency); other currencies present are * listed in meta.other_currencies rather than silently summed. */ class PaymentScheduleTools { /** Statuses that produce a future charge and so feed the projection. */ const FORWARD_STATUSES = ['active', 'past_due', 'trialing']; /** Safety ceiling on subscriptions loaded for one projection. */ const MAX_SUBS = 50000; public static function definitions() { } public static function getUpcomingPayments($params = []) { } // ----------------------------------------------------------------- // Loaders / builders // ----------------------------------------------------------------- /** * Forward-billing subscriptions, optionally scoped to one product/variation. * Currency is derived per row from the config JSON (there is no currency * column) so the caller can single-currency scope. Reads a limited column set * so the model's heavy $appends accessors never fire. */ private static function loadSubs($productId, $variationId) { } /** Normalize a sub row into a PaymentProjector descriptor, or null if it can't bill. */ private static function toProjSub($row) { } private static function formatBuckets($buckets, $currency) { } private static function totals($buckets) { } /** * Store-wide renewal charge success rate: succeeded / (succeeded + failed) over * transaction_type=charge, order_type=renewal. null when there is no renewal * history to learn from. Store-wide (not product-scoped) because renewal * success is gateway/dunning-driven, and per-product scoping would not scale. */ private static function renewalSuccessRate() { } private static function resolveWindow($params) { } /** Parse a date bound to UTC 'Y-m-d H:i:s'; date-only snaps to the day edge. */ private static function instant($value, $tz, $isEnd) { } private static function summary($totals, $atRiskCents, $currency, $bucketCount) { } } /** * get-product-financials — the one honest financial picture for a single * product: one-time revenue, finite split-pay commitments, and perpetual * run-rate (MRR/ARR + forward schedule), with no cross-currency summing and no * folding of forward commitments into "revenue this period". * * The subtle rule the whole tool is built around (see spec §6): * - The `window` (range/date_from/date_to + date_basis) applies to the * one_time block ONLY. * - Everything under subscriptions.*, payment_schedule, and totals is * point-in-time as of `as_of` (lifetime-to-date or forward). * This is echoed back in meta.field_semantics so an agent cannot misread it. * * All math lives in the pure ProductFinancialsCalculator (unit-tested without a * DB); this class only loads rows, scopes currency, and wraps money. */ class ProductFinancialsTools { /** Payment statuses that count as realized revenue (matches ReportTools/ContextTools). */ const PAID = ['paid', 'partially_paid', 'partially_refunded']; /** Safety ceiling on subscriptions loaded for one product. */ const MAX_SUBS = 50000; public static function definitions() { } public static function getProductFinancials($params = []) { } // ----------------------------------------------------------------- // Loaders // ----------------------------------------------------------------- /** * One-time revenue: non-subscription line items on realized-revenue orders, * scoped to the report currency and the window (by date_basis column on the * parent order). Returns integer cents/counts for the calculator. */ private static function loadOneTime($productId, $variationId, $currency, $window) { } /** * All subscriptions for the product (every status — the breakdown must be * complete). Currency is derived per row from config JSON (there is no * currency column) so the calculator can scope by it. Columns are limited * and the model is read attribute-by-attribute so the heavy $appends * accessors (url, billingInfo, overridden_status, …) never fire. */ private static function loadSubscriptions($productId, $variationId) { } // ----------------------------------------------------------------- // Formatting (cents -> money envelope) // ----------------------------------------------------------------- private static function formatData($product, $currency, $asOf, $window, $result) { } private static function formatOneTime($o, $currency) { } private static function formatSubscriptions($s, $currency) { } private static function formatTotals($t, $currency) { } private static function formatSchedule($schedule, $currency) { } private static function summary($product, $currency, $result) { } // ----------------------------------------------------------------- // Param resolvers // ----------------------------------------------------------------- private static function resolveAsOf($params) { } private static function resolveHorizonMonths($params) { } private static function resolveForwardStatuses($params) { } /** * Resolve range / date_from / date_to into a UTC window for the one_time * block. Mirrors the report tools: relative ranges resolve in UTC, custom * dates override. all_time spans epoch..now. * * @return array{from:string,to:string,range:string,basis:string}|\WP_Error */ private static function resolveWindow($params) { } private static function quarterStart($now, $tz) { } /** Parse a date bound to a UTC 'Y-m-d H:i:s' at day start/end; null on failure. */ private static function dayBound($value, $tz, $endOfDay) { } } /** * Product & inventory tools. * * Note on money: product/variation prices are stored as cents (numeric), so the * shared money() helper formats them correctly — same as orders. We never mix a * raw price into prose. * * Parameter design: * - list-products filters on what a merchant browses by (status, fulfillment, * stock, price band, category). Price filters are in store currency. * - get-product is lean by default (detail + variations); sales rollup and * downloadable files are opt-in via include[]. * - get-inventory is the dedicated "what do I need to restock?" view — distinct * from sales reporting. It only lists stock-managed variations at risk. */ class ProductTools { public static function definitions() { } public static function listProducts($params = []) { } private static function formatRow($product) { } private static function priceRange($detail) { } public static function getProduct($params = []) { } private static function variations($product) { } private static function terms($product, $which) { } /** * Lifetime sales for this product, from order items on realized-revenue * orders only. Revenue is net of item-level refunds (line_total - refund_total). * Scoped to paid / partially_refunded orders — unpaid/canceled items don't * count, and partially_paid is excluded (partial payments are not implemented). */ private static function salesRollup($productId) { } private static function downloads($product) { } public static function getInventory($params = []) { } private static function total($paginator) { } } /** * Reports & analytics — the headline research surface. * * Design rules baked in: * - Every report is CURRENCY-SCOPED: it filters to one currency (the store * default unless `currency` is passed) so totals are never silently summed * across currencies. The chosen currency is echoed in meta.currency. * - "Revenue" definitions are explicit and consistent across tools (see * metricDefs): gross = sum(total_amount) of paid orders; net = paid − * refunded; paid orders = payment_status in the paid set. * - Date basis is created_at (echoed as meta.date_basis) for determinism. * - Server-side aggregation only — no raw row dumps. query-orders caps at 200 * grouped rows; trend caps its bucket count. * - Each report returns an NL summary the agent can quote verbatim. * * Parameter design: a shared `range` enum (today … last_year) resolves to a * UTC window server-side, with explicit start_date/end_date as an override — * the agent never has to compute "last month" itself. */ class ReportTools { // Payment statuses for orders that CAPTURED PAYMENT at some point — including // one later fully refunded (payment_status 'refunded', order status 'canceled'). // A fully refunded order captured payment then returned it, so it belongs in the // refund metrics (it is the whole point of a refund report) and in the paid // denominator of the refund rate, and it nets to zero in net_revenue // (total_paid - total_refund). Gating refund aggregation on the narrower paid set // silently undercounted every fully-refunded order. Including 'refunded' here // matches FluentCart's own admin reports, which compute refunds from // total_refund > 0 with no current-status gate (see RevenueReportService / // RefundReportService::applyFilters — the default has no payment_status filter). const PAID = ['paid', 'partially_paid', 'partially_refunded', 'refunded']; // all_time is a documented alias of since_launch (see resolveRange) so the // range vocabulary matches get-product-financials, which uses all_time. const RANGES = ['today', 'yesterday', 'last_7_days', 'last_30_days', 'this_month', 'last_month', 'mtd', 'qtd', 'ytd', 'last_quarter', 'last_year', 'since_launch', 'all_time']; const MAX_BUCKETS = 180; const MAX_ROWS = 200; public static function definitions() { } // ----------------------------------------------------------------- // get-sales-report // ----------------------------------------------------------------- public static function getSalesReport($params = []) { } private static function salesMetrics($start, $end, $currency, $mode = 'all') { } private static function salesMetricsOut($m, $currency) { } private static function metricDefs() { } // ----------------------------------------------------------------- // get-sales-trend // ----------------------------------------------------------------- public static function getSalesTrend($params = []) { } // ----------------------------------------------------------------- // get-top-products // ----------------------------------------------------------------- public static function getTopProducts($params = []) { } // ----------------------------------------------------------------- // get-refund-report // ----------------------------------------------------------------- public static function getRefundReport($params = []) { } // ----------------------------------------------------------------- // query-sources (flexible UTM attribution) // ----------------------------------------------------------------- const UTM_DIMENSIONS = ['utm_source', 'utm_medium', 'utm_campaign', 'utm_term', 'utm_content', 'utm_id']; public static function querySources($params = []) { } // ----------------------------------------------------------------- // query-orders (flexible aggregate) // ----------------------------------------------------------------- public static function queryOrders($params = []) { } // ----------------------------------------------------------------- // query-products / query-customers (flexible aggregates) // ----------------------------------------------------------------- public static function queryProducts($params = []) { } public static function queryCustomers($params = []) { } // ----------------------------------------------------------------- // query-subscriptions (flexible aggregate) // ----------------------------------------------------------------- public static function querySubscriptions($params = []) { } private static function subDateBasis($params) { } /** * Restrict an Order-model aggregate to orders CONTAINING a given product / * variation. Uses whereHas on order_items (post_id = product, object_id = * variation) so the filter is a subquery, not a join — order-level metrics stay * per-order and never fan out. Both filters combine (AND) when both are given. */ private static function applyOrderItemFilter($query, $params) { } /** * Aggregate expression returning $column from the HIGHEST-id row in the group. * * Address tables have no UNIQUE constraint on (parent, type), so a group can hold * several rows and the newest is the one the buyer last entered. Two columns each * aggregated with a bare MAX() can come from two different rows and describe a * place that never existed (a real case: country from one row, state from another). * * Prefixing each value with its zero-padded id makes lexicographic MAX() agree * with numeric id order, so every column built this way resolves to the SAME row; * SUBSTRING then drops the prefix. The width is 20 because that is exactly the * digit count of the largest BIGINT UNSIGNED (18446744073709551615) — no id can * overflow the padding, so all prefixes are equal-length and compare numerically. * Ids are unique within a group (id is the PK), so the prefix alone always decides * the winner and the collation of the value suffix can never influence it. * * COALESCE(...,'') matters — CONCAT with NULL is NULL and MAX() skips NULLs, which * would let a NULL column fall back to a different row and reintroduce the mixing * this exists to prevent. * * Portable to MySQL 5.6+ (no window functions) and needs no nested join, unlike * ORDER BY ... LIMIT 1 or ROW_NUMBER(). * * @param string $column trusted column name — never interpolate caller input here * @return string */ private static function latestRowPick($column) { } private static function dimensionExpr($dim) { } // ----------------------------------------------------------------- // shared helpers // ----------------------------------------------------------------- private static function currency($params) { } /** * Effective order-mode filter: 'live', 'test', or 'all'. Reports have always * counted BOTH live and test orders, so 'all' (the default) keeps existing * numbers unchanged; an agent opts into 'live' for clean revenue. Applied to * the fct_orders.mode column. */ private static function orderMode($params) { } /** * Apply the mode filter to an Order query (or an order-relation subquery / * whereHas closure). 'all' is a no-op so existing numbers are unchanged. The * column is fct_orders.mode; pass a qualified name via $column when the orders * table is aliased (e.g. query-sources uses 'o.mode'). */ private static function applyMode($query, $mode, $column = 'mode') { } /** * Resolve range/start/end into a UTC window plus the prior equal-length * window. Relative ranges are computed in store timezone, expressed in UTC. * * Public so the single source of truth for MCP date-window resolution is * shared (e.g. list-transactions) instead of duplicated — every tool then * accepts the identical range vocabulary and UTC semantics. */ public static function resolveRange($params) { } private static function quarterStart($now, $tz) { } private static function withPrior($startUtc, $endUtc, $label, $prevStartUtc = null, $prevEndUtc = null) { } /** * Parse an ISO-8601 / relative value to a UTC 'Y-m-d H:i:s'. A date-only input * (YYYY-MM-DD) is snapped to the day start (or end when $isEnd); an explicit * time is preserved. Returns null on an unparseable value so the caller can * fall back to the next window source rather than silently matching all rows. */ private static function instant($value, $tz, $isEnd = false) { } /** * The store's first paid order timestamp (UTC); null if the store has no paid * orders yet. Only hit on the since_launch path (one indexed min per call), so * it is not memoized — a static cache would leak across calls in a long-lived * process (e.g. the test runner) for no real per-request gain. */ private static function storeLaunchDate() { } private static function dayStart($value, $tz) { } private static function dayEnd($value, $tz) { } private static function rangeBlock($range, $currency) { } private static function pickList($params, $key, array $allowed, array $default) { } /** * Page/offset for the query-* aggregates. per_page defaults to and is clamped * at MAX_ROWS — grouped rows are compact but a single page still can't exceed * the context guardrail. Returns page, per_page and the row offset. */ private static function queryPaging($params) { } /** * meta.page block for a query-* aggregate. The query fetches per_page + 1 rows * to peek past the page boundary; $fetchedCount is that raw count. `truncated` * is kept (never removed — additive API rule) and now means "more rows exist * beyond this page"; raise `page` to fetch them. */ private static function pageMeta($paging, $fetchedCount) { } private static function pct($current, $prior) { } } /** * Advanced-search discovery. * * The admin UI's advanced filter catalogs are large (30+ properties across * entities, each with operators, options and value formats) — inlining them * into every list tool's input_schema would bloat every session's context. * Instead the list tools carry ONE lean advanced_filters parameter, and this * tool serves the full per-entity reference on demand: the agent fetches the * schema for the one entity it is about to search, exactly like the existing * get-store-context → list-reference-data progressive-disclosure split. */ class SearchTools { public static function definitions() { } public static function getSearchSchema($params = []) { } } /** * Subscription tools — find recurring plans, then load one fully. * * Parameter design: * - list-subscriptions filters on what owners triage by: status, the next * billing window (to find upcoming renewals), interval, customer/product. * - next_billing_before is the key MRR/churn-prevention lever — "what renews * in the next 7 days?" — so it's a first-class filter, not buried. * - get-subscription is lean by default; renewal transactions and labels are * opt-in via include[]. * - Money (recurring_total) uses the subscription's own currency. */ class SubscriptionTools { public static function definitions() { } public static function listSubscriptions($params = []) { } /** * Aggregate-only response for summary_only: status counts, summed * recurring_total and total remaining installments across the full filtered * set. Two lightweight GROUP BY / SUM scans, no row hydration. Money is in the * store currency (subscriptions are not currency-scoped), matching formatRow. */ private static function summaryResponse($query, array $advWarnings = []) { } private static function formatRow($sub) { } private static function label($sub, $customer) { } public static function getSubscription($params = []) { } private static function transactions($sub, $currency) { } private static function labels($sub) { } // ----------------------------------------------------------------- // change-subscription-status (write, destructive — dry_run + idempotency) // ----------------------------------------------------------------- public static function changeSubscriptionStatus($params = []) { } private static function allowed($params, $key, array $allowed, $default) { } private static function total($paginator) { } private static function toDbDate($value) { } private static function invalidDateError($field) { } } /** * The payment ledger — every charge, refund, dispute and signup fee across all * orders and subscriptions. * * This is the one surface the per-order / per-subscription views cannot answer: * questions that cut ACROSS records — "all refunds last week", "failed renewal * charges this month" (dunning triage), "this customer's payment history". * Before this tool an agent had to fetch every order and stitch transactions by * hand. * * Design rules (shared with ReportTools): * - Date window resolution is delegated to ReportTools::resolveRange, so the * range vocabulary (today … since_launch, date_from/date_to, since) and UTC * semantics are identical to every report. * - Money is NEVER summed across currencies: summary.amount_by_currency reports * one total per currency, and each row carries its own currency. * - Rows are compact (moneyCompact + explicit per-row currency); summary_only * returns just the aggregates for a tiny payload. */ class TransactionTools { // transaction_type values (Status::TRANSACTION_TYPE_*). const TYPES = ['charge', 'refund', 'dispute', 'signup_fee']; // status values (Status::TRANSACTION_*). const STATUSES = ['succeeded', 'authorized', 'pending', 'refunded', 'failed', 'dispute_lost']; const DEFAULT_PER_PAGE = 25; public static function definitions() { } public static function listTransactions($params = []) { } /** * Live/test/all — filters the payment_mode column. 'all' (default) is a no-op * so both are included, matching the report tools' mode convention. */ private static function mode($params) { } private static function applyFilters($query, $params, $mode) { } /** * Aggregate the filtered set WITHOUT crossing currencies. Counts are * currency-agnostic (by_type, by_status); money is one total per currency. */ private static function summarize($query) { } /** COUNT(*) grouped by one column, as a { value: count } map. */ private static function countBy($query, $column) { } private static function formatRow($txn) { } private static function summaryLine($summary) { } } } namespace FluentCart\App\Modules\PaymentMethods\Core { interface PaymentGatewayInterface { public function has(string $feature): bool; public function meta(): array; public function makePaymentFromPaymentInstance(\FluentCart\App\Services\Payments\PaymentInstance $paymentInstance); public function handleIPN(); public function getOrderInfo(array $data); public function fields(); } abstract class AbstractPaymentGateway implements \FluentCart\App\Modules\PaymentMethods\Core\PaymentGatewayInterface { private $methodSlug = ''; public array $supportedFeatures = []; public \FluentCart\Api\StoreSettings $storeSettings; public ?\FluentCart\App\Modules\PaymentMethods\Core\AbstractSubscriptionModule $subscriptions; public \FluentCart\App\Modules\PaymentMethods\Core\BaseGatewaySettings $settings; public function __construct(\FluentCart\App\Modules\PaymentMethods\Core\BaseGatewaySettings $settings, ?\FluentCart\App\Modules\PaymentMethods\Core\AbstractSubscriptionModule $subscriptions = null) { } public function init(): void { } public function has(string $feature): bool { } public function getMeta($key = '') { } public function isUpcoming(): bool { } public function setStoreSettings(\FluentCart\Api\StoreSettings $settings): void { } public function storeSettings(): \FluentCart\Api\StoreSettings { } public function isCurrencySupported(): bool { } public function isEnabled(): bool { } public static function validateSettings($data): array { } public static function beforeSettingsUpdate($data, $oldSettings): array { } public function updateSettings($data) { } public function getSuccessUrl($transaction, $args = []) { } public static function getCancelUrl(): string { } public function paymentFailedNote($content, $data) { } protected function getListenerUrl($args = null) { } public function getOrderByHash($orderHash) { } public function validateSubscriptions($items): bool { } /** * Whether this gateway can save a payment method WITHOUT an accompanying * charge (SetupIntent-style), enabling `system` subscriptions on carts with * nothing payable now (free trials). Gateways declaring `system_subscription` * SHOULD override this when their API supports zero-amount setup. */ public function supportsSetupWithoutCharge(): bool { } /** * Charge a system (auto-charged, store-billed) subscription's renewal invoice * off-session using the stored token. Gateways declaring the * `system_subscription` capability MUST override this. A successful charge must * flow through the gateway's normal charge-confirmation path (so * syncOrderStatuses / handleRenewalPaid run). Return WP_Error on failure. * * @param \FluentCart\App\Services\Payments\PaymentInstance $paymentInstance * @param array $args ['attempt' => int] — attempt number, used for idempotency keys * @return true|'processing'|\WP_Error true = payment confirmed; 'processing' = * charge accepted, the gateway webhook will * confirm it (invoice stays scheduled) */ public function chargeRenewal(\FluentCart\App\Services\Payments\PaymentInstance $paymentInstance, $args = []) { } /** * Re-check an async (processing) renewal charge against the gateway. Called by * the SystemChargeService reconciliation loop when a charge was accepted but * the confirming webhook has not arrived. A settled payment must be confirmed * through the gateway's normal charge-confirmation path before returning true. * * @param \FluentCart\App\Services\Payments\PaymentInstance $paymentInstance * @return true|'processing'|\WP_Error true = settled and confirmed; * 'processing' = still settling, check again * later; WP_Error = definitively failed */ public function reconcileRenewalCharge(\FluentCart\App\Services\Payments\PaymentInstance $paymentInstance) { } /** * Store-managed subscription mode: a manual subscription's payment — the first * order or a renewal invoice — must be taken as a plain one-time charge. No * vendor subscription may be created and no manual→automatic conversion may * happen. Every gateway with a subscription branch in * makePaymentFromPaymentInstance() must consult this BEFORE its conversion / * vendor-subscription logic and route to its single-payment path when true. */ protected function shouldChargeSubscriptionAsOneTime(\FluentCart\App\Services\Payments\PaymentInstance $paymentInstance): bool { } //technically not reachable , as conversion to manual subscription is not possible as of now. protected function maybeConvertToManualSubscription(\FluentCart\App\Services\Payments\PaymentInstance $paymentInstance): void { } public function validatePaymentMethod($data) { } public function updateOrderDataByOrder($order, $transactionData, $transaction) { } public function getCheckoutItems(): array { } public function getSettings(): \FluentCart\App\Modules\PaymentMethods\Core\BaseGatewaySettings { } public function renderStoreModeNotice(): string { } public function beforeRenderPaymentMethod($hasSubscription): void { } public function getEnqueueVersion() { } public function getEnqueueScriptSrc($hasSubscription): array { } public function getEnqueueStyleSrc(): array { } public function getTransactionUrl($url, $data) { } public function getSubscriptionUrl($url, $data) { } public function processRefund($transaction, $amount, $args) { } public function syncRemoteTransaction(\FluentCart\App\Models\OrderTransaction $transaction) { } public function enqueue($hasSubscription): void { } public function prepare($mode, $hasSubscription) { } public function render($mode = 'logo') { } public function getLocalizeData(): array { } /** * Get the consent service name for this payment gateway * Used by consent management plugins (Usercentrics, CookieYes, etc.) * Override in child classes to specify the service name * * @return string|null Service name or null to use gateway slug */ public function getConsentServiceName(): ?string { } } } namespace FluentCart\App\Modules\PaymentMethods\AirwallexGateway { class Airwallex extends \FluentCart\App\Modules\PaymentMethods\Core\AbstractPaymentGateway { public array $supportedFeatures = ['payment', 'refund', 'webhook']; public function __construct() { } public function meta(): array { } public function boot() { } public function makePaymentFromPaymentInstance(\FluentCart\App\Services\Payments\PaymentInstance $paymentInstance) { } public function refund($refundInfo, $order, $transaction) { } public function handleIPN(): void { } public function getOrderInfo(array $data) { } public function fields() { } public static function validateSettings($data): array { } public function getEnqueueScriptSrc($hasSubscription = 'no'): array { } public function getEnqueueStyleSrc(): array { } private function getAccessToken() { } private function createAirwallexPaymentIntent($data, $accessToken) { } private function processAirwallexRefund($refundData, $accessToken) { } private static function testApiConnection($clientId, $apiKey, $mode) { } private function verifyWebhookSignature($payload) { } private function getApiBaseUrl() { } private function getWebhookUrl() { } public function webHookPaymentMethodName() { } private function generateRequestId($order, $type = 'payment') { } private function handlePaymentSucceeded($payload) { } private function handlePaymentFailed($payload) { } private function handleRefundReceived($payload) { } private function handlePaymentSuccess($paymentIntent, $order) { } private function handlePaymentFailure($paymentIntent, $order) { } } } namespace FluentCart\App\Modules\PaymentMethods\Core { abstract class BaseGatewaySettings { public static array $allSettings = []; private static bool $settingsLoaded = false; public $settings; public $methodHandler; public function __construct() { } abstract public function get($key = ''); abstract public function getMode(); abstract public function isActive(); public function getCachedSettings() { } } } namespace FluentCart\App\Modules\PaymentMethods\AirwallexGateway { class AirwallexSettingsBase extends \FluentCart\App\Modules\PaymentMethods\Core\BaseGatewaySettings { public $settings; public $methodHandler = 'fluent_cart_payment_settings_airwallex'; public static function getDefaults() { } public function isActive(): bool { } public function get($key = '') { } public function getMode() { } public function getClientId() { } public function getApiKey() { } public function getWebhookSecret() { } } } namespace FluentCart\App\Modules\PaymentMethods\Cod { class Cod extends \FluentCart\App\Modules\PaymentMethods\Core\AbstractPaymentGateway { public array $supportedFeatures = ['payment', 'refund', 'offline']; public \FluentCart\App\Modules\PaymentMethods\Core\BaseGatewaySettings $settings; public function boot() { } public function getPaymentMethodClass($class, $data): string { } public function meta(): array { } public function __construct() { } public function makePaymentFromPaymentInstance(\FluentCart\App\Services\Payments\PaymentInstance $paymentInstance) { } public function handlePaymentPaid($params) { } public function maybeUpdateSubscription($params) { } public function getEnqueueScriptSrc($hasSubscription = 'no'): array { } public function getLocalizeData(): array { } public function fields() { } public static function validateSettings($data): array { } public function maybeUpdatePayments($orderHash) { } public function refund($refundInfo, $orderData, $transaction) { } public function webHookPaymentMethodName() { } public function handleIPN() { } public function getOrderInfo(array $data) { } } class CodHandler { protected $cod; public function __construct(\FluentCart\App\Modules\PaymentMethods\Cod\Cod $cod) { } public function handlePayment($paymentInstance) { } public function handleZeroTotalPayment($paymentInstance) { } } class CodSettingsBase extends \FluentCart\App\Modules\PaymentMethods\Core\BaseGatewaySettings { public $settings; public $methodHandler = 'fluent_cart_payment_settings_offline_payment'; public static function getDefaults(): array { } public function isActive(): bool { } public function getMode() { } public function getPublicKey() { } public function getApiKey() { } public function get($key = '') { } } } namespace FluentCart\App\Modules\PaymentMethods\Core { abstract class AbstractSubscriptionModule { /** * @throws \Exception */ public function fetchSubscription($data, $order, $subscription) { } /** * @throws \Exception */ public function cardUpdate($data, $subscriptionId) { } /** * @throws \Exception */ public function switchPaymentMethod($data, $subscriptionId) { } /** * @throws \Exception */ public function reactivateSubscription($data, $subscriptionId) { } /** * @throws \Exception */ public function pauseSubscription($data, $order, $subscription) { } /** * @throws \Exception */ public function resumeSubscription($data, $order, $subscription) { } public function cancel($vendorSubscriptionId, $args = []) { } /** * @throws \Exception */ public function cancelSubscription($data, $order, $subscription) { } public function cancelOnPlanChange($vendorSubscriptionId, $parentOrderId, $subscriptionId, $reason) { } public function cancelAutoRenew($subscription) { } public function cancelOnSwitchPaymentMethod($currentVendorSubscriptionId, $parentOrderId, $vendorSubscriptionId, $newPaymentMethod, $reason) { } public function reSyncSubscriptionFromRemote(\FluentCart\App\Models\Subscription $subscriptionModel) { } } /** * Payment Gateway Manager * * Manages payment gateway instances using the Singleton pattern. * Supports both traditional and direct gateway access patterns: * * Traditional: GatewayManager::getInstance()->get('stripe') * Direct: GatewayManager::getInstance('stripe') * Static: GatewayManager::gateway('stripe') */ class GatewayManager { protected static ?\FluentCart\App\Modules\PaymentMethods\Core\GatewayManager $instance = null; protected array $gateways = []; public static ?\FluentCart\Api\StoreSettings $storeSettings = null; /** * Get the singleton instance or a specific gateway * * @param string|null $gatewayName Optional gateway name to retrieve directly * @return GatewayManager|PaymentGatewayInterface|null */ public static function getInstance(?string $gatewayName = null) { } public static function storeSettings(): \FluentCart\Api\StoreSettings { } /** * Static convenience method to get a gateway directly * * @param string $gatewayName * @return PaymentGatewayInterface|null */ public static function gateway(string $gatewayName): ?\FluentCart\App\Modules\PaymentMethods\Core\PaymentGatewayInterface { } /** * Check if a gateway is registered * * @param string $gatewayName * @return bool */ public static function has($gatewayName): bool { } /** * Register a payment gateway * * @param string $name Gateway identifier * @param PaymentGatewayInterface $gateway Gateway instance */ public function register(string $name, \FluentCart\App\Modules\PaymentMethods\Core\PaymentGatewayInterface $gateway) { } /** * Get a specific payment gateway * * @param string $name Gateway identifier * @return PaymentGatewayInterface|null */ public function get(string $name): ?\FluentCart\App\Modules\PaymentMethods\Core\PaymentGatewayInterface { } /** * Get all registered gateways * * @return array */ public function all(): array { } /** * Get all enabled gateways * * @return array */ public function enabled(): array { } /** * Get gateway names * * @return array */ public function names(): array { } /** * Remove a gateway * * @param string $name Gateway identifier * @return bool */ public function remove(string $name): bool { } public function getAllMeta(): array { } public function getRoutes() { } } } namespace FluentCart\App\Modules\PaymentMethods\PayPalGateway\API { class API { private static $settings = null; private const TEST_API_URL = 'https://api-m.sandbox.paypal.com'; private const LIVE_API_URL = 'https://api.paypal.com'; private const TEST_VERIFYING_URL = 'https://api-m.sandbox.paypal.com/v1/notifications/verify-webhook-signature'; private const LIVE_VERIFYING_URL = 'https://api-m.paypal.com/v1/notifications/verify-webhook-signature'; private static function getPayPalSettings() { } public static function getAPIUrl($mode = 'test'): string { } protected static function getAuthAPI($mode = 'test') { } public static function validateCredentials($clientId, $clientSecret, $mode = 'test') { } /** * @param string $path API path ex: checkout/orders (Required) * @param string $version API version ex: v1, v2 (Optional) * @param string $method HTTP method ex: GET, POST, DELETE (Optional) * @param array $args API request arguments (Optional) * @param string $mode PayPal mode ex: live, test (Optional) * @param array $extraHeaders Additional request headers ex: PayPal-Request-Id (Optional) * @return mixed $response API response * @throws \Exception if error occurs */ public static function makeRequest($path, $version = 'v1', $method = 'POST', $args = [], $mode = '', $extraHeaders = []) { } public static function getResource($path, $data = [], $mode = '') { } public static function createResource($path, $data = [], $mode = '') { } public static function retrieveAccount($settings, $mode = '') { } public static function getRequest($url, $accessToken = null, $mode = '') { } public static function createOrder($purchaseUnit, $extraBody = [], $extraHeaders = []) { } public static function verifyPayment($paymentId) { } /** * Captures an APPROVED PayPal order server-side, moving the money. FluentCart creates * the order with intent=CAPTURE but the buyer only AUTHORIZES it in the popup; the funds * are not captured until this call runs. The server must never trust the browser to have * captured — an APPROVED-but-uncaptured order means PayPal is holding $0. * * Capture MOVES MONEY, so it carries a PayPal-Request-Id for idempotency (see * .claude/skills/coding-rules/payment-idempotency.md). The id is keyed on the PayPal * order id, which is stable and unique per checkout attempt: a duplicate capture of the * same order replays the cached response instead of double-capturing, while capturing an * already-captured order returns 422 ORDER_ALREADY_CAPTURED (the caller re-GETs and * continues). PayPal retains request ids for 6h — longer than the 3h order lifetime — so * a keyed capture never replays a dead id. * * @param string $paymentId The PayPal order id (payId) * @return mixed API response (the captured order) or WP_Error */ public static function captureOrder($paymentId) { } public function verifySubscription($subscriptionId, $mode = '') { } /** * Retrieves PayPal access token using WP_HTTP. * * @param string $mode The PayPal mode (live/sandbox). * @param array $args Additional arguments including public_key and api_key. * @return string|\WP_Error Access token on success, WP_Error on failure. */ private static function getAccessToken($mode = '', $args = []) { } /** * Browser-safe id token for the JS SDK vault (save-without-purchase) flow — * rendered as the SDK script's data-user-id-token attribute. Short-lived * (~15 min), so it is generated per checkout page render and never cached. * * @param string $mode The PayPal mode (live/test). * @return string|\WP_Error */ public static function getUserIdToken($mode = '') { } /** * Generate a PayPal-Auth-Assertion JWT header (unsigned, alg=none). * * @param string $clientId Your platform's REST API client ID * @param string $sellerPayerId Seller's PayPal payer_id (preferred) or email * @return string The PayPal‑Auth‑Assertion header value */ private static function generatePayPalAuthAssertion($clientId, $sellerPayerId) { } private static function getAccountId($settings, $mode) { } public static function verifyWebhookSignature($body) { } } class DccApplies { protected string $country; protected string $currency; protected array $allowedCountryCurrencyMatrix; protected array $countryCardMatrix; /** * @throws \Exception */ public function __construct($country, $currency) { } public function forCountryCurrency(): bool { } public static function countryCardMatrix(): array { } public static function dccSupportedCountryCurrencyMatrix(): array { } } class PayPalPartner { private $mode; private $apiBase; private $accessToken; private static $fluentCartAPI = ''; protected static $testClientId = 'AUaPp5Il9xr2gUhAUtHDcx5qVHIgyyY21Q22XHn_gdKCR-E_S4-r3D4IqZxahb_zpqL46_pT_z2jnHXt'; protected static $liveClientId = 'AV2vFALQ_Okaw1HbNAWFbEstDofcsTGdetUNjIMniFTB5xRwnc2Kw2PLADEoRn-gZ5jLPnzwEZD6pQM3'; protected static $testPartnerMerchantId = 'TVZ979WK7888J'; protected static $partnerMerchantId = '8VQ7BA4DWP6TA'; // LIVE ACCOUNT ID public function __construct($mode = 'live') { } public function getPartnerId($mode = ''): string { } public function getClientId(): string { } public function withToken($token) { } public function get($endpoint, $params = []) { } public function exchangeAuthCode($sharedId, $authCode) { } public function verifyMerchant($sellerAccessToken, $merchantIdInPayPal) { } public function makeMerchantRequest($endpoint, $sellerAccessToken, $method = 'GET') { } private function sendTokenRequest($url, $payload, $sharedId) { } /** * @throws \Exception */ public function sellerOnboarding() { } public function getRemoteAuthenticator($payload, $mode) { } public function nonce(): string { } public function getBNCode() { } private function sendRequest($method, $url, $payload = null) { } } class PayPalPartnerRenderer { protected $mode; public function __construct($mode) { } public function render($data) { } public function getMode() { } public function scriptJs(): string { } public function template($data) { } } class Webhook { const EVENTS = [ ['name' => 'PAYMENT.SALE.COMPLETED'], ['name' => 'PAYMENT.SALE.REFUNDED'], // recurring payment refund ['name' => 'PAYMENT.CAPTURE.REFUNDED'], // one time payment refund ['name' => 'PAYMENT.CAPTURE.COMPLETED'], ['name' => 'BILLING.SUBSCRIPTION.CREATED'], ['name' => 'BILLING.SUBSCRIPTION.ACTIVATED'], ['name' => 'BILLING.SUBSCRIPTION.SUSPENDED'], ['name' => 'BILLING.SUBSCRIPTION.CANCELLED'], ['name' => 'BILLING.SUBSCRIPTION.EXPIRED'], ['name' => 'CUSTOMER.DISPUTE.CREATED'], ['name' => 'CUSTOMER.DISPUTE.UPDATED'], ['name' => 'CUSTOMER.DISPUTE.RESOLVED'], // Extra for testing ['name' => 'CHECKOUT.CHECKOUT.BUYER-APPROVED'], ['name' => 'INVOICING.INVOICE.PAID'], ['name' => 'CHECKOUT.ORDER.COMPLETED'], ['name' => 'CHECKOUT.ORDER.PROCESSED'], ['name' => 'CHECKOUT.ORDER.APPROVED'], ['name' => 'PAYMENT.ORDER.CREATED'], ]; const WEBHOOK_ENDPOINT = '?fluent-cart=fct_payment_listener_ipn&method=paypal'; public static function getWebhookURL(): string { } public static function webhookInstruction(): string { } public function registerWebhook($mode, $url = '') { } public static function parseAndUpdateSettings($webhookData, $mode) { } public function maybeWebhookExists($webhookData, $mode) { } public function maybeSetWebhook($mode) { } } } namespace FluentCart\App\Modules\PaymentMethods\PayPalGateway { class ConnectConfig { public static function getConnectConfig() { } public static function parseConnectInfos($vendorData) { } public function getSellerAuthToken(\FluentCart\Framework\Http\Request\Request $request) { } public static function prepareSettingToSave($credentials, $mode = 'live') { } private static function getAccountInfo($settings, $mode) { } public static function disconnect($mode, $sendResponse = true) { } } class IPN { private const TEST_VERIFYING_URL = 'https://api-m.sandbox.paypal.com/v1/notifications/verify-webhook-signature'; private const LIVE_VERIFYING_URL = 'https://api-m.paypal.com/v1/notifications/verify-webhook-signature'; private static $paypalSettings = null; public function init() { } public function processPaypalWebhookEvents($event): void { } public function processChargeCaptured($data) { } // called only when webhook/ipn hits public function verifyAndProcess($data = []): void { } /** * Verify the webhook signature * * @param string $webhookId * @return bool|\WP_Error */ public function verifyWebhook($webhookId) { } public function processWebhook() { } public function processSubscriptionActivated($data) { } public function processRecurringPaymentReceived($data) { } public function handleSinglePaymentRefund($data) { } public function handleWebhookRecurringPaymentRefunded($data) { } public function handleWebhookRecurringProfileCancelled($data) { } public function handleWebhookRecurringProfileExpired($data) { } public function handleWebhookRecurringProfileSuspended($data) { } public function handleWebhookRecurringProfileReactivated($data) { } public function handleWebhookDisputeCreated($data) { } public function handleWebhookDisputeUpdated($data) { } public function handleWebhookDisputeResolved($data) { } private function getSubscriptionByPaypalSubscriptionInfo($subscriptionInfo = []) { } private static function getPayPalSettings() { } } class PayPal extends \FluentCart\App\Modules\PaymentMethods\Core\AbstractPaymentGateway { private $methodSlug = 'paypal'; public array $supportedFeatures = ['payment', 'refund', 'webhook', 'custom_payment', 'card_update', 'switch_payment_method' => ['supported_gateways' => ['stripe', 'paypal']], 'dispute_handler', 'subscriptions', 'resume_subscription', 'system_subscription', 'manual_subscription']; private $vaultUserIdToken = ''; private $vaultSetupUnavailable = false; public function __construct() { } public function meta(): array { } public function boot() { } public function makePaymentFromPaymentInstance(\FluentCart\App\Services\Payments\PaymentInstance $paymentInstance) { } public function convertManualSubscription($subscription) { } private function shouldRenderAsSubscriptionMode($hasSubscription): bool { } /** * PayPal can vault a wallet without charging (Vault v3 setup tokens) — but * only the smart-buttons flow implements it; other checkout modes keep the * pre-feature behavior (gateway hidden for zero-payable system carts). */ public function supportsSetupWithoutCharge(): bool { } /** * Zero-payable system checkout on this page load: the SDK must carry a * user id token and getOrderInfo must report setup mode. */ private function isZeroPayableSetupCheckout($hasSubscription): bool { } /** * Amount payable on THIS checkout (items + shipping + additive taxes) — the * same total the charge transaction is created with. Every frontend * zero-payable decision must predict transaction->total with this computation. */ private function getPayableNowTotal(): int { } /** * Off-session charge of a system subscription's renewal invoice against the * vaulted PayPal token. Contract per * dev-docs/system-subscriptions/gateway-implementation-guide.md. * * @param \FluentCart\App\Services\Payments\PaymentInstance $paymentInstance * @param array $args ['attempt' => int] * @return true|string|\WP_Error true = confirmed; 'processing' = accepted, * settling (webhook/reconciler will confirm) */ public function chargeRenewal(\FluentCart\App\Services\Payments\PaymentInstance $paymentInstance, $args = []) { } /** * Re-check a processing vault charge (lost webhook / slow eCheck). * * @param \FluentCart\App\Services\Payments\PaymentInstance $paymentInstance * @return true|string|\WP_Error */ public function reconcileRenewalCharge(\FluentCart\App\Services\Payments\PaymentInstance $paymentInstance) { } public function syncRemoteTransaction(\FluentCart\App\Models\OrderTransaction $transaction) { } public function confirmPayPalSinglePayment() { } /** * AJAX confirmation of a zero-payable system checkout: the buyer approved * the vault setup token in PayPal's popup; exchange it for a durable payment * token, persist it on the subscription, and complete the $0 order. */ public function confirmPayPalVaultSetup() { } public function confirmPayPalSubscription() { } protected function getPayPalSubscription($subscriptionId) { } protected function verifyPayPalPayment($payPalReferenceId) { } protected function capturePayPalPayment($payPalReferenceId) { } /** * Detects PayPal's "this order was already captured" response. In the normal flow the * browser captures first, so our server-side capture of the same order legitimately * fails with 422 UNPROCESSABLE_ENTITY / issue ORDER_ALREADY_CAPTURED — that is expected * and must be treated as success (re-GET the order), not as a payment failure. * * @param \WP_Error $error * @return bool */ protected function isAlreadyCapturedError($error) { } /** * A PENDING capture has moved no money. Bind its id to the transaction so the * PAYMENT.CAPTURE.COMPLETED webhook resolves it without the order-lookup * fallback, and record PayPal's hold reason (ECHECK, PENDING_REVIEW, * RECEIVING_PREFERENCE_MANDATES_MANUAL_ACTION, ...) on the order for support. * * Shares the completed-path capture lock so a concurrent confirmation for the * same charge id cannot bind it to two transactions. Returns false when the * charge id already belongs to another transaction — the caller must not treat * that as pending-for-this-order. * * @param \FluentCart\App\Models\OrderTransaction $transaction * @param array $capture * @return bool */ protected function recordPendingCapture(\FluentCart\App\Models\OrderTransaction $transaction, $capture) { } protected function hasExistingPayPalCapture(\FluentCart\App\Models\OrderTransaction $transaction, $chargeId) { } protected function acquirePayPalCaptureLock($chargeId) { } protected function releasePayPalCaptureLock($chargeId) { } protected function getPayPalCaptureLockName($chargeId) { } public function getClientId($value, $args) { } public function handleIPN() { } public function getTransactionUrl($url, $data) { } public function appAuthenticator($request) { } public function getSubscriptionUrl($url, $data) { } public static function beforeSettingsUpdate($data, $oldSettings): array { } public function isEnabled(): bool { } /** * Connect configuration should return */ public function getConnectInfo() { } public function disconnect($data) { } public function getWebhookInfo($mode = 'test') { } public function fields() { } public function webHookPaymentMethodName() { } public static function validateSettings($data): array { } private static function validateApiCredentials($clientId, $clientSecret, $mode): array { } /* * Default sdk enqueue version is the plugin version * if any sdk require a specific version, then override this method * or to remove a version, return null */ public function getEnqueueVersion() { } public function getEnqueueScriptSrc($hasSubscription = false): array { } public function getLocalizeData(): array { } public function processRefund($transaction, $amount, $args) { } public function getOrderInfo($data) { } public function checkCurrencySupport() { } public function isCurrencySupported(): bool { } public static function getPaypalSupportedCurrency(): array { } public function acceptRemoteDispute($transaction, $args = []) { } } class PayPalHelper { /** * Get or create a Stripe pricing plan for a product variation. * * @param array $data { * @type string $product_id Product ID. * @type string $variation_id Variation ID. * @type string $trial_days Trial Days. * @type string $billing_interval Billing interval (e.g., 'month', 'year'). * @type string $currency Currency code (e.g., 'usd'). * @type int $interval_count Number of intervals. * @type int $recurring_amount Recurring total amount (in cents). * @type int $signup_fee Recurring total amount (in cents). * @type int bill_times optional 0 for continuous billing, or a specific number of billing cycles * } * * @return \WP_Error|array */ public static function getPayPalPlan($data = []) { } public static function processRemoteRefund($transaction, $amount, $args) { } private static function getRemoteProductByData($productData = []) { } private static function getPayPalPlanArgs($data = []) { } } class PayPalSettingsBase extends \FluentCart\App\Modules\PaymentMethods\Core\BaseGatewaySettings { public $methodHandler = 'fluent_cart_payment_settings_paypal'; public $settings; public $storeSettings = null; public function __construct() { } private function hasManualTesKeys(): bool { } private function hasManualLiveKeys(): bool { } public static function getDefaults(): array { } public function getProviderType() { } public function isActive(): bool { } public function get($key = '') { } public function getMode() { } public function getVendorEmail() { } public function getApiKey($mode = '') { } public function getPublicKey($mode = '') { } public function getMerchantId() { } public function updateNonSensitiveData($data) { } } class PayPalSubscriptions extends \FluentCart\App\Modules\PaymentMethods\Core\AbstractSubscriptionModule { public function reSyncSubscriptionFromRemote(\FluentCart\App\Models\Subscription $subscriptionModel) { } public function cancel($vendorSubscriptionId, $args = []) { } /** * Resume (activate) a suspended PayPal subscription. * * Called by SubscriptionService::resumeSubscription for automatic subscriptions. * Remote first: activates the subscription at PayPal, and only on success flips * the local status and fires the SubscriptionResumed event. * * @param \FluentCart\App\Models\Subscription $subscription * @param string $reason * @return true|\WP_Error */ public function resume(\FluentCart\App\Models\Subscription $subscription, $reason = '') { } public function getOrCreateNewPlan($subscriptionId, $reason) { } public function confirmSubscriptionSwitch($data, $subscriptionId) { } } class Processor { public function handleSinglePayment(\FluentCart\App\Services\Payments\PaymentInstance $paymentInstance, $args = []) { } /** * Zero-payable system subscription checkout (free trial): a $0 PayPal order * is invalid, so the buyer's PayPal account is vaulted via a Vault v3 setup * token; confirmVaultSetup() exchanges it, completes the $0 order, and the * trial-end invoice is charged off-session like any other system renewal. * The save agreement is carried by PayPal's own approval popup; the checkout * page shows the informational disclosure next to the buttons. */ public function handleSetupOnlyPayment(\FluentCart\App\Services\Payments\PaymentInstance $paymentInstance) { } /** * Vault-flow lock, keyed on the transaction uuid — shared by the setup-token * binding write and the confirmation endpoint so token replacement and * confirmation of one transaction always serialize. */ public static function acquireVaultTransactionLock($transactionUuid) { } public static function releaseVaultTransactionLock($transactionUuid) { } /** * Exchange an approved setup token for a durable payment token, persist it * on the system subscription, and complete the $0 order — the trial then * activates through the normal status-sync path. * * @param \FluentCart\App\Models\OrderTransaction $transaction * @param string $setupTokenId * @return true|\WP_Error */ public function confirmVaultSetup(\FluentCart\App\Models\OrderTransaction $transaction, $setupTokenId) { } public function handleSubscriptionPaymentFromPaymentInstance(\FluentCart\App\Services\Payments\PaymentInstance $paymentInstance, $args = []) { } /** * Confirm payment success * Currently used by: * @param \FluentCart\App\Models\OrderTransaction $transaction * @param array $args * @param array $transactionArgs * string vendor_charge_id - The intent_id from paypal * string total - The amount charged in cents * string status - The status of the transaction ('succeeded', 'pending', etc.)) * array payer - The payer information from PayPal. * array payment_source - The payment source information from PayPal. * * @param string $args ['intent_id'] - The intent ID from Stripe. * @return \FluentCart\App\Models\Order */ public function confirmPaymentSuccessByCharge(\FluentCart\App\Models\OrderTransaction $transaction, $transactionArgs = []) { } // This should be only used from the ajax call for the very first time subscription activation public function activateSubscription($paypalSubscription, \FluentCart\App\Models\OrderTransaction $transaction, $subscriptionModel = null) { } private function toDecimal($cents) { } /** * Persist the vaulted PayPal payment token from a captured order onto the * system subscription — the token future renewal charges read (at fire time) * from active_payment_method. Idempotent per token; shared by the AJAX * confirmation and the PAYMENT.CAPTURE.COMPLETED webhook (whichever lands * first wins). * * When the FIRST (initial) capture of a system subscription carries NO vault * token — vaulting declined or unavailable on the merchant account — the * subscription is demoted to plain manual invoicing immediately: a `system` * subscription without a token would fail every scheduled charge forever. * * @param \FluentCart\App\Models\OrderTransaction $transaction * @param array $paypalOrder The captured Orders-v2 order (full representation). */ public function maybePersistVaultToken(\FluentCart\App\Models\OrderTransaction $transaction, $paypalOrder) { } /** * Merchant-initiated off-session charge of a renewal invoice against the * vaulted PayPal token (Orders v2 create with payment_source.paypal.vault_id). * Contract per dev-docs/system-subscriptions/gateway-implementation-guide.md: * true = confirmed through the normal capture path; 'processing' = accepted * but settling (eCheck); WP_Error = definitive failure. */ public function chargeVaultedRenewal(\FluentCart\App\Services\Payments\PaymentInstance $paymentInstance, $args = []) { } /** * Re-check a processing vault charge (lost webhook / slow eCheck). A transient * API error reports 'processing' — never fail a possibly-settled payment. */ public function reconcileVaultedRenewal(\FluentCart\App\Services\Payments\PaymentInstance $paymentInstance) { } public function syncRemoteTransaction(\FluentCart\App\Models\OrderTransaction $transaction) { } /** * Shared outcome derivation for a vault-charged Orders-v2 order: record the * ids for reconciliation, confirm completed captures through the normal * capture path, report settling captures as 'processing', everything else as * a definitive failure with PayPal's reason. * * @return true|string|\WP_Error */ private function settleVaultChargeResponse(\FluentCart\App\Models\OrderTransaction $transaction, $paypalOrder) { } } class SubscriptionManager { /** * @throws \Exception */ public function pauseSubscription($data, $order, $subscription) { } /** * @throws \Exception */ public function resumeSubscription($data, $order, $subscription) { } /** * @throws \Exception */ public function getOrCreateNewPlan($subscriptionId, $reason) { } public function confirmSubscriptionSwitch($data, $subscriptionId) { } /** * Confirm subscription reactivation * * @param array $data | newVendorSubscriptionId (string) required * @param int $subscriptionId * @return void */ public static function addOldSubscriptionMeta($subscription, $oldSubData) { } public function getSubscriptionItemForUpdate($subscriptionModel, $variation) { } public function getCorrectSubscriptionStatus($status): string { } public function sendError($message, $code = 422): void { } } } namespace FluentCart\App\Modules\PaymentMethods\PromoGateways\Addons { class AddonGatewaySettings extends \FluentCart\App\Modules\PaymentMethods\Core\BaseGatewaySettings { protected $gatewaySlug; protected $customStyles = []; public function __construct($gatewaySlug, $methodHandler = 'fluent_cart_payment_settings_addon_gateway') { } public function setCustomStyles($styles) { } public static function getDefaults() { } public function get($key = null) { } /** * Validate addon configuration * * @param array $config * @return array|\WP_Error */ public function validateAddonConfig($config) { } public function getMode() { } public function isActive(): bool { } protected function getAddonNoticeStyles() { } protected function renderIcon($svgPath, $styles = '') { } protected function renderFeatureItem($text, $mode = 'light') { } protected function renderInstallButton($addonSlug, $addonFile, $addonSource, $repoLink, $mode = 'light') { } protected function renderActivateButton($addonFile, $mode = 'light') { } protected function renderActiveBadge() { } /** * Generate addon notice HTML * * @param array $config Configuration array with: * - title: Gateway title * - description: Gateway description * - features: Array of feature strings * - icon_path: SVG path for the gateway icon * - addon_slug: Plugin slug * - addon_file: Plugin file path * - addon_source: Array with 'type' and 'link' * * @return string HTML for the addon notice */ public function generateAddonNotice($config) { } } class FlutterwaveAddon extends \FluentCart\App\Modules\PaymentMethods\Core\AbstractPaymentGateway { public array $supportedFeatures = []; private $addonSlug = 'flutterwave-for-fluent-cart'; private $addonFile = 'flutterwave-for-fluent-cart/flutterwave-for-fluent-cart.php'; public function __construct() { } public function meta(): array { } public function makePaymentFromPaymentInstance(\FluentCart\App\Services\Payments\PaymentInstance $paymentInstance) { } public function handleIPN() { } public function getOrderInfo(array $data) { } /** * Get Flutterwave-specific notice configuration */ private function getNoticeConfig() { } /** * Generate addon notice message */ public function addonNoticeMessage() { } public function fields() { } } class MercadoPagoAddon extends \FluentCart\App\Modules\PaymentMethods\Core\AbstractPaymentGateway { public array $supportedFeatures = []; private $addonSlug = 'mercado-pago-for-fluent-cart'; private $addonFile = 'mercado-pago-for-fluent-cart/mercado-pago-for-fluent-cart.php'; public function __construct() { } public function meta(): array { } public function makePaymentFromPaymentInstance(\FluentCart\App\Services\Payments\PaymentInstance $paymentInstance) { } public function handleIPN() { } public function getOrderInfo(array $data) { } /** * Get Mercado Pago-specific notice configuration */ private function getNoticeConfig() { } /** * Generate addon notice message */ public function addonNoticeMessage() { } public function fields() { } } class PaystackAddon extends \FluentCart\App\Modules\PaymentMethods\Core\AbstractPaymentGateway { public array $supportedFeatures = []; private $addonSlug = 'paystack-for-fluent-cart'; private $addonFile = 'paystack-for-fluent-cart/paystack-for-fluent-cart.php'; public function __construct() { } public function meta(): array { } public function makePaymentFromPaymentInstance(\FluentCart\App\Services\Payments\PaymentInstance $paymentInstance) { } public function handleIPN() { } public function getOrderInfo(array $data) { } /** * Get Paystack-specific notice configuration */ private function getNoticeConfig() { } /** * Generate addon notice message */ public function addonNoticeMessage() { } public function fields() { } } class RazorpayAddon extends \FluentCart\App\Modules\PaymentMethods\Core\AbstractPaymentGateway { public array $supportedFeatures = []; private $addonSlug = 'razorpay-for-fluent-cart'; private $addonFile = 'razorpay-for-fluent-cart/razorpay-for-fluent-cart.php'; public function __construct() { } public function meta(): array { } public function makePaymentFromPaymentInstance(\FluentCart\App\Services\Payments\PaymentInstance $paymentInstance) { } public function handleIPN() { } public function getOrderInfo(array $data) { } /** * Get Razorpay-specific notice configuration */ private function getNoticeConfig() { } /** * Generate addon notice message */ public function addonNoticeMessage() { } public function fields() { } } class SquareAddon extends \FluentCart\App\Modules\PaymentMethods\Core\AbstractPaymentGateway { public array $supportedFeatures = []; private $addonSlug = 'square-for-fluent-cart'; private $addonFile = 'square-for-fluent-cart/square-for-fluent-cart.php'; public function __construct() { } public function meta(): array { } public function makePaymentFromPaymentInstance(\FluentCart\App\Services\Payments\PaymentInstance $paymentInstance) { } public function handleIPN() { } public function getOrderInfo(array $data) { } public function addonNoticeMessage() { } public function fields() { } } class SslcommerzAddon extends \FluentCart\App\Modules\PaymentMethods\Core\AbstractPaymentGateway { public array $supportedFeatures = []; private $addonSlug = 'sslcommerz-for-fluent-cart'; private $addonFile = 'sslcommerz-for-fluent-cart/sslcommerz-for-fluent-cart.php'; public function __construct() { } public function meta(): array { } public function makePaymentFromPaymentInstance(\FluentCart\App\Services\Payments\PaymentInstance $paymentInstance) { } public function handleIPN() { } public function getOrderInfo(array $data) { } public function addonNoticeMessage() { } public function fields() { } } } namespace FluentCart\App\Modules\PaymentMethods\PromoGateways\Pro { class AuthorizeNetPromo extends \FluentCart\App\Modules\PaymentMethods\Core\AbstractPaymentGateway { public array $supportedFeatures = []; public function __construct() { } public function meta(): array { } public function makePaymentFromPaymentInstance(\FluentCart\App\Services\Payments\PaymentInstance $paymentInstance) { } public function handleIPN() { } public function getOrderInfo(array $data) { } private function getNoticeConfig() { } public function upgradeToProMessage() { } public function fields() { } } class MolliePromo extends \FluentCart\App\Modules\PaymentMethods\Core\AbstractPaymentGateway { public array $supportedFeatures = []; public function __construct() { } public function meta(): array { } public function makePaymentFromPaymentInstance(\FluentCart\App\Services\Payments\PaymentInstance $paymentInstance) { } public function handleIPN() { } public function getOrderInfo(array $data) { } /** * Get Mollie-specific notice configuration */ private function getNoticeConfig() { } /** * Generate upgrade to pro message */ public function upgradeToProMessage() { } public function fields() { } } class PaddlePromo extends \FluentCart\App\Modules\PaymentMethods\Core\AbstractPaymentGateway { public array $supportedFeatures = []; public function __construct() { } public function meta(): array { } public function makePaymentFromPaymentInstance(\FluentCart\App\Services\Payments\PaymentInstance $paymentInstance) { } public function handleIPN() { } public function getOrderInfo(array $data) { } /** * Get Paddle-specific notice configuration */ private function getNoticeConfig() { } /** * Generate upgrade to pro message */ public function upgradeToProMessage() { } public function fields() { } } class PromoGatewaySettings extends \FluentCart\App\Modules\PaymentMethods\Core\BaseGatewaySettings { protected $gatewaySlug; protected $customStyles = []; public function __construct($gatewaySlug) { } public static function getDefaults() { } public function get($key = null) { } public function getMode() { } public function isActive(): bool { } public function setCustomStyles($styles) { } protected function getPromoNoticeStyles() { } /** * Render SVG icon */ protected function renderIcon($svgPath, $styles = '') { } /** * Render a feature list item with checkmark */ protected function renderFeatureItem($text, $mode = 'light') { } /** * Check if FluentCart Pro is installed */ protected function isProInstalled() { } /** * Check if FluentCart Pro is active */ protected function isProActive() { } /** * Render upgrade or activate button */ protected function renderActionButton($mode = 'light') { } /** * Generate upgrade to pro notice HTML * * @param array $config Configuration array with: * - title: Gateway title * - description: Gateway description * - features: Array of feature strings * - icon_path: SVG path for the gateway icon * - footer_text: Optional footer text * @return string HTML for the upgrade notice */ public function generateUpgradeNotice($config) { } } } namespace FluentCart\App\Modules\PaymentMethods\StripeGateway\API { class API { private $createSessionUrl; private $apiUrl = 'https://api.stripe.com/v1/'; public function makeRequest($path, $data = [], $apiKey = null, $method = 'GET') { } public function getStripeObject($path, $data = [], $mode = 'current') { } public function createStripeObject($path, $data = [], $mode = 'current', $headers = []) { } public function deleteStripeObject($path, $data = [], $mode = 'current') { } public function remoteRequest($path, $data, $apiKey, $method, $extraHeaders = []) { } public function verifyIPN() { } public function getEvent($eventId) { } public function getApi() { } public function getApiKey($mode = 'current') { } public function addWebhookEndpoint() { } public function getWebhookEndpoints() { } public function getActivatedPaymentMethodsConfigs($mode = 'live') { } } trait RequestProcessor { private static function processResponse($response) { } private static function errorHandler($code, $message, $data = []) { } } class Account { use \FluentCart\App\Modules\PaymentMethods\StripeGateway\API\RequestProcessor; public static function retrive($accountId, $key) { } } /** * WC_Stripe_API class. * * Communicates with Stripe API. */ class ApiRequest { /** * Stripe API Endpoint */ private static $ENDPOINT = 'https://api.stripe.com/v1/'; const STRIPE_API_VERSION = '2025-02-24.acacia'; /** * Secret API Key. * @var string */ private static $secret_key = ''; /** * Set secret API Key. * @param string $secret_key */ public static function set_secret_key($secret_key) { } /** * Set secret API Key. * @param string $secret_key */ public static function set_end_point($endpont) { } /** * Get secret key. * @return string */ public static function get_secret_key() { } /** * Generates the user agent we use to pass to API request so * Stripe can identify our application. * * @since 4.0.0 * @version 4.0.0 */ public static function get_user_agent() { } /** * Generates the headers to pass to API request. * * @since 4.0.0 * @version 4.0.0 */ public static function get_headers() { } /** * Send the request to Stripe's API * * @param array $request * @param string $api * @param string $method * @return object|\WP_Error * @since 3.1.0 * @version 4.0.6 */ public static function request($request, $api = 'charges', $method = 'POST') { } /** * Retrieve API endpoint. * * @param string $api * @return mixed|\WP_Error|null * @since 4.0.0 * @version 4.0.0 */ public static function retrieve($api) { } } } namespace FluentCart\App\Modules\PaymentMethods\StripeGateway { class Confirmations { public function init() { } private function confirmByCheckoutSession($sessionId, $transaction) { } /** * Process payment intent confirmation */ private function processPaymentIntentConfirmation($intent, $transaction) { } /** * Extract billing info from charge for subscription confirmation */ private function extractBillingInfoFromCharge($charge) { } /* * Only for validating hosted checkout payment confirmation */ public function confirmStripePayment() { } // make sure customer given the acknowledgement for saving the payment methods public function savePaymentMethodToCustomerMeta($vendorCustomer, $paymentMethodId, $order) { } public function confirmSetupIntent($setupIntent, $trxHash = null) { } /** * Vault the token for a system subscription, or demote to manual when the * initial checkout capture came back without one — mirrors PayPal's * Processor::maybePersistVaultToken(). */ private function maybePersistSystemVaultToken($subscription, $order, $billingInfo) { } public function getPaymentMethodDetails($methodId) { } public function syncRemoteTransaction(\FluentCart\App\Models\OrderTransaction $transaction) { } /** * Confirm payment success by charge. * Currently used by: * - fluent_cart/payments/stripe/webhook_charge_succeeded * - * * @param \FluentCart\App\Models\OrderTransaction $transaction * @param array $args * @param array $args ['charge'] - The charge details from Stripe. * @param string $args ['intent_id'] - The intent ID from Stripe. */ public function confirmPaymentSuccessByCharge(\FluentCart\App\Models\OrderTransaction $transaction, $args = []) { } } } namespace FluentCart\App\Modules\PaymentMethods\StripeGateway\Connect { class ConnectConfig { private static $connectBase = 'https://api.fluentcart.com/connect/'; public static function handleConnect($data) { } public static function getConnectConfig(): array { } public static function verifyAuthorizeSuccess($data) { } private static function getAccountInfo($settings, $mode) { } public static function disconnect($mode, $sendResponse = true) { } } } namespace FluentCart\App\Modules\PaymentMethods\StripeGateway { class Plan { /** * Get or create a Stripe pricing plan for a product variation. * * @param array $data { * @type string $product_id Product ID. * @type string $variation_id Variation ID. * @type string $trial_days Trial Days. * @type string $billing_interval Billing interval (e.g., 'month', 'year'). * @type string $currency Currency code (e.g., 'usd'). * @type int $interval_count Number of intervals. * @type int $recurring_total Recurring total amount (in cents). * } * * @return \WP_Error|array */ public static function getStripePricing($data = []) { } /** * Get or create a Stripe pricing plan for a product variation. * * @param array $data { * @type string $product_id Product ID.\ * @type string $currency Currency code (e.g., 'usd'). * @type int $amount Amount in cents. * } * * @return \WP_Error|array */ public static function getOneTimeAddonPrice($data = []) { } public static function retriveOrCreateProduct($productData = []) { } public static function convertFctIntervalToStripeInterval($billingInterval) { } } class Processor { public function handleSubscription(\FluentCart\App\Services\Payments\PaymentInstance $paymentInstance, $paymentArgs) { } /** * A retryable checkout can arrive with a live Stripe subscription already * attached — the previous create succeeded but its confirm/webhook never * landed, and a changed cart mints a fresh idempotency key, so the key alone * cannot stop a second create. A second create bills the customer on a * subscription the store cannot see or cancel. Billing-active remote: block * the create and re-sync local state from Stripe. Unconfirmed incomplete * remote: cancel it so the fresh create is the only confirmable one. */ private function guardExistingRemoteSubscription($subscriptionModel) { } /** * Handle single payment for stripe (onsite or hosted) * * @return \WP_Error|array */ /** * Zero-payable system (auto-charged) subscription checkout — a free trial with * nothing to pay today. A $0 PaymentIntent is invalid, so the card is vaulted * via a SetupIntent instead; confirmation (Confirmations::confirmSetupIntent) * persists the token, completes the $0 order, and activates the trial. The * trial-end invoice is then charged off-session like any other system renewal. * * Consent is REQUIRED here (not just disclosed): without a saved card the * trial can never bill, so a checkout without the consent flag is rejected. */ public function handleSetupOnlyPayment(\FluentCart\App\Services\Payments\PaymentInstance $paymentInstance, $paymentArgs = []) { } /** * Hosted-checkout counterpart to handleSetupOnlyPayment() — hosted mode never * loads Stripe.js/Elements, so a zero-payable system-subscription checkout * redirects to a Checkout Session in `mode: setup` instead of a client-side * SetupIntent. The session's auto-created setup_intent id is stored as * vendor_charge_id so setup_intent.succeeded / confirmByCheckoutSession * resolve the transaction exactly like the onsite path. */ public function handleHostedSetupOnlyCheckout(\FluentCart\App\Services\Payments\PaymentInstance $paymentInstance, $paymentArgs = []) { } public function handleSinglePayment(\FluentCart\App\Services\Payments\PaymentInstance $paymentInstance, $paymentArgs = []) { } private function handleHostedCheckout(\FluentCart\App\Services\Payments\PaymentInstance $paymentInstance, $paymentArgs = []) { } private function handleHostedSubscriptionCheckout(\FluentCart\App\Services\Payments\PaymentInstance $paymentInstance, $paymentArgs = []) { } } class Stripe extends \FluentCart\App\Modules\PaymentMethods\Core\AbstractPaymentGateway { private $methodSlug = 'stripe'; public array $supportedFeatures = ['payment', 'refund', 'webhook', 'custom_payment', 'card_update', 'switch_payment_method' => ['supported_gateways' => ['stripe', 'paypal']], 'dispute_handler', 'subscriptions', 'zero_recurring', 'system_subscription', 'manual_subscription']; public \FluentCart\App\Modules\PaymentMethods\Core\BaseGatewaySettings $settings; public function __construct() { } public function boot() { } public function meta(): array { } public function makePaymentFromPaymentInstance(\FluentCart\App\Services\Payments\PaymentInstance $paymentInstance) { } public function convertManualSubscription($paymentInstance, $paymentArgs) { } /** * Stripe can vault a card without charging — the onsite Elements flow uses a * client-side SetupIntent, hosted mode redirects to a Checkout Session in * `mode: setup` (Processor::handleHostedSetupOnlyCheckout()). */ public function supportsSetupWithoutCharge(): bool { } /** * Off-session charge of a system subscription's renewal invoice using the * stored token. Success flows through confirmPaymentSuccessByCharge so the * normal renewal-paid path (syncOrderStatuses / handleRenewalPaid) runs. * * @param \FluentCart\App\Services\Payments\PaymentInstance $paymentInstance * @param array $args ['attempt' => int] * @return true|'processing'|\WP_Error true = confirmed; 'processing' = charge * accepted, webhook will confirm */ public function chargeRenewal(\FluentCart\App\Services\Payments\PaymentInstance $paymentInstance, $args = []) { } /** * Re-check a processing off-session renewal charge. Recovers missed webhooks: * a settled intent is confirmed through confirmPaymentSuccessByCharge. * * @param \FluentCart\App\Services\Payments\PaymentInstance $paymentInstance * @return true|'processing'|\WP_Error */ public function reconcileRenewalCharge(\FluentCart\App\Services\Payments\PaymentInstance $paymentInstance) { } public function syncRemoteTransaction(\FluentCart\App\Models\OrderTransaction $transaction) { } /** * Ensure the Stripe secret key for the given order mode is configured before an * off-session charge / reconcile. Returns a clear WP_Error when it is missing — * otherwise Stripe replies with the opaque "You did not provide an API key" * message. Null when the key is present. * * @param string $mode The order's Stripe mode ('test' | 'live'). * @return \WP_Error|null */ private function guardSecretKeyForMode($mode) { } private function shouldRenderAsSubscriptionMode($hasSubscription): bool { } public function processRefund($transaction, $amount, $args) { } public function webHookPaymentMethodName() { } public function handleIPN(): void { } public function getEnqueueScriptSrc($hasSubscription = 'no'): array { } private function getStripeLocale(): string { } public function getLocalizeData(): array { } public static function beforeSettingsUpdate($data, $oldSettings): array { } public static function validateSettings($data): array { } public function fields(): array { } public function getPublicKey($pre = '') { } public function getTransactionUrl($url, $data): string { } public function getSubscriptionUrl($url, $data): string { } public function getOrderInfo($data) { } public function getConnectInfo(): array { } public function disconnect($mode): bool { } public function getCounterDisputeUrl($transaction) { } public function acceptRemoteDispute($transaction, $args = []) { } public function isCurrencySupported(): bool { } } class StripeHelper { public static function createOrGetStripeCustomer(\FluentCart\App\Models\Customer $customer) { } public static function transformSubscriptionStatus($stripeSubscription, $subscriptionModel = null) { } public static function getSubscriptionUpdateData($stripeSubscription, $subscriptionModel = null) { } public static function processRemoteRefund($transaction, $amount, $args) { } public static function createOrUpdateIpnRefund($refundData, $parentTransaction) { } /* * To validate by session, id * */ public static function validateBySession($id) { } public static function getCancelUrl(): string { } } class StripeSettingsBase extends \FluentCart\App\Modules\PaymentMethods\Core\BaseGatewaySettings { public $settings; public $methodHandler = 'fluent_cart_payment_settings_stripe'; public function __construct() { } /** * @return array with default fields value */ public static function getDefaults() { } public function isActive(): bool { } public function get($key = '') { } public function updateSettings($settings) { } public function getMode() { } public function getPublicKey() { } public function getApiKey($mode = 'current') { } } class StripeSubscriptions extends \FluentCart\App\Modules\PaymentMethods\Core\AbstractSubscriptionModule { public function reSyncSubscriptionFromRemote(\FluentCart\App\Models\Subscription $subscriptionModel) { } public function cancel($vendorSubscriptionId, $args = []) { } public function cardUpdate($data, $subscriptionId) { } public function switchPaymentMethod($data, $subscriptionId) { } } class SubscriptionsManager { public function updateSubscriptionStatus($subscriptionId, $status) { } public function validate($vendorChargeId, $data) { } /** * verify payment method via SetupIntent for future off-session payments, fraud prevention, and SCA compliance. * @return true | wp_send_json_success | wp_send_json_error * @throws \Exception */ public static function verifyPaymentMethod($paymentMethodId, $customerId, $offSession = true) { } /** * Check rate limit for SetupIntent creation to prevent card testing fraud. * * Rate limit: 7 attempts per day per customer by default (for subscription * card updates), overridable via the * fluent_cart/stripe/setup_intent_rate_limit_customer_daily filter. The SAME * filter default feeds getRemainingRateLimit(), so enforcement and the * displayed remaining count share one contract. * * @param string $customerId Stripe customer ID * @return bool|\WP_Error Returns true if allowed, WP_Error if rate limited */ protected static function checkRateLimit($customerId) { } public function getRemainingRateLimit($customerId) { } public function getOrCreateStripeCustomer($pm) { } public static function addOldSubscriptionMeta($subscriptionId, $oldSubData) { } public static function sendError($message, $code = 423) { } // Used by IPN and Charge Success to confirm subscription after charge succeeded public function confirmSubscriptionAfterChargeSucceeded(\FluentCart\App\Models\Subscription $subscription, $billingInfo = []) { } } class SwitchCustomerMethod { private $subscriptions; public function __construct() { } /** * @throws \Exception */ public function switchPayMethod($data, $subscriptionId) { } private function validateRequest($data, $subscriptionId): bool { } private function attachPaymentMethodToCustomer($customerId, $paymentMethodId) { } /** * @throws \Exception */ private function createStripeSubscription($customerId, $paymentMethodId, $plan, $processedSubscriptionItem, $order) { } private function updateSubscription($subscriptionId, $newSub, $plan, $customerId) { } private function updateBillingInfo($subscriptionId, $pm) { } private function handleOldSubscription($oldData, $newSub, $subscriptionModel) { } public function getSubscriptionItem($subscription, $variation) { } public function sendError($message, $code = 423) { } } class UpdateCustomerPaymentMethod { private \FluentCart\App\Modules\PaymentMethods\StripeGateway\SubscriptionsManager $subscriptions; public function __construct() { } /** * @throws \Exception */ public function update($data, $subscriptionId) { } /** * Replace the stored token of a system (auto-charged) subscription. No vendor * subscription exists, so nothing is called on Stripe's subscriptions API: the * new payment method is verified for off-session use (SCA mandate), attached to * the Stripe customer, and written to active_payment_method — which the charge * engine reads at fire time, so the next renewal (or a pending retry) uses it. * * @throws \Exception */ private function updateSystemPaymentMethod(\FluentCart\App\Models\Subscription $subscription, $newPaymentMethod, $verificationStatus) { } public static function updateSubscriptionDefaultPaymentMethod($vendorSubscriptionId, $newPaymentMethodId, $paymentMethod, $customerId, $subscriptionId, $customerDefault = false) { } } } namespace FluentCart\App\Modules\PaymentMethods\StripeGateway\Webhook { class IPN { public function init(): void { } public function handleChargeRefunded($data) { } public function handleChargeSucceeded($data) { } public function handleChargeDisputeCreated($data) { } public function handleChargeDisputeClosed($data) { } /** * Handle checkout.session.completed webhook for hosted checkout mode * This ensures webhooks work properly even if redirect confirmation hasn't happened yet */ public function handleCheckoutSessionCompleted($data) { } public function handleSubscriptionUpdated($data) { } public function verifyAndProcess() { } protected function sendResponse($statusCode = 200, $message = 'Success') { } } class Webhook { const WEBHOOK_ENDPOINT = '?fluent-cart=fct_payment_listener_ipn&method=stripe'; public static function getURL(): string { } public static function getEvents(): array { } public static function webhookInstruction(): array { } public function processAndInsertOrderByEvent($event) { } public function processSubscriptionRenewal($vendorInvoiceObject) { } } } namespace FluentCart\App\Modules\ProductIntegration { class ProductIntegrationHandler { public function handle($order, $customer, $targetHook, $group): void { } public function getProductsFeeds($productIds) { } } } namespace FluentCart\App\Modules\ReportingModule { class OrdersReport { /** * Get Order Stats by a date range which will contain * total_orders, paid_orders, total_paid_order_items, total_paid_amounts * @param string $fromDate datetime string for from date for the report * @param string $toData datetime string for from date for the report. Default: Today's Date Time * @param bool $withCompare if provide the compare values or not * @return array contains */ public function getOrderStats($fromDate, $toDate = false, $withCompare = false) { } } class ProductReport { public static function getStatByProductIds($productIds = [], $ranges = ['-30 days', 'all_time']) { } } class SalesReport { /** * Get Order Sales by a date range which will contain * @return array contains */ public function getSalesGrowth($filters = []): array { } } } namespace FluentCart\App\Modules\Shipping\Http\Controllers\Frontend { class ShippingFrontendController extends \FluentCart\App\Http\Controllers\Controller { public function getAvailableShippingMethods(\FluentCart\Framework\Http\Request\Request $request) { } public function getShippingMethodsListView(\FluentCart\Framework\Http\Request\Request $request) { } public function getCountryInfo(\FluentCart\Framework\Http\Request\Request $request): \WP_REST_Response { } } } namespace FluentCart\App\Modules\Shipping\Http\Controllers { class ShippingClassController extends \FluentCart\App\Http\Controllers\Controller { public function index(\FluentCart\Framework\Http\Request\Request $request) { } public function store(\FluentCart\App\Modules\Shipping\Http\Requests\ShippingClassRequest $request) { } public function show($id) { } public function update(\FluentCart\App\Modules\Shipping\Http\Requests\ShippingClassRequest $request, $id) { } public function destroy($id) { } public function getProfile($id) { } public function getPackages() { } public function savePackages(\FluentCart\Framework\Http\Request\Request $request) { } } class ShippingMethodController extends \FluentCart\App\Http\Controllers\Controller { public function store(\FluentCart\App\Modules\Shipping\Http\Requests\ShippingMethodRequest $request): \WP_REST_Response { } public function update(\FluentCart\App\Modules\Shipping\Http\Requests\ShippingMethodRequest $request): \WP_REST_Response { } public function destroy($method_id) { } } class ShippingZoneController extends \FluentCart\App\Http\Controllers\Controller { public function index(\FluentCart\Framework\Http\Request\Request $request) { } public function store(\FluentCart\App\Modules\Shipping\Http\Requests\ShippingZoneRequest $request) { } public function show($id) { } public function update(\FluentCart\App\Modules\Shipping\Http\Requests\ShippingZoneRequest $request, $id) { } public function destroy($id) { } public function updateOrder(\FluentCart\Framework\Http\Request\Request $request) { } public function getZoneStates(\FluentCart\Framework\Http\Request\Request $request) { } public function getCountriesByContinent() { } } } namespace FluentCart\App\Modules\Shipping\Http\Handlers { class ScriptHandler { public function register() { } } } namespace FluentCart\App\Modules\Shipping\Http\Requests { class ShippingClassRequest extends \FluentCart\Framework\Foundation\RequestGuard { public function beforeValidation() { } /** * @return array */ public function rules() { } /** * @return array */ public function messages() { } /** * @return array */ public function sanitize() { } } class ShippingMethodRequest extends \FluentCart\Framework\Foundation\RequestGuard { public function beforeValidation() { } /** * @return array */ public function rules() { } /** * @return array */ public function messages() { } /** * @return array */ public function sanitize() { } } class ShippingZoneRequest extends \FluentCart\Framework\Foundation\RequestGuard { public function beforeValidation() { } /** * @return array */ public function rules() { } /** * @return array */ public function messages() { } /** * @return array */ public function sanitize() { } } } namespace FluentCart\App\Services\Filter\Concerns { trait HandleRelationalFilter { public array $directRelationalOperator = ['has']; private function isDirectRelationalOperator($property): bool { } private function handleRelation(&$query, $filter) { } } trait HandleDateFilter { /** * Handles date-based filtering for the query. * * @param array $filterItem The filter item containing property, value, and operator. * @return void|null Returns null if the filter is invalid. */ private function handleDate(&$query, array $filterItem) { } /** * Parses the filter item to transform date-based operators into valid query conditions. * * @param array $filter The filter item containing operator and value. * @return array|null The modified filter item or null if invalid. */ private function parseFilterForDate(array $filter): ?array { } } } namespace FluentCart\App\Services\Filter { /** * Class BaseFilter * * Base class for filtering and querying models with simple and advanced filters. * * @package FluentCart\App\Services\Filter */ abstract class BaseFilter { use \FluentCart\App\Services\Filter\Concerns\HandleRelationalFilter, \FluentCart\App\Services\Filter\Concerns\HandleDateFilter; /** * Determines if the filter type is simple or advanced. * * @var string */ public string $filterType = 'simple'; /** * default primary key of the table * * @var ?string */ public ?string $primaryKey = null; /** * Default column used for sorting. * * @var string */ public string $defaultSortBy = 'id'; /** * Column used for sorting, dynamically set from arguments. * * @var string */ public string $sortBy = ''; /** * Default sorting order. * * @var string */ public string $defaultSortType = 'desc'; /** * Sorting order (asc/desc). * * @var string */ public string $sortType = ''; /** * Ids that must be loaded. * * @var array */ public array $includeIds = []; /** * Relations to be loaded with the query. * * @var array */ public array $with = []; /** * Select fields for the query. * * @var ?array */ public array $select = []; /** * Model scopes. * * @var ?array */ public ?array $scopes = []; /** * Search query string for simple filtering. * * @var string */ public string $search = ''; /** * Limit of records. * * @var ?int */ public ?int $limit = null; /** * Number of records to retrieve per page. * * @var int */ public int $perPage = 10; /** * Current page number * * @var ?int */ public ?int $page = null; /** * The offset for paginated results. * * @var ?int */ public ?int $offset = null; /** * The active view/tab to be filtered. * * @var string|null */ public ?string $activeView = ''; /** * HTTP request instance. * * @var \FluentCart\Framework\Http\Request\Request */ protected \FluentCart\Framework\Http\Request\Request $request; /** * Query builder instance used for filtering and retrieving data. * * @var \FluentCart\Framework\Database\Orm\Builder|\FluentCart\Framework\Pagination\LengthAwarePaginator */ public $query; /** * Additional filtering arguments. * * @var array */ public array $args = []; /** * Parsed search groups for advanced filtering. * * @var array */ public array $searchGroups = []; /** * User timezone * * @var ?string */ public ?string $userTz = null; /** * The resolved SavedView model when active_view is a saved view slug. * * @var SavedView|null */ protected $activeSavedView = null; /** * BaseFilter constructor. * * @param array $args Filtering arguments. */ public function __construct(array $args = []) { } /** * Validates the model instance. * * @return void * @throws \InvalidArgumentException */ protected function validateModel() { } /** * Parses filtering arguments. * * @param array $args Filtering arguments. * @return void */ protected function parseArgs(array $args) { } protected function parseSelect(): array { } protected function parseIncludeIds(): array { } protected function parsePerPage() { } protected function parsePageNumber(): ?int { } /** * Parses and validates the sorting column. * * @return string */ protected function parseSortBy(): string { } /** * Parses and validates the sorting order. * * @return string */ protected function parseSortType(): string { } /** * Parses and validates the accepted view. * First checks static tabs; if not found, fires a filter so Pro can resolve * the slug to a saved view (returns an object/array with query_params). * * @return string|null */ protected function parseAcceptedView(): ?string { } /** * Parses advanced search filters. * * @return array */ protected function parseSearchGroups(?string $json = null): array { } /** * Sets the HTTP request instance. * * @param \FluentCart\Framework\Http\Request\Request $request * @return $this */ public function setRequest(\FluentCart\Framework\Http\Request\Request $request): \FluentCart\App\Services\Filter\BaseFilter { } /** * Builds the query based on filters. * * @return \FluentCart\Framework\Database\Orm\Builder */ public function buildQuery(): \FluentCart\Framework\Database\Orm\Builder { } protected function applyCurrentFilterLayer(): void { } protected function applySavedViewFilter(?array $params = null): void { } protected function getSavedViewParams(): array { } protected function getSavedViewSearchGroups(array $params): array { } /** * Builds the common query that should be applied in every query. * * @return void */ protected function buildCommonQuery() { } public function applySelect() { } protected function getPrimaryKey(): string { } protected function applyMustLoadIds() { } protected function applyLimit() { } protected function applyOffset() { } protected function applySort() { } protected function applyWith() { } protected function applyScopes() { } /** * Applies advanced filters to the query. * * @return void */ protected function applyAdvancedFilter(?array $searchGroups = null): void { } /** * Merge relation filter items that target the same relation field with compatible operators. * This prevents multiple whereHas() subqueries ANDed together for the same relation column, * which would return no results (e.g., license status IN ('active') AND license status IN ('expired')). */ private function mergeRelationFilters(array $items): array { } private function handleAdvanceFilter($query, $filterItem) { } private function handleOperator(\FluentCart\Framework\Database\Orm\Builder &$query, array $filterItem) { } private function searchFromArray(\FluentCart\Framework\Database\Orm\Builder &$query, array $filterItem) { } private function searchFromString(\FluentCart\Framework\Database\Orm\Builder &$query, array $filterItem) { } /** * Apply the simple Filters. * * @return void */ abstract public function applySimpleFilter(?string $search = null): void; abstract public function applyActiveViewFilter(?string $activeView = null): void; /** * Return the maps of [table-column, tabs-name] * * @return array */ abstract public function tabsMap(): array; /** * Return Model name * * @return string */ abstract public function getModel(): string; private function getDbColumns(): array { } /** * Return the columns that are searchable * * @return array */ public static function getSearchableFields(): array { } /** * Return the operators that are supported for simple filters * * @return array */ public function getSimpleOperators($except = []): array { } public function applySimpleOperatorFilter(?string $search = null): bool { } public function shouldApplyMatchFilter(string $operator): bool { } public function applyMatchFilter(\FluentCart\Framework\Database\Orm\Builder $query, string $column, $value, string $operator = '='): \FluentCart\Framework\Database\Orm\Builder { } public function centColumns(): array { } public function dateColumns(): array { } /** * Return the name of filter * * @return string */ abstract public static function getFilterName(): string; /** * Return the maps of [key, key-name] * It's used for parse the data * * @return array */ public static function parseableKeyMap(): array { } /** * Return the names of allowed keys preserved in data * * @return array */ public static function parseableKeys(): array { } /** * Return the names of the kye, which should be used to parse the value * * @param string $key // Name of the Key * @return string */ private function getParsableKey(string $key): string { } public function query() { } public function setQuery(\FluentCart\Framework\Database\Orm\Builder $query): \FluentCart\App\Services\Filter\BaseFilter { } public function customQuery() { } public function get() { } public function paginate($perPage = null): \FluentCart\Framework\Pagination\LengthAwarePaginator { } public static function fromRequest(\FluentCart\Framework\Http\Request\Request $request): \FluentCart\App\Services\Filter\BaseFilter { } public static function make(array $args): \FluentCart\App\Services\Filter\BaseFilter { } public static function getAdvanceFilterOptions(): ?array { } private static function advanceFilterOptions(): ?array { } public static function getCustomColumns() { } public static function getTableFilterOptions(): array { } public function toArray(): array { } } } namespace FluentCart\App\Modules\Shipping\Services\Filter { class ShippingClassFilter extends \FluentCart\App\Services\Filter\BaseFilter { public function applySimpleFilter(?string $search = null): void { } public function tabsMap(): array { } public function getModel(): string { } public static function getFilterName(): string { } public function applyActiveViewFilter(?string $activeView = null): void { } public static function getAdvanceFilterOptions(): ?array { } } class ShippingZoneFilter extends \FluentCart\App\Services\Filter\BaseFilter { public function applySimpleFilter(?string $search = null): void { } public function getModel(): string { } public static function getFilterName(): string { } protected function defaultSorting(): array { } public static function getAdvanceFilterOptions(): ?array { } public function applyActiveViewFilter(?string $activeView = null): void { } public function tabsMap(): array { } } } namespace FluentCart\App\Modules\Shipping { class ShippingModule { public static function register() { } public function init($app) { } public function handleItemsChanges($data) { } public function maybeRecalculateShippingCharges($fillData, $data) { } private function getRecalculatedCartDataArr($fillData, $cart) { } private function cartHasShippingClasses($cartData) { } } } namespace FluentCart\App\Modules\StockManagement { class StockManagement { public function register($app) { } public function filterShopQuery($query, $params) { } public function manageStockOnOrderCreated($event) { } public function manageStockOnShippingStatusChanged($event) { } public function manageStockOnOrderStatusChanged($event) { } public function manageStockOnOrderRefunded($data) { } public function manageStockOnOrderPaid($event) { } public function manageStockOnOrderUpdated($event) { } } } namespace FluentCart\App\Modules\StorageDrivers\Contracts { interface BaseStorageInterface { public function isEnabled(): bool; } } namespace FluentCart\App\Modules\StorageDrivers { abstract class BaseStorageDriver implements \FluentCart\App\Modules\StorageDrivers\Contracts\BaseStorageInterface { public $slug; public $title; public $brandColor = '#ccc'; protected $driverHandler; public static $drivers = []; public static $routes = []; abstract public function getLogo(); public function getDarkLogo() { } abstract public function getDescription(); abstract public function getSettings(); abstract public function fields(); public function __construct($title, $slug, $brandColor) { } /** * @param array $data * @return array|true|\WP_Error */ public function verifyConnectInfo(array $data, $args = []) { } abstract public function hiddenSettingKeys(): array; public function init() { } public function registerHooks() { } public function handleRedirectData() { } public function setRoutes($data, $args) { } public function register($data, $args) { } public function hasBucket(): bool { } public function needsReconfigure(): bool { } public function getActiveStatus($data, $args) { } public function getTitle($scope = 'admin') { } public function renderDescription() { } public function saveSettings($data) { } public function resetSettings() { } public function updateSettings($data) { } public function globalFields($data, $args) { } public function hasSettingsTemplate(): bool { } public function getSettingsTemplate(): ?string { } public function getSettingsTemplatePayload(array $response = []): array { } public function sanitize($data, $fields) { } protected function validate($data, array $rules = []) { } abstract public function getDriverClass(): string; } abstract class BaseStorageSettings { protected $settings; protected $driverHandler = 'fluent_cart_storage_settings_'; public function __construct($slug) { } abstract protected function getDefaultSettings(); abstract public function isActive(); public function get() { } } } namespace FluentCart\App\Modules\StorageDrivers\Local { class Local extends \FluentCart\App\Modules\StorageDrivers\BaseStorageDriver { /** * title, slug, brandColor */ public function __construct() { } public function registerHooks() { } public function getLogo(): string { } public function getDescription(): string { } public function isEnabled(): bool { } public function getSettings() { } public function fields(): array { } public function getDriverClass(): string { } public function hiddenSettingKeys(): array { } } class LocalSettings { protected $settings; protected $driverHandler = 'fluent_cart_storage_settings_local'; static ?array $cachedSettings = null; public function __construct() { } public static function getDefaults() { } public function isActive() { } public function get($key = '') { } } } namespace FluentCart\App\Modules\StorageDrivers\S3 { class S3 extends \FluentCart\App\Modules\StorageDrivers\BaseStorageDriver { /** * title, slug, brandColor */ public function __construct() { } public function registerHooks() { } public function getBucketList($buckets = [], $args = []): array { } public function getLogo(): string { } public function getDarkLogo() { } public function hasBucket(): bool { } public function needsReconfigure(): bool { } public function getDescription() { } public function isEnabled(): bool { } public function getSettings() { } public function getSettingsTemplate(): ?string { } public function getSettingsTemplatePayload(array $response = []): array { } public function listBuckets(array $data, array $args = []) { } public function createBucket(array $data) { } public function updateSettings($data) { } private function requireCredentials(array $data) { } private function resolveCredentials(array $data): array { } public function resetSettings() { } private function prepareSettingsForStorage(array $settings): array { } /** * Verify Connect configuration */ public function verifyConnectInfo(array $data, $args = []) { } public function fields(): array { } public function getDriverClass(): string { } public function hiddenSettingKeys(): array { } public static function getBucketRegion($bucket) { } private function isTrue($value) { } } class S3Settings { protected const MISSING_DEFINE_CREDENTIALS_MESSAGE = 'S3 was configured previously, but the wp-config.php credentials are missing now. Add them again to continue.'; protected $settings; protected $driverHandler = 'fluent_cart_storage_settings_s3'; static ?array $cachedSettings = null; public bool $isUsingDefineMode = false; public function __construct() { } public static function getDefaults() { } public function get($key = '') { } public static function resolveConfiguredBucket(array $settings): string { } public static function resolveEffectiveBucket(array $settings): string { } protected function applyDefineCredentialsState(): void { } public function isActive() { } public function getAuthMethod() { } private function hasRequiredKeys(array $settings, array $requiredKeys): bool { } public static function hasDefinedCredentials(): bool { } public static function getDefinedCredentials(): array { } } } namespace FluentCart\App\Modules\StoreManagedRenewal { class RenewalModule { public static function register() { } public function init($app) { } } } namespace FluentCart\App\Modules\StoreManagedRenewal\Services { class RenewalScheduler { /** * Register the scheduler hook for hourly processing */ public function register() { } /** * Handle the hourly task to process due subscriptions, overdue invoices, and reminders */ public function handle() { } } class RenewalService { /** * Create renewal invoice for a subscription with manual payment method. * Invoices are created in advance (before the billing date) so customers * have time to pay before their period ends. * * @param \FluentCart\App\Models\Subscription $subscription * @return array|\WP_Error Array with created order or empty array */ public static function createRenewalOrders(\FluentCart\App\Models\Subscription $subscription) { } private static function copyParentOrderSnapshot(\FluentCart\App\Models\Order $parentOrder, \FluentCart\App\Models\Order $childOrder): void { } /** * Calculate how many invoices are needed for a subscription * * This method determines how many billing cycles have been missed * and returns the number of invoices that need to be created * * @param Subscription $subscription * @return int Number of invoices needed */ /** * Process multiple subscriptions and create renewal orders * * @param int $limit Maximum number of subscriptions to process * @return array Results with processed and failed subscriptions */ /** * Cheap guard for the store-managed crons: does this site have any manual/system * subscription at all? Skips the heavy renewal/overdue scans on automatic-only stores. */ private static function hasStoreManagedSubscriptions(): bool { } public static function processDueSubscriptions($limit = 50) { } private static function applyRenewalCreationReadiness($query): void { } private static function applyAdvanceCreationWindow($query): void { } /** * Handle invoice payment - sync subscription state after manual invoice is paid. * * - Paid on or before due_date: next_billing_date = due_date + interval (cadence preserved) * - Paid after due_date (late): next_billing_date = paid_at + interval * * Uses syncSubscriptionStates() to derive bill_count from actual succeeded transactions * and handle EOT/status transitions consistently with automatic subscriptions. * * @param array $data Event data containing order, transaction, customer */ public static function handleRenewalPaid(array $data): void { } /** * Process overdue invoices and transition subscription statuses * * Thresholds are anchored to the invoice due_date, not a multiple of the billing * interval (a fixed 1×/2× interval would give a yearly plan a 365/730-day limbo): * - Due date passed: active/trialing → past_due * - Past the per-interval grace period: past_due → expired * * The grace period reuses SubscriptionHelper::getSubscriptionsGracePeriodDays() * (filter fluent_cart/subscription/grace_period_days) — the same map the automatic * expiry cron uses, so manual and automatic subscriptions expire on one contract. * * @param int $limit Maximum number of invoices to process * @return array Results with past_due and expired counts */ public static function processOverdueRenewals(int $limit = 50): array { } /** * Advance next_billing_date one (or more, if overdue) whole intervals ahead, * keeping day-of-cycle alignment. Pure — no persistence, no side effects. * * @return string|null Advanced GMT datetime, or null when there is no billing date * or the interval cannot be resolved (unknown billing_interval). */ public static function computeSkippedDate(\FluentCart\App\Models\Subscription $subscription): ?string { } /** * Admin "Skip Next Period" for a store-billed subscription. Advances * next_billing_date by one interval without creating an invoice. * * Atomic: the date advance is a compare-and-swap on the original * next_billing_date, so two racing skips cannot both advance the same period, * and the void, marker, and audit commit as one unit. The no-stacked-skip * invariant is enforced here so the button and the API share one guard. * * @param string $note Optional admin reason for the skip, recorded in the audit trail and log. * @return array{skipped: bool, old_next_billing_date?: string, new_next_billing_date?: string, reason?: string} */ public static function skipNextPeriod(\FluentCart\App\Models\Subscription $subscription, string $note = ''): array { } /** * Advance a manual subscription's next_billing_date past a voided invoice's period. * * Voiding alone only cancels the invoice row; the subscription's next_billing_date * is unchanged, so processDueSubscriptions regenerates the same invoice within the * hour. Moving the billing date one interval past the voided period makes the void * genuinely skip that period (same end state as skipNextPeriod, for a single * admin-voided invoice). * * @param \FluentCart\App\Models\Order $voidedInvoice The renewal order that was just voided. * @return void */ public static function advanceAfterVoid(\FluentCart\App\Models\Order $voidedInvoice): void { } /** * How many days before its due date a renewal invoice is generated, per billing * interval. Single source of truth for both the scheduler and the admin info display. * Filterable so developers can tune the advance window per interval. * * @param string $interval Billing interval being looked up ('' when the full map is wanted). * @return array */ public static function getAdvanceCreationDaysMap(string $interval = ''): array { } } } namespace FluentCart\App\Modules\Subscriptions\Http\Controllers { class SubscriptionController extends \FluentCart\App\Http\Controllers\Controller { public function index(\FluentCart\Framework\Http\Request\Request $request): array { } public function getSubscriptionOrderDetails($subscriptionOrderId) { } public function validateSubscription($subscription) { } private function validateOrderBinding(\FluentCart\App\Models\Order $order, \FluentCart\App\Models\Subscription $subscription) { } public function cancelSubscription(\FluentCart\Framework\Http\Request\Request $request, \FluentCart\App\Models\Order $order, \FluentCart\App\Models\Subscription $subscription) { } public function reactivateSubscription(\FluentCart\Framework\Http\Request\Request $request, \FluentCart\App\Models\Order $order, \FluentCart\App\Models\Subscription $subscription) { } public function fetchSubscription(\FluentCart\Framework\Http\Request\Request $request, \FluentCart\App\Models\Order $order, \FluentCart\App\Models\Subscription $subscription) { } public function pauseSubscription(\FluentCart\Framework\Http\Request\Request $request, \FluentCart\App\Models\Order $order, \FluentCart\App\Models\Subscription $subscription) { } public function resumeSubscription(\FluentCart\Framework\Http\Request\Request $request, \FluentCart\App\Models\Order $order, \FluentCart\App\Models\Subscription $subscription) { } public function updateSubscription(\FluentCart\App\Http\Requests\UpdateSubscriptionRequest $request, \FluentCart\App\Models\Order $order, \FluentCart\App\Models\Subscription $subscription) { } public function generateEarlyPaymentLink(\FluentCart\Framework\Http\Request\Request $request, \FluentCart\App\Models\Order $order, \FluentCart\App\Models\Subscription $subscription) { } /** * Run one immediate off-session charge attempt on the subscription's open * renewal invoice. A card decline is HTTP 200 with status "failed" — the * request worked, the charge did not. State violations are sendError 4xx. */ public function chargeNow(\FluentCart\Framework\Http\Request\Request $request, \FluentCart\App\Models\Order $order, \FluentCart\App\Models\Subscription $subscription) { } public function createRenewalNow(\FluentCart\Framework\Http\Request\Request $request, \FluentCart\App\Models\Order $order, \FluentCart\App\Models\Subscription $subscription) { } public function skipRenewal(\FluentCart\Framework\Http\Request\Request $request, \FluentCart\App\Models\Order $order, \FluentCart\App\Models\Subscription $subscription) { } } } namespace FluentCart\App\Modules\Subscriptions\Http\Handlers { class AdminMenuHandler { public function register() { } } } namespace FluentCart\App\Modules\Subscriptions\Http\Policies { class SubscriptionsPolicy extends \FluentCart\Framework\Foundation\Policy { /** * Check user permission for any method * @param \FluentCart\Framework\Http\Request\Request $request * @return Boolean */ public function verifyRequest(\FluentCart\Framework\Http\Request\Request $request) { } /** * Check user permission for any method * @param \FluentCart\Framework\Http\Request\Request $request * @return Boolean */ public function create(\FluentCart\Framework\Http\Request\Request $request) { } } } namespace FluentCart\App\Modules\Subscriptions\Services { class EarlyPaymentFeature { public static function isEnabled(): bool { } public static function canPay(\FluentCart\App\Models\Subscription $subscription): bool { } } } namespace FluentCart\App\Modules\Subscriptions\Services\Filter { class SubscriptionFilter extends \FluentCart\App\Services\Filter\BaseFilter { public function applySimpleFilter(?string $search = null): void { } public function tabsMap(): array { } public function getModel(): string { } public static function getFilterName(): string { } public function applyActiveViewFilter(?string $activeView = null): void { } public static function getSearchableFields(): array { } public static function advanceFilterOptions(): array { } } } namespace FluentCart\App\Modules\Subscriptions\Services { /** * Checkout gateway visibility for every subscription cart shape: a new * subscription, a renewal invoice, and a reactivation. * * Two rules, one per cart shape: * - New subscription: the store setting decides. `store_managed` admits only * gateways the store can bill itself; `gateway_managed` admits only gateways * that own a schedule, unless the Manual Fallback setting is on. * - Renewal/reactivation: the subscription decides — its `collection_method` * plus how it was BORN (the `management_mode` stamp). A gateway-managed * `automatic` sub keeps its vendor schedule; everything else is store-billed. * * Full decision tables: dev-docs/subscription-engine/payment-rendering-and-conversion-guide.md */ class SubscriptionGatewayGate { public function register() { } public function filterCheckoutPaymentMethods($methods, $data) { } private function gatewaysForNewSubscription($methods, $cart) { } /** * $subscription is null when the cart names one that can't be resolved — the * charge itself will fail later with `no_subscription`, so nothing is gated. */ private function gatewaysForExistingSubscription($methods, $subscription, $cart) { } private static function subscriptionCapableOnly($methods) { } private static function oneTimePaymentOnly($methods) { } /** * Renewal invoices are created days ahead of their due date. Paying one early * through a subscription-capable gateway converts the subscription to automatic * (Stripe.php / PayPal.php) and the vendor schedule starts from TODAY — the days * between now and the due date are forfeited. Store-billed payment keeps the * cadence instead: handleRenewalPaid() anchors the next date to due_date. * * Only gateway-managed carts can convert, so only they need this guard. */ private static function isAdvanceRenewal($cart): bool { } /** Nothing due today: only a gateway that can start the schedule at zero. */ private static function zeroFirstPaymentCapable($methods) { } /** * One-time gateways, plus subscription-capable ones that opt into store * billing (`manual_subscription`) — shouldChargeSubscriptionAsOneTime() routes * both to a single payment, so no vendor schedule is created. `manual_subscription` * only claims a one-time-charge path exists; it says nothing about being able to * vault a card without charging it, so it plays no part in the zero-payable case. * With nothing due today only a gateway that can vault without charging AND is * wired for later auto-charge (`system_subscription`) qualifies. */ private static function storeBilledOnly($methods, $zeroPayable, $autoChargeable) { } private static function currentMethodFirst($methods, $subscription) { } private static function manualFallbackOnGatewayManage(): bool { } /** * Admin-only notice on new-subscription carts explaining which gateways were * hidden and why. Renewal/reactivation carts don't get it — they follow the * subscription, not the store setting. */ public function renderSubscriptionGatewayNotice($data) { } private function isNewSubscriptionCart($cart): bool { } private static function getPayableNow($cart) { } } /** * Store-level choice of WHO manages subscription renewals: gateway_managed * (default, pre-feature behavior) vs store_managed (manual invoicing, no * vendor subscriptions). Stamped into a subscription at checkout, so changing * the setting later never mutates existing subscriptions. */ class SubscriptionManagementMode { const SETTING_KEY = 'subscription_management_mode'; const GATEWAY_MANAGED = 'gateway_managed'; const STORE_MANAGED = 'store_managed'; /** Store setting: auto-charge renewal invoices under store-managed mode (collection_method `system`)? */ const SYSTEM_CHARGE_KEY = 'subscription_system_charge'; /** Store setting: under gateway-managed mode, also admit gateways without native subscription support? */ const MANUAL_FALLBACK_KEY = 'subscription_manual_fallback'; /** Config key stamped at checkout — the durable per-subscription record of the mode it was born under. */ const CONFIG_KEY = 'management_mode'; public static function getMode(): string { } public static function isStoreManaged(): bool { } public static function isSystemChargeEnabled(): bool { } public static function isManualFallbackEnabled(): bool { } public static function resolveCollectionMethodFor($gateway): string { } /** * `system` may only be stored on a gateway that can actually charge it — guards * the `fluent_cart/subscription_collection_method_{gateway}` filter's return value. */ public static function sanitizeCollectionMethod($method, $gateway): string { } public static function isSubscriptionStoreManaged($subscription): bool { } /** * A renewal/reactivation cart resolves via the existing subscription's * collection_method; only a new subscription cart reads the store setting. */ public static function currentCheckoutIsSystem($gateway): bool { } /** * Mirrors AbstractPaymentGateway::shouldChargeSubscriptionAsOneTime() so the * client payment UI matches what makePaymentFromPaymentInstance will do. */ public static function currentCheckoutChargesOneTime(): bool { } public static function resolveRenewalSubscription($cart) { } /** Reads `renew_data.subscription_hash`, set by fluent-cart-pro's instant-cart builder. */ public static function resolveReactivationSubscription($cart) { } } class SubscriptionService { /** * Record a gateway-managed (automatic collection) renewal payment. * * Called from gateway recurring-charge webhooks — Stripe invoice.paid, PayPal IPN, * Mollie, Paddle, Authorize.Net. Creates the renewal child order ALREADY PAID * (payment_status = paid, total_paid = total) in a single insert. * * Because there is no pending → paid transition and syncOrderStatuses() is never * called on the new order, this path does NOT fire fluent_cart/renewal_paid. That * is intentional: both listeners on that hook (RenewalService::handleRenewalPaid, * SystemChargeService::cancelPendingCharge) are scoped to manual/system collection, * and for automatic subscriptions the gateway owns next_billing_date. The renewal is * announced here by dispatching SubscriptionRenewed instead — the one event that * covers both renewal paths. Anything that must react to every renewal regardless of * collection method belongs on SubscriptionRenewed, not on renewal_paid. * * Exception: when a pending/scheduled invoice already exists for this subscription, * this method delegates to recordManualRenewal() below, which DOES go through * syncOrderStatuses() and therefore does fire renewal_paid. * * @param array $transactionData * @param \FluentCart\App\Models\Subscription|null $subscriptionModel * @param array $subscriptionUpdateArgs * @return \FluentCart\App\Models\OrderTransaction|\WP_Error */ public static function recordRenewalPayment($transactionData, $subscriptionModel = null, $subscriptionUpdateArgs = []) { } /** * @param $subscriptionModel * @param $subscriptionUpdateArgs * - next_billing_date - You must provide this if you want to update the next billing date. * * - Accepts all other filliable attributes of the Subscription model. * @return mixed */ public static function syncSubscriptionStates(\FluentCart\App\Models\Subscription $subscriptionModel, $subscriptionUpdateArgs = []) { } /** * * Use this method when you are reactivating a expired subscription manually by creating order, transaction etc. * Make sure you already handle your transaction statuses! * * @param \FluentCart\App\Models\Subscription $subscriptionModel * @param \FluentCart\App\Models\OrderTransaction $transaction * @param $args * @return mixed */ public static function recordManualRenewal(\FluentCart\App\Models\Subscription $subscriptionModel, \FluentCart\App\Models\OrderTransaction $transaction, $args = []) { } /** * Single dispatch point for subscription lifecycle status events. * * Every confirmed transition — manual local update, gateway sync response, or * gateway webhook/confirmation — routes through here so the first-class event * (and the hook it fires) happens exactly once, whatever path caused the change. * * @param \FluentCart\App\Models\Subscription $subscription * @param string $event One of: paused, resumed, updated, period_skipped * @param array $context order, customer, old_status, reason, updates, changes, * old_next_billing_date, new_next_billing_date * @return void */ public static function dispatchStatusEvent(\FluentCart\App\Models\Subscription $subscription, string $event, array $context = []) { } /** * Pause a subscription * * For manual subscriptions, this just updates the local status. * For automatic subscriptions, delegates to the gateway. * * @param \FluentCart\App\Models\Subscription $subscription * @param string $reason * @return true|\WP_Error */ public static function pauseSubscription(\FluentCart\App\Models\Subscription $subscription, $reason = '') { } /** * Resume a paused subscription * * For manual subscriptions, this updates status back to active. * For automatic subscriptions, delegates to the gateway. * * @param \FluentCart\App\Models\Subscription $subscription * @param string $reason * @return true|\WP_Error */ public static function resumeSubscription(\FluentCart\App\Models\Subscription $subscription, $reason = '') { } /** * Reactivate a canceled/expired store-billed (manual or system) subscription locally — * no gateway/checkout involved. Voids any pending renewal invoice from the missed * period and advances next_billing_date so the overdue scanner doesn't immediately * re-flag it. Shared by the admin reactivate endpoint and the customer-dashboard * future-dated reactivation short-circuit. * * @param \FluentCart\App\Models\Subscription $subscription * @return \FluentCart\App\Models\Subscription|\WP_Error */ public static function reactivateSubscriptionLocally(\FluentCart\App\Models\Subscription $subscription) { } /** * Update subscription details (for manual subscriptions) * * Allowed fields for manual subscriptions: * - recurring_total: Update the next invoice/payment amount (in cents) * - bill_times: Update the number of billing cycles (0 = unlimited) * - billing_interval: Change billing frequency (daily, weekly, monthly, etc.) * - expire_at: Update expiration date * - trial_days: Update trial period * - next_billing_date: Update next billing date * * @param \FluentCart\App\Models\Subscription $subscription * @param array $data * @return true|\WP_Error */ public static function updateSubscription(\FluentCart\App\Models\Subscription $subscription, array $data) { } /** * Single cancellation chokepoint. Voids open renewals and dispatches the * SubscriptionCanceled event so email + reminder-clear (both listen on the * event hook) fire once, regardless of which cancel path ran. * * @param bool $dispatchEvent fire SubscriptionCanceled (email/reminder-clear/automations) */ public static function finalizeCancellation(\FluentCart\App\Models\Subscription $subscription, string $reason = '', bool $dispatchEvent = true): void { } /** * Void all pending renewal invoices for a subscription. * Sets order status to canceled and payment_status to failed. */ public static function voidPendingRenewals(\FluentCart\App\Models\Subscription $subscription, string $reason = ''): void { } } /** * Auto-charge engine for system (token-charged, store-billed) subscriptions. * Charges the stored token off-session on the invoice due date; failure flips * the invoice to `pending` and hands off to the normal manual dunning flow. * Token is resolved at fire time, never snapshotted, so a mid-cycle payment * method change is picked up by the next attempt. */ class SystemChargeService { const HOOK = 'fluent_cart/subscriptions/system_charge_due'; const RECONCILE_HOOK = 'fluent_cart/subscriptions/system_charge_reconcile'; const SCHEDULER_GROUP = 'fluent-cart'; // Async charges are re-checked daily; after this many checks the invoice // fails back to pending so normal dunning resumes. const RECONCILE_INTERVAL = DAY_IN_SECONDS; const MAX_RECONCILE_CHECKS = 7; // hasQueuedCharge()/unscheduleCharges() sweep exactly this many slots — // an attempt scheduled beyond it would be invisible to both. const MAX_ATTEMPT_SLOTS = 10; // Retry attempts as a fraction of the interval's grace period, so every // attempt lands before the subscription expires regardless of cadence. const RETRY_GRACE_FRACTIONS = [0.25, 0.6, 0.9]; public function register() { } /** * Kill switch for automatic system charging. Return false to stop every * charge attempt — e.g. on a staging clone whose live tokens would otherwise * double-charge real customers. Defaults on; billing is unaffected in prod. */ public static function isSystemBillingEnabled(): bool { } /** * Drop the stale decline reason after the payment method is replaced. * Retry bookkeeping (attempts, next_retry_at, processing marker) is kept — * the next attempt just reads the new token at fire time. */ public static function clearFailureState($subscription) { } /** * Whether a charge attempt is still queued for this invoice. While one is * pending, the overdue scanner must not escalate the invoice out from under it. * * @param array|null $chargeState subscription's `system_charge_state` meta; * null if caller doesn't have it loaded */ public static function hasQueuedCharge($order, $chargeState = null): bool { } /** * Attempt slots that could plausibly hold a queued action. Only one attempt * is ever queued at a time, so charge state pins the slot — except the retry * is scheduled BEFORE state is written, so a crash mid-write can leave state * one attempt behind the scheduler; probe a range, not just the one slot, * to cover that gap. No state (null) gets the full sweep. * * @return array */ private static function queuedAttemptSlots($order, $chargeState): array { } /** * Whether auto-retries are exhausted for THIS renewal order — source of * truth for every Pay Now surface's exhaustion gate. */ public static function isExhausted($subscription, \FluentCart\App\Models\Order $order): bool { } /** * Drop every queued attempt (and the reconciliation check) for one invoice. */ public static function unscheduleCharges($order) { } public static function restoreScheduledChargesForSubscription($subscription): void { } /** * Retry offsets, in days after the invoice due date. Anchored to the * interval's grace period so attempts always fit inside the dunning window. * * @return array days after the due date, ascending */ public static function getRetryOffsets($subscription): array { } /** * Stop auto-charging a subscription whose payment method can no longer be * token-charged (e.g. a failed invoice paid with a non-capable gateway), * and hand it back to plain manual invoicing. */ public static function reconcileGatewayCapability($subscription) { } /** * system → manual: cancel the queued charges, drop the charge bookkeeping, and * put any invoice that was waiting for an automatic charge back into the manual * flow (pending + the pay-now invoice email it was deliberately not sent). */ public static function demoteToManual($subscription, string $reason) { } /** * Admin-triggered immediate charge attempt on a system subscription's open * renewal invoice. One attempt per call — the retry ladder is not restarted. * * @return array|\WP_Error ['status' => 'paid'|'processing'|'failed', 'message' => string] * on an executed attempt; WP_Error for state violations. */ public static function chargeNow(\FluentCart\App\Models\Order $invoice, $subscription, $actorId = 0) { } public static function scheduleCharge($order, $subscription, $attempt = 1) { } /** * Action Scheduler callback — guarded, idempotent charge attempt. * Every guard logs-and-returns; this method never throws. */ public function executeCharge($orderId, $attempt = 1) { } /** * Success log + contract hook. Fired synchronously for confirmed charges, or * from the renewal_paid listener once an async charge's webhook lands. */ private function recordChargeSucceeded($order, $subscription, $attempt) { } /** * Reconcile an async (processing) charge. Runs daily until the gateway confirms * settlement, fails definitively, or the check budget runs out — then fails the * invoice back to pending so normal dunning resumes. */ public function reconcileProcessingCharge($orderId) { } /** * Failed off-session charge: flip invoice to `pending`, re-entering normal * dunning (reminders, past_due → expired), send the charge-failed email * (first failure only, filterable), and schedule the next retry per * getRetryOffsets(). */ private function handleFailure($order, $subscription, \WP_Error $error, $attempt) { } /** * fluent_cart/renewal_paid listener — unschedules any queued charge * for the paid invoice, and fires the deferred success log/hook if this * confirms an async (processing) system charge. */ public function cancelPendingCharge($data) { } } } namespace FluentCart\App\Modules\Subscriptions { class SubscriptionModule { public static function register() { } public function init($app) { } } } namespace FluentCart\App\Modules\Tax { class TaxCalculator { /** * Per-request memos. In production every HTTP request runs in a fresh PHP * process, so these live exactly one request. Long-running processes that * simulate multiple requests (test suites, CLI) must clear them between * simulated requests via resetCache() — as function-statics they * were unreachable and leaked the first request's terms/overrides/tax-class * lookups into every subsequent one. */ private static $termsCache = null; private static $overridesCache = null; private static $taxClassCache = []; public static function resetCache(): void { } protected $productIds = []; protected $taxMaps = []; protected $country = ''; protected $state = ''; protected $city = ''; protected $postCode = ''; protected $lineItems = []; protected $formattedLineItems = []; protected $products = []; protected $inclusive = true; protected $cart; protected $manualDiscounts = 0; protected $taxSettings = []; private $roundingMode = 'item'; public function __construct($lineItems, $config = []) { } public function getTaxBehaviorValue() { } /** * Returns the store-level inclusive mode unconditionally (1 or 2, never 3). * Used alongside tax_behavior=3 to determine how to handle shipping and fee tax. * * $this->inclusive is always the store setting — TaxCalculator.__construct() overrides * the $config['inclusive'] with Arr::get($taxSettings, 'tax_inclusion') === 'included' * at line 68, so this value is always correct regardless of what was passed in config. */ public function getStoreTaxBehaviorValue() { } public function setupMaps() { } public function getTaxedLines() { } public function getTaxLinesByRates($lineItems = []) { } public function getTotalTax() { } public function getExclusiveTaxTotal() { } public function getRecurringTax() { } public function getTaxCountry() { } public function getShippingTax() { } public function getShippingTaxByRates(): array { } protected function getTaxMapKey($lineItem) { } protected function getVariantInclusiveForLineItem($lineItem) { } protected function getRatesByLineItem($lineItem) { } protected function getRatesByTaxClasses($taxClasses) { } protected function getProductOverrideByTermIds($termIds, $lineItemClassId = 0) { } private function scoreOverrideMatch($metaValue, $lineItemClassId = 0) { } private function matchesPostcode($rule, $customer) { } protected function applyProductOverrideToRates($resolvedRates, $productOverride) { } protected function getEuTaxRates($taxClassId, $taxClassSlug) { } protected function getRatesFromRegistrations($euVatSettings, $taxClassId, $taxClassSlug, $country) { } protected function getTaxClassByLineItem($lineItem) { } protected function getTermsByProductId($productId) { } protected function getStandardTaxClass() { } /** * Lazily filled per-slug tax-class map — each slug is queried at most once * per request, only when the app actually needs it (variant tax_class * lookups and the standard-class fallback share the same cache). * * @return \FluentCart\App\Models\TaxClass|null */ protected function getTaxClassBySlug($slug) { } private function roundTax($amount) { } private function finalRound($amount) { } protected function resolveMatchedRates($matchedRates) { } protected function shouldReplaceBroaderRates($rate) { } protected function isBroaderMatchingRate($baseRate, $replacementRate) { } protected function compareRatePriority($leftRate, $rightRate) { } protected function compareRateCompoundMode($leftRate, $rightRate) { } protected function compareRateSpecificity($leftRate, $rightRate) { } protected function compareRateId($leftRate, $rightRate) { } protected function normalizeRatePriority($rate) { } protected function normalizeRateCompoundFlag($rate) { } protected function normalizeRateId($rate) { } protected function getRateSpecificity($rate) { } } class TaxModule { protected $taxSettings = []; protected $renderer = null; private function renderer(): \FluentCart\App\Services\Renderer\TaxRenderer { } public function register() { } private function resolvePriceSuffix($variant) { } public function renderTaxRow($cart, $atts = '') { } public function renderShippingTaxRow($cart, $atts = '') { } public function renderTaxSummaryBox($cart) { } public function maybeRestoreRcAdjustedPrices($data) { } public function recalculateTax($data) { } public function maybeRecalculateTaxAmount($fillData, $data) { } public function maybeInvalidateVatValidationForCountryChange($checkoutData, $previousFormData = []) { } public function getSettings() { } public function getEffectiveRcMode() { } public function renderCheckoutLineItemTaxLabel($data) { } public function renderCheckoutSetupFeeTaxLabel($data) { } public function renderCheckoutSetupFeeTaxTooltip($data) { } public function renderCheckoutSetupFeeTaxInfo($data) { } public function renderCheckoutLineItemTaxTooltip($data) { } public function renderCheckoutLineItemTaxInfo($data) { } public function renderUnitPriceRoundingTooltip($data) { } public function isEnabled() { } public function calculateCartTax($fillData) { } protected function shouldApplyReverseCharge($checkoutData, $taxApplicableCountry, $lineItems = []) { } public function isReverseChargeCheckout($checkoutData) { } protected function hasReverseChargeTaxData(array $taxData): bool { } public function maybeRerenderEuVatField($fragments, $args) { } public function prepareOtherData($data) { } public function storeBusinessInfoOnOrder($data) { } public function initCheckoutActions() { } public function registerAjaxHandlers() { } public function renderTaxField($data) { } public function getTaxApplicableCountry($calculationBasis, $formData) { } public function canApplyVatValidation($countryCode) { } public function handleVatValidation() { } public function removeVat() { } protected function getTermsByProductIds($products) { } protected function validateEuVatNumber($countryCode, $vatNumber) { } public function validateVatForAdmin($countryCode, $vatNumber) { } /** * Persist tax-rate rows for an order. * * Accepts the output of AdminOrderTaxService::calculate() (or the equivalent * data built inside prepareOtherData) and writes / updates fct_order_tax_rate rows. * * @param int $orderId The order ID. * @param array $taxLines Array of ['rate_id', 'label', 'tax_amount'] — one entry per rate. * @param array $taxMeta Arbitrary meta merged into every row (country, vat numbers, etc.). * @param int $shippingTax Total shipping tax for the order (distributed proportionally). */ public static function persistTaxRates($orderId, $taxLines, $taxMeta, $shippingTax = 0, $shippingTaxLines = []) { } public static function isTaxEnabled() { } /** * Whether reverse charge can be applied for a given customer country. * Same logic as canApplyVatValidation() but accessible statically for renderers. * Returns false when local_reverse_charge is off AND the country equals the store country. */ public static function canApplyReverseCharge($countryCode) { } /** * The legal reverse-charge notice shown on checkout, invoices, receipts and emails. * EU VAT Directive 2006/112/EC Article 226(11a) requires the invoice to carry the * literal mention "Reverse charge" when the customer is liable for the VAT, so the * default string must always start with those exact words. Article 196 covers * services; stores supplying intra-EU goods (Art. 138) or needing other * jurisdiction-specific wording can override via the filter. */ public static function getReverseChargeNoticeText() { } public static function euVatCountyOptions() { } public static function taxTitleLists(): array { } public static function getCountryTaxTitle($countryCode = '') { } public function applyRcFeeAdjustments($fees, $context) { } } } namespace FluentCart\App\Modules\Templating { class AssetLoader { static $loadedAssets = []; protected static bool $frontendAssetsRequired = false; public static function markFrontendAssetsRequired(): void { } public static function isFrontendAssetsMarked(): bool { } public static function shouldLoadGlobalFrontendAssets(): bool { } public static function isFluentCartContext(): bool { } public static function register() { } public static function enqueueAssets() { } public static function loadSingleProductAssets() { } public static function loadAddToCartCss() { } public static function loadModalCheckoutAssets() { } public static function loadProductCardAssets() { } public static function loadProductArchiveAssets() { } public static function loadCustomerDashboardGlobalAssets() { } public static function loadCustomerDashboardAssets() { } public static function loadCartAssets() { } public static function loadCheckoutAssets($cart = null) { } private static function localizeCheckoutData(\FluentCart\App\Models\Cart $cart) { } private static function markAssetLoaded($handle) { } public static function enqueueProductInfoFrontendStyles() { } public static function enqueueThankYouPageAssets() { } public static function loadMiniCartAssets() { } } } namespace FluentCart\App\Modules\Templating\BlockTemplates { /** * ProductCategoryTemplate class. * */ class ProductCategoryTemplate { /** * The slug of the template. * * @var string */ const SLUG = 'taxonomy-product-categories'; /** * Initialization method. */ public function init() { } /** * Returns the title of the template. * * @return string */ public function getTitle() { } /** * Returns the description of the template. * * @return string */ public function getDescription() { } public function getDefaultTemplate() { } } /** * ProductCategoryTemplate class. * */ class ProductModalTemplate { /** * The slug of the template. * * @var string */ const SLUG = 'fct-single-product-modal'; /** * Initialization method. */ public function init() { } /** * Returns the title of the template. * * @return string */ public function getTitle() { } /** * Returns the description of the template. * * @return string */ public function getDescription() { } public function getDefaultTemplate() { } /** * Render the template with custom content if modified by user * * @return string */ public function render() { } } /** * ProductCategoryTemplate class. * */ class ProductPageTemplate { /** * The slug of the template. * * @var string */ const SLUG = 'single-fluent-products'; /** * Initialization method. */ public function init() { } /** * Returns the title of the template. * * @return string */ public function getTitle() { } /** * Returns the description of the template. * * @return string */ public function getDescription() { } public function getDefaultTemplate() { } } } namespace FluentCart\App\Modules\Templating\BlockTemplates\TemplateParts { class ProductModalTemplatePart { /** * The slug of the template part. * * @var string */ const SLUG = 'product-modal'; /** * The area of the template part. * * @var string */ const AREA = 'uncategorized'; /** * Plugin namespace for template parts. * * @var string */ const PLUGIN_NAMESPACE = 'fluent-cart'; /** * Initialization method. */ public function init() { } /** * Register the template part. */ public function register() { } /** * Add the template part to the list of available template parts. * * @param array $query_result Array of found block templates. * @param array $query Arguments to retrieve templates. * @param string $template_type wp_template or wp_template_part. * @return array Modified array of block templates. */ public function addTemplatePart($query_result, $query, $template_type) { } /** * Get template part when requested. * * @param \WP_Block_Template|null $template Block template object. * @param string $id Template unique identifier. * @param string $template_type Template type. * @return \WP_Block_Template|null */ public function getTemplatePart($template, $id, $template_type) { } /** * Build the template part object. * * @return \WP_Block_Template */ private function buildTemplatePartObject() { } /** * Returns the title of the template part. * * @return string */ public function getTitle() { } /** * Returns the description of the template part. * * @return string */ public function getDescription() { } /** * Returns the default template content. * * @return string */ public function getDefaultTemplate() { } /** * Get the current content of the template part (including user modifications). * * @return string|null */ public function getTemplateContent() { } /** * Get the template part post from the database. * * @return \WP_Post|null */ private function getTemplatePartPost() { } /** * Render the template part with current content (including user customizations). * * @param array $args Optional arguments to pass to the template part. * @return string Rendered HTML output. */ public function render($args = []) { } /** * Render the template part and echo it. * * @param array $args Optional arguments to pass to the template part. */ public function display($args = []) { } /** * Get the template part ID. * * @return string */ public function getTemplatePartId() { } /** * Check if the template part has been customized by the user. * * @return bool */ public function isCustomized() { } /** * Reset the template part to default (remove customizations). * * @return bool True on success, false on failure. */ public function resetToDefault() { } /** * Export the template part content (for backup or migration). * * @return array */ public function export() { } /** * Import template part content. * * @param string $content The template content to import. * @return bool|\WP_Error True on success, WP_Error on failure. */ public function import($content) { } } class TemplatePartService { public function register() { } public function addTemplateParts($query_result, $query, $template_type) { } } } namespace FluentCart\App\Modules\Templating\Bricks { class BricksHelper { public static $forcedPost = null; public static function getFormCurrentPost() { } public static function setFormCurrentPost($post) { } public static function getCategoriesOptions() { } public static function renderCollectionCard($settings, $post, $post_index = 1, $uid = '') { } public static function isTemplate() { } public static function getAllowedHtmlForContent() { } } class BricksLoader { const TEMPLATE_TYPE_PRODUCT = 'fct_product'; public function register() { } public function loadElements() { } /** * Add FluentCart template types to the Bricks template type dropdown. */ public function addTemplateTypes($controlOptions) { } /** * Let Bricks resolve FluentCart single product templates as product templates. */ public function setContentType($contentType, $postId) { } /** * Make the FluentCart product template type render on single product pages. */ public function setActiveTemplates($activeTemplates, $postId, $contentType) { } protected function getProductTemplateId($postId) { } public function preloadProductCollectionsAjax($view, $args) { } public function addDynamicFieldClassesScript() { } /** * Get product options for select controls. * Limits to 50 recent products for editor performance. * Users can search or use manual product ID for others. */ public static function getProductOptions() { } } class DynamicData { public function register() { } public function getTagsPairs() { } public function renderValue($tag, $post, $context = 'text') { } } } namespace FluentCart\App\Modules\Templating\Bricks\Elements { // Exit if accessed directly class BuySection extends \Bricks\Element { public $category = 'fluent-cart'; public $name = 'fct-product-buy-section'; public $icon = 'ti-bag fluent-cart-element-icon'; public function enqueue_scripts() { } public function get_label() { } public function set_control_groups() { } public function set_controls() { } public function render() { } public function getAddToCartText() { } public function getBuyNowText() { } } // Exit if accessed directly class PriceRange extends \Bricks\Element { public $category = 'fluent-cart'; public $name = 'fct-price-range'; public $icon = 'ti-money fluent-cart-element-icon'; public function get_label() { } public function set_controls() { } public function render() { } } class ProductContent extends \Bricks\Element { public $category = 'fluent-cart'; public $name = 'fct-product-content'; public $icon = 'ion-md-list-box fluent-cart-element-icon'; public function get_label() { } public function set_controls() { } public function render() { } } // Exit if accessed directly class ProductGallery extends \Bricks\Element { public $category = 'fluent-cart'; public $name = 'fct-product-gallery'; public $icon = 'ti-gallery fluent-cart-element-icon'; public function enqueue_scripts() { } public function get_label() { } public function set_controls() { } public function render() { } } // Exit if accessed directly class ProductShortDescription extends \Bricks\Element { public $category = 'fluent-cart'; public $name = 'fct-product-short-description'; public $icon = 'ti-paragraph fluent-cart-element-icon'; public function get_label() { } public function set_controls() { } public function render() { } } // Exit if accessed directly class ProductStock extends \Bricks\Element { public $category = 'fluent-cart'; public $name = 'fct-product-stock'; public $icon = 'ti-package fluent-cart-element-icon'; public function get_label() { } public function set_control_groups() { } public function set_controls() { } public function render() { } public function simulateAvailability($availability, $data) { } } // Exit if accessed directly class ProductTitle extends \Bricks\Element { public $category = 'fluent-cart'; public $name = 'fct-product-title'; public $icon = 'ti-text fluent-cart-element-icon'; public $tag = 'h1'; public function get_label() { } public function set_controls() { } public function render() { } public static function render_builder() { } } // Exit if accessed directly class ProductsCollection extends \Bricks\Custom_Render_Element { public $category = 'fluent-cart'; public $name = 'fct-products'; public $icon = 'ti-archive fluent-cart-element-icon'; protected $cssRoot = '.fct-products-wrapper-inner .fct-products-container'; public function enqueue_scripts() { } public function get_label() { } public function set_control_groups() { } public function set_controls() { } public function render() { } /** * Store settings in transient. */ private function storeSettingsTransient($settings) { } /** * Build query args. */ private function buildQueryArgs($settings, $isMainQuery, $perPage, $viewMode) { } /** * Render product loop. */ private function renderProducts($products) { } /** * Render pagination. */ private function renderPagination($products, $defaultFilters, $paginationType, $perPage, $viewMode) { } /** * Get available product filters. */ private function getFilters(array $settings): array { } private function legacyControlKey($taxonomy) { } private function legacyDisplayNameKey($taxonomy) { } private function legacyShowEmptyKey($taxonomy) { } private function setBricksQuery() { } public function render_fields($post, $post_index) { } public function renderAjaxContents($products, $settings) { } private function getAjaxDefaultFilters(array $defaultFilters, array $settings): array { } } } namespace FluentCart\App\Modules\Templating { class TemplateActions { public function register() { } public function renderMainContent() { } public function renderArchiveHeader() { } public function renderProductArchive() { } public function initSingleProductHooks() { } public function filterSingleProductContent($content) { } public function renderProductHeader($productId = false) { } private function tempFixShortcodeContent($content) { } } class TemplateLoader { private static $supportedTheme = false; public static $currentRenderingPageType = ''; public static $currentTaxonomy = null; public static function init() { } public static function registerBlockParts() { } public static function loadTemplate($template) { } public static function initUnsupportedTheme() { } private static function simulateProductsArchive() { } public static function loadGenericFallbackTemplate($template) { } public static function renderProductsArchive($args = []) { } public static function hasThemeSupport() { } private static function getDefaultTemplateFile() { } private static function hasBlockTemplate($template_name) { } private static function taxonomyHasBlockTemplate($taxonomy): bool { } private static function getTemplateLoaderFiles($defaultFile) { } public static function templatePath() { } public static function supportsBlockTemplates($templateType = 'wp_template') { } } } namespace FluentCart\App\Modules\Turnstile { class TurnstileBoot { public function register() { } public function renderTurnstileWidget($data = []) { } public function enqueueTurnstileScript() { } public function localizeTurnstileData($data) { } /** * Inject widget via wp_footer as last resort */ public function injectWidgetViaFooter() { } private function isCheckoutContext() { } private function getWidgetHtml() { } } class TurnstileInit { public function register($app) { } } class TurnstileValidator { public function register() { } /** * Validate Turnstile token during checkout * * @param bool $isValid * @param array $data * @return bool|WP_Error */ public function validateCheckout($isValid, $data) { } /** * Validate Cloudflare Turnstile token * * @param string $token * @param array $turnstileSettings * @return bool */ public function validateToken($token, $turnstileSettings) { } } } namespace FluentCart\App\Modules\WooCommerceMigrator\Contracts { interface MigrationServiceInterface { /** * Check if the migration dependencies are met * * @return bool */ public function checkDependencies(): bool; /** * Run the migration * * @param array $options Migration options * @return array Migration results with counts and status */ public function migrate(array $options = []): array; /** * Get migration statistics/summary * * @return array */ public function getStats(): array; /** * Clean up migration data (for fresh migrations) * * @return bool */ public function cleanup(): bool; } } namespace FluentCart\App\Modules\WooCommerceMigrator\Services { abstract class BaseMigrationService implements \FluentCart\App\Modules\WooCommerceMigrator\Contracts\MigrationServiceInterface { protected $stats = ['total' => 0, 'success' => 0, 'failed' => 0, 'skipped' => 0, 'start_time' => null, 'end_time' => null]; protected $errors = []; /** * Initialize migration statistics */ protected function initStats() { } /** * Finalize migration statistics */ protected function finalizeStats() { } /** * Log an error during migration * * @param string $message * @param mixed $context */ protected function logError($message, $context = null) { } /** * Log a successful migration * * @param string $message */ protected function logSuccess($message) { } /** * Log a skipped migration * * @param string $message */ protected function logSkipped($message) { } /** * Check if WooCommerce is active and available * * @return bool */ protected function checkWooCommerceDependencies(): bool { } /** * Get migration statistics * * @return array */ public function getStats(): array { } /** * Convert WooCommerce price to FluentCart cents * * @param float|string $price * @return int */ protected function convertToCents($price): int { } /** * Get or create mapping between WooCommerce and FluentCart IDs * * @param string $mapKey Option key for storing the mapping * @param int $wooId WooCommerce ID * @param int $fluentId FluentCart ID (null to just retrieve) * @return int|null FluentCart ID if found */ protected function getOrSetMapping($mapKey, $wooId, $fluentId = null) { } /** * Clear all mappings for this migration type * * @param string $mapKey Option key for the mapping */ protected function clearMapping($mapKey) { } } class CustomerMigrationService extends \FluentCart\App\Modules\WooCommerceMigrator\Services\BaseMigrationService { const CUSTOMER_MAPPING_KEY = '__fluent_cart_wc_customer_map'; /** * Check if the migration dependencies are met * * @return bool */ public function checkDependencies(): bool { } /** * Run the customer migration * * @param array $options Migration options * @return array Migration results with counts and status */ public function migrate(array $options = []): array { } /** * Migrate a single customer based on EDD migration pattern * * @param object $wooCustomer WordPress user object * @param array $options Migration options * @return int|false FluentCart customer ID or false on failure */ private function migrateCustomer($wooCustomer, $options = []) { } /** * Migrate billing address to FluentCart customer addresses table * * @param int $fluentCustomerId * @param array $customerMeta */ private function migrateBillingAddress($fluentCustomerId, $customerMeta) { } /** * Migrate shipping address to FluentCart customer addresses table * * @param int $fluentCustomerId * @param array $customerMeta */ private function migrateShippingAddress($fluentCustomerId, $customerMeta) { } /** * Calculate and update customer purchase statistics * * @param int $fluentCustomerId * @param int $wooUserId */ private function updateCustomerStats($fluentCustomerId, $wooUserId) { } /** * Calculate customer statistics from WooCommerce orders * * @param int $wooUserId * @return array|null */ private function calculateCustomerStats($wooUserId) { } /** * Insert address data if valid, removing empty values but keeping required fields * * @param array $addressData */ private function insertAddressIfValid($addressData) { } /** * Helper to get meta value from meta array * * @param array $meta * @param string $key * @return string|null */ private function getMetaValue($meta, $key) { } /** * Clean up migration data (for fresh migrations) * * @return bool */ public function cleanup(): bool { } } /** * OrderMigrationService - Migrates WooCommerce orders to FluentCart * * Handles: * - Order headers (wp_wc_orders -> wp_fct_orders) * - Order items (wp_woocommerce_order_items -> wp_fct_order_items) * - Order addresses (wp_wc_order_addresses -> wp_fct_order_addresses) * - Applied coupons (coupon line items -> wp_fct_applied_coupons) * - Fee items (fee line items -> custom handling) * - Order metadata (wp_wc_orders_meta -> wp_fct_order_meta) */ class OrderMigrationService extends \FluentCart\App\Modules\WooCommerceMigrator\Services\BaseMigrationService implements \FluentCart\App\Modules\WooCommerceMigrator\Contracts\MigrationServiceInterface { protected $entityName = 'orders'; protected $batchSize = 50; // Lower batch size for complex order data protected $migrated = 0; /** * Set batch size for migration */ public function setBatchSize(int $size): void { } /** * Add an error message */ protected function addError(string $message): void { } /** * Get all error messages */ public function getErrors(): array { } /** * Increment migrated counter */ protected function incrementMigrated(): void { } /** * Check if migration can proceed */ public function canMigrate(): bool { } /** * Get total count of orders to migrate */ public function getTotalCount(): int { } /** * Get count of already migrated orders */ public function getMigratedCount(): int { } /** * Discover orders to migrate */ public function discoverItems(int $offset = 0, ?int $limit = null): array { } /** * Migrate a single order */ public function migrateSingle($wooOrder): bool { } /** * Migrate main order record */ private function migrateOrderRecord($wooOrder): ?int { } /** * Migrate order addresses */ private function migrateOrderAddresses(int $wooOrderId, int $fluentOrderId): void { } /** * Migrate order items (products, shipping, fees, coupons) */ private function migrateOrderItems(int $wooOrderId, int $fluentOrderId, ?int $customerId): void { } /** * Migrate product line item */ private function migrateProductItem($item, array $meta, int $fluentOrderId): void { } /** * Migrate coupon line item to FluentCart coupon system */ private function migrateCouponItem($item, array $meta, int $fluentOrderId, ?int $customerId): void { } /** * Migrate fee line item as custom order item */ private function migrateFeeItem($item, array $meta, int $fluentOrderId): void { } /** * Store shipping method info as order metadata */ private function migrateShippingMeta($item, array $meta, int $fluentOrderId): void { } /** * Migrate order metadata */ private function migrateOrderMeta(int $wooOrderId, int $fluentOrderId): void { } /** * Update order totals and validate */ private function updateOrderTotals(int $fluentOrderId): void { } /** * Update customer purchase statistics after order migration */ private function updateCustomerPurchaseStats(int $customerId): void { } /** * Get or create coupon in FluentCart */ private function getOrCreateCoupon(string $couponCode, int $discountAmount): int { } /** * Convert WooCommerce order status to FluentCart status */ private function convertOrderStatus(string $wooStatus): string { } /** * Convert WooCommerce order status to FluentCart payment status */ private function convertPaymentStatus(string $wooStatus): string { } /** * Check if WooCommerce is active */ private function isWooCommerceActive(): bool { } /** * Check if HPOS is active */ private function isHPOSActive(): bool { } /** * Check if dependencies are migrated */ private function areDependenciesMigrated(): bool { } /** * Get cleanup instructions */ public function getCleanupInstructions(): array { } /** * Check if the migration dependencies are met */ public function checkDependencies(): bool { } /** * Run the migration */ public function migrate(array $options = []): array { } /** * Update all customer purchase statistics (useful for existing migrations) */ public function updateAllCustomerStats(): array { } /** * Clean up migration data (for fresh migrations) */ public function cleanup(): bool { } } } namespace FluentCart\App\Modules\WooCommerceMigrator { /** * WooCommerceMigratorCli * * This class handles the migration of WooCommerce products, categories, attachments, and downloadable files to FluentCart. * It provides CLI commands for bulk migration and ensures data is mapped and transformed to match FluentCart's structure and logic. * * Major responsibilities: * - Migrate product posts, variations, categories, and attachments * - Map WooCommerce product types, stock, downloadable, and virtual flags to FluentCart equivalents * - Copy downloadable files to FluentCart's upload directory * - Ensure all product meta, images, and downloadable assets are correctly linked */ class WooCommerceMigratorCli { private $attachmentMap = []; private $migrationSteps = []; private $categoryMap = []; public function __construct() { } private function checkWooCommerceDependencies() { } /** * Migrate all WooCommerce attachments (media files) to FluentCart. * * This method finds all WooCommerce attachments and copies them to the FluentCart media library if needed. * It also copies attachment meta and ensures images are available for migrated products and variations. */ public function migrateAttachments() { } private function migrateSingleAttachment($attachment) { } /** * Migrate all WooCommerce products to FluentCart. * * This is the main entry point for product migration. It migrates categories first, then all products. * For each product, it handles variations, images, downloadable files, stock, and meta mapping. * * @param bool $willUpdate Whether to update existing FluentCart products * @return array|\WP_Error Migration results or error */ public function migrate_products($willUpdate = false) { } /** * Migrate all WooCommerce product categories to FluentCart. * * Ensures all categories and their hierarchy are recreated in FluentCart, including meta and thumbnails. * Maintains a mapping between WooCommerce and FluentCart category IDs for later use. * * Fix: Two-pass migration to ensure parent-child relationships are set correctly. */ private function migrateCategories() { } /** * Verify that all mapped categories still exist in the database * @return bool True if all categories exist, false if any are missing */ private function verifyCategoryMappingIntegrity() { } /** * Migrate all WooCommerce brands to FluentCart brands taxonomy. * * Ensures all brands are created and mapped, and mapping is available for product assignment. */ private function migrateBrands() { } /** * Migrate a single WooCommerce product (and its variations, images, downloads) to FluentCart. * * Handles mapping of product type, fulfillment type, stock, downloadable/virtual flags, images, gallery, and meta. * For variable products, processes each variation and ensures correct mapping of downloadable files and stock. * * @param object $wooProduct The WooCommerce product post object * @param bool $willUpdate Whether to update existing FluentCart product * @return int|\WP_Error The new FluentCart product ID or error */ private function migrateProduct($wooProduct, $willUpdate = false) { } /** * Create or update a FluentCart product variation. * * Ensures the variation is created or updated with the correct price, stock, fulfillment type, downloadable flag, and meta. * Also creates product meta for variation images if present. * * @param int $productId The FluentCart product ID * @param array $data The variation data * @return int The FluentCart variation ID */ private function createOrUpdateProductVariations($productId, $data) { } /** * Create or update product meta for a variation image. * * Links a media attachment to a variation for use as its thumbnail in FluentCart. * * @param int $variationId The variation ID * @param int $mediaId The media/attachment ID * @param string $variationTitle The variation title */ private function createVariationImageMeta($variationId, $mediaId, $variationTitle) { } /** * Update or insert product details for a FluentCart product. * * Handles the main product details row, including fulfillment type, stock, downloadable flag, and meta. * * @param int $createdPostId The FluentCart product ID * @param array $detail The product details data * @return int The FluentCart product details ID */ private function updateProductDetails($createdPostId, $detail) { } /** * Convert a price to cents (integer) for FluentCart storage. * * Ensures all prices are stored as integer cents, not floats. * * @param float|string $price The price value * @return int The price in cents */ private function convertToCents($price) { } /** * Migrate downloadable files from WooCommerce to FluentCart. * * For each downloadable file, copies it to the FluentCart uploads directory, creates a download entry, * and links it to the correct product variations. Handles file path resolution for WooCommerce's storage format. * * @param int $productId The FluentCart product ID * @param array $variationDownloadMap Array mapping variation IDs to their downloadable files * @return bool True on success */ private function migrateDownloadableFiles($productId, $variationDownloadMap = []) { } /** * Get file size in bytes for a given file path or URL. * * Used for populating the file_size field in FluentCart's downloads table. * * @param string $filePath File path or URL * @return string File size */ private function getFileSize($filePath) { } /** * Get file type based on file extension. * * Used for populating the type field in FluentCart's downloads table. * * @param string $fileName File name * @return string File type */ private function getFileType($fileName) { } /** * Generalized taxonomy migration from WooCommerce to FluentCart. * * @param string $sourceTaxonomy WooCommerce taxonomy (e.g., 'product_cat', 'product_brand') * @param string $destTaxonomy FluentCart taxonomy (e.g., 'product-categories', 'product-brands') * @param string $optionMapKey Option key for storing the term ID map * @return array Term ID map */ private function migrateTaxonomy($sourceTaxonomy, $destTaxonomy, $optionMapKey) { } } class WooCommerceMigratorHelper { public static function doBulkInsert($table, $data) { } public static function logMigrationError($productId, $error) { } public static function updateMigrationStatus($step, $status) { } public static function checkRequiredTables() { } } } namespace FluentCart\App\Services { class AdvancedVariationService { /** * Hard ceiling on the number of variant combinations a single save may * generate. The cartesian product of attribute groups grows multiplicatively * (3 groups × 10 terms each = 1,000 variants, 4 × 10 = 10,000), so without * a cap a careless attribute set can blow up admin save time, memory, * and downstream DB write volume. 500 is generous for real e-commerce use * (typical: <50 combinations) while still bounding the worst case. * Filterable so a high-SKU store can raise it after a deliberate review. */ const DEFAULT_MAX_COMBINATIONS = 500; /** * Hard ceiling on the number of attribute groups a single save may * reference. Caps the cartesian's depth AND bounds the length of the * variation_identifier string (joined term IDs — the column is * VARCHAR(100) on free, so ~5 BIGINT-sized IDs is the schema limit * anyway). Without this, a payload with many single-term groups would * pass the combination cap but still drive an unbounded identifier * concatenation, whereIn list, and relation insert per variant. */ const DEFAULT_MAX_GROUPS_PER_SAVE = 10; /** * Hard ceiling on the total unique term IDs the payload may reference * (sum across all groups, deduplicated). Bounds the size of the * findMissingTermIds whereIn lookup and the per-variant relation * insert volume even when the cartesian cap is satisfied (the * single-term-many-groups bypass the bot flagged). */ const DEFAULT_MAX_TERMS_PER_SAVE = 500; /** * Matches fc_product_variations.variation_identifier (VARCHAR(100) on * free). Used by the runtime guard in syncVariantCombinations to abort * the save if any cartesian combination's underscore-joined term IDs * would overflow the column. At the group cap (10) with realistic * 5-8 digit term IDs we land at ~89 chars; the guard exists to catch * the pathological case of growth-rotated BIGINT IDs in long-lived * stores (>10-digit IDs aren't unprecedented). Non-STRICT MySQL would * silently truncate, creating duplicate variants on different * cartesian combinations that collapse to the same identifier prefix. */ const VARIATION_IDENTIFIER_MAX_LENGTH = 100; /** * Baseline keys every variant's `other_info` carries — mirrors the * payload that ProductBaseModel.addDummyVariant ships for simple / * simple_variations products. The advanced-variation create path used * to write only `{"variant": [...]}`, so downstream consumers that * read `other_info.payment_type` (admin order update, cart line * generation, OrderItemResource) got NULL and tripped the * fct_order_items.payment_type NOT NULL constraint. Keep the keys in * sync with the JS factory so the two surfaces don't drift. */ private static function defaultVariantOtherInfo(): array { } public static function syncVariantOption(int $productId, array $data): array { } private static function syncVariantCombinations($srcDetails, $variations) { } /** * Whitelist-sanitize the caller-supplied options payload. Strips any * keys we don't explicitly recognise so a hostile payload cannot pollute * ProductDetail.other_info.attribute_co * nfig with arbitrary structure. * Within each group entry, only 'variants' (term IDs) and 'group_id' * survive — both coerced to ints. Empty / non-array inputs become []. * * Runs BEFORE the cap checks so they operate on the cleaned shape, * and BEFORE the storage write so what lands in other_info matches * what the rest of the codebase reads back. */ private static function sanitizeSettings($settings): array { } /** * Returns the term IDs from the payload that don't exist in fct_atts_terms. * Called by syncVariantOption to reject the whole request when ANY term * reference is unknown — better than silently creating orphan variants * with missing relation rows (the bot-flagged failure mode). * * Returns empty array when every referenced term resolves. The single * whereIn query is bounded by the projected-combination cap above, so * worst case is one indexed PK lookup of <= MAX_COMBINATIONS unique IDs. */ private static function findMissingTermIds(array $variations): array { } /** * Number of non-empty groups in the payload. Empty groups are skipped * because they neither contribute to the cartesian nor to the cost * caps below. Bounds the depth of the cartesian AND the length of the * variation_identifier string (joined term IDs per variant). */ private static function countNonEmptyGroups(array $variations): int { } /** * Total unique term IDs referenced across all groups (positive ints * only). Bounds the size of the term-validation whereIn and the * per-save relation-insert volume — independently of the combination * cap, which can be satisfied even with many single-term groups. */ private static function countUniqueTermIds(array $variations): int { } /** * Cheap O(N) projection of the cartesian combination count from the raw * payload — multiplies the term count of every non-empty group. Used by * the cap guard in syncVariantOption so we reject blow-up payloads * BEFORE generateVariationSets() materialises the actual combinations. * * Returns 0 when every group is empty (no variants will be generated) * so the cap check treats that as a no-op, not a violation. */ private static function projectCombinationCount(array $variations): int { } private static function generateVariationSets(array $groups): array { } /** * Attaches term + group display fields to every variant.attr_map row on * the given product payload. Runs once per single-product API response * (scoped by the variation_type guard in AdvancedVariation::register). * Eager-loads terms with their group in ONE query so a product with N * variants is still one query, not N. * * Returns the original product array unchanged when no terms are * referenced — list-endpoint responses or products with no advanced * variation pay no query cost. */ public static function hydrateProductData(array $product): array { } } } namespace FluentCart\App\Services\Async { class DummyProductService { public static function create(string $category, $index) { } public static function createAll(string $category) { } protected function insert($product) { } private function insertAdvancedVariation(\FluentCart\App\Models\Product $product, array $detail, array $resolved, array $variantImages, array $imageKeyGroups, array $defaultVariantData, array $variantPrices = [], array $priceKeyGroups = []): void { } private function resolveAttributeOptions(array $attributeOptions): array { } public function attachTerms($categories, $postId) { } protected function getFilePath(string $category): string { } } class ImageAttachService { public function __construct() { } public static function attachImageToProduct(array $product, array $images, bool $cdnMode = false) { } public static function attachImageToVariant($variantId, array $images, bool $cdnMode = false) { } protected function addImageFromUrl($url, $title, bool $cdnMode = false): array { } public function prepareAttachmentForJsFromUrl(string $url): ?array { } protected function requireFiles() { } } } namespace FluentCart\App\Services { class AuthService { public static function createUserFromCustomer(\FluentCart\App\Models\Customer $customer, $sendUserEmail = true, $userRole = '') { } public static function registerNewUser($user_login, $user_email, $user_pass = '', $extraData = []) { } public static function makeLogin($user) { } public static function createUserNameFromStrings($maybeEmail, $fallbacks = []) { } private static function sanitizeUserName($username) { } private static function isUsernameAvailable($userName) { } private static function getReservedUserNames() { } } class BulkProductInsertService { /** * Insert a chunk of products within a database transaction. * Each product is validated before insert — valid ones are inserted, * invalid ones are skipped with an error keyed by _cid. * * @param array $products * @return array { created: array[], errors: array[] } */ public function insertChunk(array $products): array { } /** * Validate product data before insertion using the framework Validator. * * @param array $data * @return array|null Field-keyed error messages if invalid, null if valid */ protected function validateProduct(array $data): ?array { } /** * Insert a single product with its detail and all variants. * * @param array $productData * @return int The created post ID */ protected function insertSingleProduct(array $productData): int { } /** * Create a product variant from import data. */ protected function createVariant(int $postId, array $variantData, int $serialIndex, string $fulfillmentType, string $productTitle = ''): int { } /** * Create a default variant for a product (when no variants are provided). */ protected function createDefaultVariant(int $postId, string $title, string $fulfillmentType, array $extra = []): int { } /** * Assign categories to a product, supporting hierarchy via ">" syntax. * e.g. ["Clothing", "Clothing > T-Shirts", "Sale"] */ protected function assignCategories(int $postId, array $categoryPaths): void { } /** * Sanitize a price value to ensure it's a valid integer (cents). */ protected function sanitizePrice($value): int { } /** * Normalize media array — uploaded attachments keep their id, external URLs get id 0. * * @return array */ protected function normalizeMedia(array $media): array { } } class BulkProductUpdateService { /** * Fetch products formatted for bulk editing. * Returns products with decimal prices and category terms. */ public function fetchForBulkEdit(\FluentCart\Framework\Http\Request\Request $request): array { } /** * Format a single product for the bulk edit spreadsheet. * Converts prices from cents to decimal and attaches categories. */ protected function formatProductForEdit(\FluentCart\App\Models\Product $product): array { } /** * Build category path strings like ["Clothing > T-Shirts", "Sale"] */ protected function buildCategoryPaths(int $postId): array { } /** * Get the full hierarchical path for a term. */ protected function getTermPath($term): string { } /** * Validate product data before update using the framework Validator. * * @param array $data * @return array|null Field-keyed error messages if invalid, null if valid */ protected function validateProduct(array $data): ?array { } /** * Update a chunk of products (max 10). * * @param array $products * @return array { updated: int[], errors: array[] } */ public function updateChunk(array $products): array { } /** * Update a single product with its variants and categories. */ protected function updateSingleProduct(array $productData): int { } /** * Create a new variant for an existing product (used when duplicating a variant in bulk edit). */ protected function createVariantForProduct(int $postId, \FluentCart\App\Models\Product $product, array $variantData): void { } /** * Sync categories for a product. * Accepts mixed input: term ID integers, objects with term_id, or path strings. */ public function syncCategories(int $postId, array $categories): void { } /** * Convert cents-based fields in other_info to dollars for frontend display. */ protected function formatOtherInfoForEdit(array $otherInfo): array { } /** * Resolve a category path string to a term ID, creating terms as needed. * Reuses the same pattern as BulkProductInsertService::assignCategories. */ protected function resolveTermPath(string $path): int { } } class Cache { public static function get($key, $callback = false, $expire = 3600) { } public static function forget($key): bool { } public static function set($key, $value, $expire = 3600): bool { } public static function update($key, $value, $expire = 3600): bool { } private static function getKey(string $key): string { } private static function getKeyPrefix() { } private static function getGroupName(): string { } } class CheckoutService { public array $onetime = []; public array $physicalItems = []; public array $digitalItems = []; public array $subscriptions = []; public int $count = 0; public function __construct($items = []) { } public function isAllPhysical(): bool { } public function isAllDigital(): bool { } public function hasDigitalProduct(): bool { } public function hasPhysicalProduct(): bool { } } class ConditionAssesor { public static function evaluate(&$field, &$inputs) { } public static function assess(&$conditional, &$inputs) { } } } namespace FluentCart\App\Services\Coupon\Concerns { trait CanCalculateLineTotal { protected array $discountData = []; public function calculateLineItems() { } protected function prepareLineItems(array $lineItems = []): array { } protected function formatDiscountNumbers() { } public function getDiscountData(): array { } private function applyCouponToAllItems(\FluentCart\App\Models\Coupon $coupon, array &$lineItems) { } private function distributeDiscount(\FluentCart\Framework\Support\Collection $filteredItems, array &$lineItems, float &$remainingDiscount, int $depth = 0): float { } public function calculateApplicableAmount(\FluentCart\App\Models\Coupon $coupon, $totalPrice) { } } trait CanValidateCoupon { /** * @return bool|\WP_Error */ public function validate($couponCode) { } public function isProductValidated($coupon): bool { } public function canBeStacked(\FluentCart\App\Models\Coupon $coupon): bool { } public function isAlreadyApplied(\FluentCart\App\Models\Coupon $coupon): bool { } public function ensureMinimumPurchaseAmount(\FluentCart\App\Models\Coupon $coupon): bool { } public function isCouponActive(\FluentCart\App\Models\Coupon $coupon): bool { } public function hasUseLimit(\FluentCart\App\Models\Coupon $coupon): bool { } public function requiredUserToBeLoggedIn(\FluentCart\App\Models\Coupon $coupon): bool { } public function hasMaxPerUserLimit(\FluentCart\App\Models\Coupon $coupon): bool { } public function isApplicableToProduct(\FluentCart\App\Models\Coupon $coupon, $productId, $variationsId): bool { } protected function makeError(string $message, $code = null): \WP_Error { } private function getArrayValue($array, $key, $defaultValue = []) { } } } namespace FluentCart\App\Services\Coupon { /* * Class CouponService was removed as all coupon logic goes to DiscountService.php * we had to bring it back and make it as CouponServiceAdmin * * @devnotes: for admin order this is used to apply/cancel/reapply coupons. * we may refactore this later */ class CouponServiceAdmin { use \FluentCart\App\Services\Coupon\Concerns\CanValidateCoupon, \FluentCart\App\Services\Coupon\Concerns\CanCalculateLineTotal; protected ?\FluentCart\Framework\Support\Collection $previouslyAppliedCoupons; protected array $previouslyAppliedCouponCodes = []; protected ?\FluentCart\Framework\Support\Collection $applicableCoupons; protected ?\FluentCart\Framework\Support\Collection $appliedCoupons; protected array $applicableCouponCodes = []; protected array $cancelableCouponCodes = []; protected array $productIds = []; protected ?\FluentCart\Framework\Support\Collection $products; protected array $lineItems = []; protected array $calculatedLineItems = []; protected bool $usingCart = true; protected ?\FluentCart\Framework\Support\Collection $couponErrors = null; /** * @param array $lineItems * @param ?\FluentCart\Framework\Support\Collection $previouslyAppliedCoupons * @param bool $usingCart */ public function __construct(array $lineItems = [], ?\FluentCart\Framework\Support\Collection $previouslyAppliedCoupons = null, $applicableCouponCodes = []) { } private function init() { } public function initializeCoupons(array $couponCodes = []) { } public function getCouponErrors(): ?\FluentCart\Framework\Support\Collection { } protected function populateCouponFromArray($data): \FluentCart\App\Models\Coupon { } protected function populateCouponsFromModel($couponCodes = [], $model = \FluentCart\App\Models\Coupon::class) { } public function applyCoupon(string $couponCode): ?\WP_Error { } protected function apply(array $couponCodes = []): ?\WP_Error { } public function getCalculatedLineItems(): array { } public function cancelCoupon(string $couponCode) { } public function reapplyCoupons() { } protected function ensureCouponExistInDiscountData(\FluentCart\App\Models\Coupon $coupon) { } } class DiscountService { protected $cart = null; protected $cartItems = []; protected $customer = null; protected $appliedCoupons = []; protected $validCoupons = []; protected $invalidCoupons = []; protected $perCouponDiscounts = []; public function __construct(?\FluentCart\App\Models\Cart $cart = null, $cartItems = [], $customer = null) { } public function resetIndividualItemsDiscounts() { } public function revalidateCoupons() { } public function applyCouponCodes($codes = []) { } public function getResult() { } public function getCartItems() { } public function getPerCouponDiscounts() { } public function getAppliedCoupons() { } public function apply(\FluentCart\App\Models\Coupon $coupon) { } private function checkCanUseCoupon(\FluentCart\App\Models\Coupon $coupon, array $cartItems) { } private function filterApplicableItems(array $cartItems, \FluentCart\App\Models\Coupon $coupon) { } private function calculateItemsSubtotal(array $items) { } private function calculateExistingCouponDiscount(array $items) { } private function calculateDiscountPercent(\FluentCart\App\Models\Coupon $coupon, $totalAfterDiscount) { } private function applyDiscountToItems(array $items, $percent, \FluentCart\App\Models\Coupon $coupon) { } private function correctFixedCouponRounding(array $items, \FluentCart\App\Models\Coupon $coupon, $couponDiscountTotal) { } private function mergeValidatedItems(array $cartItems, array $validatedItems) { } private function updateItemTotals(array $cartItems) { } private function getItemEffectiveSubtotal(array $item) { } public function saveCart() { } protected function formatCoupons($coupons, $codes) { } protected function isCouponValid($coupon) { } protected function resolveCustomerForUsageLimit() { } public function setCustomer(\FluentCart\App\Models\Customer $customer) { } public function getCustomer() { } protected function getProductCategories($postId) { } } } namespace FluentCart\App\Services\CustomPayment { class PaymentIntent { private $lineItems = []; private $customerEmail; /** * @return mixed */ public function getCustomerEmail() { } /** * @param mixed $customerEmail */ public function setCustomerEmail($customerEmail) { } public function setLineItems($lineItems) { } public function getLineItems() { } public function toArray(): array { } } class PaymentItem { protected string $itemName; protected int $lineTotal; protected int $price = 0; protected int $quantity = 1; protected string $paymentType = 'onetime'; protected array $subscriptionInfo = []; public function setItemName(string $productName): self { } public function setQuantity(int $quantity): self { } public function setPrice(int $price): self { } public function setPaymentType(string $paymentType): self { } public function setSubscriptionInfo(array $subscriptionInfo): self { } public function getItem(): array { } private function updateLineTotal(): void { } public function toArray(): array { } } } namespace FluentCart\App\Services\DateTime { trait CanExtractTimeZone { public static function extractTimezone($datetime = null): \DateTimeZone { } /** * Enhanced offset to named timezone mapping */ private static function getNamedTimezoneFromOffset(string $offset): ?string { } public static function getTimezoneOffsetMinutes($timezoneName): int { } } } namespace FluentCart\Framework\Support { class DateTime extends \DateTime { /** * $singularUnits for checking during dynamic calls * @var array */ protected static $singularUnits = ['year', 'month', 'week', 'day', 'hour', 'minute', 'second']; /** * $pluralUnits for checking during dynamic calls * @var array */ protected static $pluralUnits = ['years', 'months', 'weeks', 'days', 'hours', 'minutes', 'seconds']; /** * Construct the DateTime Object * * @param string $datetime * @param \DateTimeZone $timezone|null */ public function __construct($datetime = 'now', $timezone = null) { } /** * Create a new DateTime Object with current time * * @param string|null $tz * @return static */ public static function now($tz = null) { } /** * Create a new DateTime Object with today's time * * @param string|null $tz * @return static */ public static function today($tz = null) { } /** * Create a new DateTime Object with yesterday's time * * @param string|null $tz * @return static */ public static function yesterday($tz = null) { } /** * Create a new DateTime Object with tomorrow's time * * @param string|null $tz * @return static */ public static function tomorrow($tz = null) { } /** * Create a new DateTime Object with the current week's starting time. * * @param string|null $tz * @return static */ public static function currentWeek($tz = null) { } /** * Create a new DateTime Object with last week's starting time * * @param string|null $tz * @return static */ public static function lastWeek($tz = null) { } /** * Create a new DateTime Object with next week's starting time * * @param string|null $tz * @return static */ public static function nextWeek($tz = null) { } /** * Create a new DateTime Object with current month's starting time * * @param string|null $tz * @return static */ public static function currentMonth($tz = null) { } /** * Create a new DateTime Object with last month's starting time * * @param string|null $tz * @return static */ public static function lastMonth($tz = null) { } /** * Create a new DateTime Object with next month's starting time * * @param string|null $tz * @return static */ public static function nextMonth($tz = null) { } /** * Create a new DateTime Object with current year's starting time * * @param string|null $tz * @return static */ public static function currentYear($tz = null) { } /** * Create a new DateTime Object with last year's starting time * * @param string|null $tz * @return static */ public static function lastYear($tz = null) { } /** * Create a new DateTime Object with next year's starting time * * @param string|null $tz * @return static */ public static function nextYear($tz = null) { } /** * Get the default timezone * * @return \DateTimeZone */ public function getDefaultTimezone() { } /** * Set the timezone * * @return $this */ public function timezone($tz) { } /** * Get the default date format * * @return string */ public function getDateFormat() { } /** * Check if the current instance is between two dates * * @param string|\DateTimeInterface $date1 * @param string|\DateTimeInterface $date2, * @return bool * * @phpstan-ignore-next-line */ public function between($date1, $date2): bool { } /** * Create a DateTime object from a string, UNIX timestamp, * or other DateTimeInterface object. * * @param string|int|\DateTimeInterface $time * @return static * @throws \Exception */ public static function create($time = null, $tz = null) { } /** * Check if the given datetime string has the timezone * information attached: Z or +/-00:00 or Asia\Dhaka. * * @param string $datetimeString * @return boolean */ public function hasTimezone($datetimeString) { } /** * {@inheritdoc} */ #[\ReturnTypeWillChange] public static function createFromFormat($format, $datetimeString, $timezone = null) { } /** * Create DateTime object. * * @return static * @throws \InvalidArgumentException */ public static function createFromDate($year, $month, $day, $hour = 0, $minute = 0, $second = 0.0, $tz = null) { } /** * Given a date in UTC or GMT timezone, returns * that date in the timezone of the site. * * Requires a date in the Y-m-d H:i:s format. * * Default return format of 'Y-m-d H:i:s' can be * overridden using the `$format` parameter. * * @param string $dateString The date to be converted, in UTC or GMT timezone. * @param string $format The format string for the returned date. Default 'Y-m-d H:i:s'. * @see https://developer.wordpress.org/reference/functions/get_date_from_gmt/ * * @return string Formatted version of the date, in the site's timezone. */ public static function createFromUTC($dateString, $format = 'Y-m-d H:i:s') { } /** * Parse a datetime string * @param string $datetimeString * @param string $timezone * @return static * @throws \InvalidArgumentException */ public static function parse($datetimeString, $timezone = null) { } /** * Add inetrvals, for example: * * add(1, day) * add('2 day 8 hours 22 minutes') * * @param \DateInterval|string $interval * @return $this */ #[\ReturnTypeWillChange] public function add($interval) { } /** * Substruct inetrvals, for example: * * sub(1, day) * sub('2 day 8 hours 22 minutes') * * @param \DateInterval $interval (optional) * @return $this */ #[\ReturnTypeWillChange] public function sub($interval) { } /** * Add or sub intervals * @param string $action add/sub * @param array $args */ protected function addOrSub($action, $args) { } /** * Adds the given number of seconds to the current date and time. * * @param int $seconds The number of seconds to add. * @return $this The current instance for method chaining. */ public function addSeconds(int $seconds) { } /** * Adds exactly one second to the current date and time. * * @return $this */ public function addSecond() { } /** * Adds the given number of minutes to the current date and time. * * @param int $minutes The number of minutes to add. * @return $this The current instance for method chaining. */ public function addMinutes(int $minutes) { } /** * Adds exactly one minute to the current date and time. * * @return $this */ public function addMinute() { } /** * Adds the given number of hours to the current date and time. * * @param int $hours The number of hours to add. * @return $this The current instance for method chaining. */ public function addHours(int $hours) { } /** * Adds exactly one hour to the current date and time. * * @return $this */ public function addHour() { } /** * Adds the given number of days to the current date and time. * * @param int $days The number of days to add. * @return $this The current instance for method chaining. */ public function addDays(int $days) { } /** * Adds exactly one day to the current date and time. * * @return $this */ public function addDay() { } /** * Adds the given number of weeks to the current date and time. * * @param int $weeks The number of weeks to add. * @return $this The current instance for method chaining. */ public function addWeeks(int $weeks) { } /** * Adds exactly one week to the current date and time. * * @return $this */ public function addWeek() { } /** * Adds the given number of months to the current date and time. * * @param int $months The number of months to add. * @return $this The current instance for method chaining. */ public function addMonths(int $months) { } /** * Adds exactly one month to the current date and time. * * @return $this */ public function addMonth() { } /** * Adds the given number of years to the current date and time. * * @param int $years The number of years to add. * @return $this The current instance for method chaining. */ public function addYears(int $years) { } /** * Adds exactly one year to the current date and time. * * @return $this */ public function addYear() { } /** * Add a quarter (3 months) to the current date. * * @return $this */ public function addQuarter() { } /** * Add a decade (10 years) to the current date. * * @return $this */ public function addDecade() { } /** * Subtracts the given number of seconds from the current date and time. * * @param int $seconds The number of seconds to subtract. * @return $this The current instance for method chaining. */ public function subSeconds(int $seconds) { } /** * Subtracts one second from the current date and time. * * @return $this The current instance for method chaining. */ public function subSecond() { } /** * Subtracts the given number of minutes from the current date and time. * * @param int $minutes The number of minutes to subtract. * @return $this The current instance for method chaining. */ public function subMinutes(int $minutes) { } /** * Subtracts one minute from the current date and time. * * @return $this The current instance for method chaining. */ public function subMinute() { } /** * Subtracts the given number of hours from the current date and time. * * @param int $hours The number of hours to subtract. * @return $this The current instance for method chaining. */ public function subHours(int $hours) { } /** * Subtracts one hour from the current date and time. * * @return $this The current instance for method chaining. */ public function subHour() { } /** * Subtracts the given number of days from the current date and time. * * @param int $days The number of days to subtract. * @return $this The current instance for method chaining. */ public function subDays(int $days) { } /** * Subtracts one day from the current date and time. * * @return $this The current instance for method chaining. */ public function subDay() { } /** * Subtracts the given number of weeks from the current date and time. * * @param int $weeks The number of weeks to subtract. * @return $this The current instance for method chaining. */ public function subWeeks(int $weeks) { } /** * Subtracts one week from the current date and time. * * @return $this The current instance for method chaining. */ public function subWeek() { } /** * Subtracts the given number of months from the current date and time. * * @param int $months The number of months to subtract. * @return $this The current instance for method chaining. */ public function subMonths(int $months) { } /** * Subtracts one month from the current date and time. * * @return $this The current instance for method chaining. */ public function subMonth() { } /** * Subtracts the given number of years from the current date and time. * * @param int $years The number of years to subtract. * @return $this The current instance for method chaining. */ public function subYears(int $years) { } /** * Subtracts one year from the current date and time. * * @return $this The current instance for method chaining. */ public function subYear() { } /** * Subtract a quarter (3 months) from the current date. * * @return $this */ public function subQuarter() { } /** * Subtract a decade (10 years) from the current date. * * @return $this */ public function subDecade() { } /** * Set the date to start of the decade. * @return $this */ public function startOfDecade() { } /** * Set the date to end of the decade. * @return $this */ public function endOfDecade() { } /** * Sets start of the year in the current dateTime * * @return $this */ public function startOfYear() { } /** * Sets end of the year in the current dateTime * * @return $this */ public function endOfYear() { } /** * Sets the date to the first day of the current quarter at 00:00:00. * * @return $this */ public function startOfQuarter() { } /** * Sets the date to the last day of the current quarter at 23:59:59. * * @return $this */ public function endOfQuarter() { } /** * Sets start of the month in the current dateTime * * @return $this */ public function startOfMonth() { } /** * Sets end of the month in the current dateTime * * @return $this */ public function endOfMonth() { } /** * Sets start of the week in the current dateTime * * @return $this */ public function startOfWeek() { } /** * Sets end of the week in the current dateTime * * @return $this */ public function endOfWeek() { } /** * Sets start of the day in the current dateTime * * @return $this */ public function startOfDay() { } /** * Sets end of the day in the current dateTime * * @return $this */ public function endOfDay() { } /** * Sets start of the hour in the current DateTime object * * @return $this */ public function startOfHour() { } /** * Sets end of the hour in the current DateTime object * * @return $this */ public function endOfHour() { } /** * Sets start of the minute in the current DateTime object * * @return $this */ public function startOfMinute() { } /** * Sets end of the minute in the current DateTime object * * @return $this */ public function endOfMinute() { } /** * Check if the current instance is a weekend. * * @return bool * * @phpstan-ignore-next-line */ public function isWeekend($startOfWeek = null): bool { } /** * Check if the current instance is a weekday. * * @return bool */ public function isWeekday() { } /** * Check if the current instance is in the past. * * @return bool */ public function isPast() { } /** * Check if the current instance is in the future. * * @return bool */ public function isFuture() { } /** * Check if the year is a leap year. * * @return boolean * * @phpstan-ignore-next-line */ public function isLeapYear(): bool { } /** * Checks if the current time is midnight (00:00:00). * * @return bool */ public function isMidnight() { } /** * Check if the current instance is the same day as another DateTime instance. * * @param DateTime $other * @return bool */ public function isSameDay(\FluentCart\Framework\Support\DateTime $other) { } /** * Clone the current Object * * @return \FluentCart\Framework\Support\DateTime */ public function copy() { } /** * Get the difference in years * * @param \FluentCart\Framework\Support\DateTime $date * @return int */ public function diffInYears($date) { } /** * Get the difference in months * * @param \FluentCart\Framework\Support\DateTime $date * @return int */ public function diffInMonths($date) { } /** * Get the difference in days * * @param \FluentCart\Framework\Support\DateTime $date * @return int */ public function diffInDays($date) { } /** * Get the difference in hours * * @param \FluentCart\Framework\Support\DateTime $date * @return int */ public function diffInHours($date) { } /** * Get the difference in minutes * * @param \FluentCart\Framework\Support\DateTime $date * @return int */ public function diffInMinutes($date) { } /** * Get the difference in seconds * * @param \FluentCart\Framework\Support\DateTime $date * @return int */ public function diffInSeconds($date) { } /** * Get human friendly time difference (2 hours ago/ 2 hours from now) * * @param \DateTimeInterface|string|int $from The datetime to compare from * @param \DateTimeInterface|string|int $to The datetime to compare to * @return string Human readable string, ie. 5 days ago/from now */ public function diffForHumans($from = null, $to = null) { } /** * Given a date in the timezone of the site, returns that date in UTC. * * Requires and returns a date in the Y-m-d H:i:s format. * * Return format can be overridden using the $format parameter. * * @param string $dateString The date to be converted, in the timezone of the site. * @param string $format The format string for the returned date. Default 'Y-m-d H:i:s'. * @see https://developer.wordpress.org/reference/functions/get_gmt_from_date/ * * @return string Formatted version of the date, in UTC. */ public function toUTC($dateString, $format = 'Y-m-d H:i:s') { } /** * Return the ISO-8601 string * * @see https://stackoverflow.com/a/11173072/741747 * * @return mixed */ public function toJSON() { } /** * Returns the formatted string * * @return string */ public function toString() { } /** * Return only the date part as string * * @return string */ public function toDateString() { } /** * Return only the time part as string * * @return string */ public function toTimeString() { } /** * Returns the formatted string * * @return string */ public function __toString() { } /** * Getter to get an unit of DateTime * @param string $key * @return string|null */ public function __get($key) { } /** * Setter to set an unit of DateTime * @param string $key * @param string|int $value * @return $this */ public function __set($key, $value) { } /** * Handle Dynamic calls (add/sub) * * @param string $method * @param array $params * @return $this */ public function __call($method, $params) { } } } namespace FluentCart\App\Services\DateTime { class DateTime extends \FluentCart\Framework\Support\DateTime { use \FluentCart\App\Services\DateTime\CanExtractTimeZone; /** * Create a new DateTime Object with current GMT/UTC time * * @return static */ public static function gmtNow() { } public static function now($tz = null) { } /** * Convert any datetime to GMT/UTC * * @param string|\DateTimeInterface|null $datetime The datetime to convert (defaults to current instance) * @return static */ public static function anyTimeToGmt($datetime = null, $fromTz = null) { } public static function gmdate($datetime = null, $fromTz = null) { } /** * Convert a GMT/UTC datetime to the given timezone * * @param string|\DateTimeInterface|null $datetime The datetime to convert (defaults to now in UTC) * @param string|null $timezone Target timezone (defaults to site timezone) * @return static */ public static function gmtToTimezone($datetime = null, $timezone = null): \FluentCart\App\Services\DateTime\DateTime { } /** * Safely resolve a timezone string to a DateTimeZone object. * * PHP 8.4 throws on deprecated aliases like Asia/Saigon, so we validate * with timezone_open() before constructing. Old orders may carry such aliases * from the browser-captured user_tz stored in order config at checkout time. * Falls back to the supplied $fallback, or wp_timezone() if none given. */ private static function resolveTimezone($timezone, $fallback = null): \DateTimeZone { } public function getDefaultTimezone() { } public static function parse($datetimeString, $timezone = null) { } } } namespace FluentCart\App\Services\Email { class BlockEditorHelper { /** * All editor style presets in email-safe values (px, hex). * Used by both the Gutenberg editor settings and the email block renderer. * * @return array{spacing: array, font-family: array, font-size: array, color: array} */ public static function getStyleDefaults() { } /** * Get a single preset category. * * @param string $key One of: spacing, font-family, font-size, color * @return array */ public static function getDefaultPreset($key = '') { } /** * Generate CSS custom properties for spacing presets. * * @return string */ public static function getStyleDefaultPresets() { } /** * Replace CSS variable references with actual values for email rendering. * * @param string $css * @return string */ public static function replaceStyleSlugsWithValues($css = '') { } /** * Generate dynamic CSS for the editor to support font-family classes. * * @return string */ public static function getDynamicCssForEditor() { } /** * Get theme color palette from editor-color-palette support or theme.json. * * @return array */ public static function getThemeColorPalette() { } /** * Get theme preference scheme (colors + font sizes). * * @return array */ public static function getThemePrefScheme() { } } class ConditionPresets { /** * Get all condition presets. * * Each preset has: id, label, shortcode, condition, compareValue * * @return array */ public static function all() { } /** * Get presets formatted for JS localization (id + label only). * * @return array */ public static function forJs() { } /** * Find a preset by its identifier. * * @param string $id * @return array|null */ public static function find($id) { } /** * Resolve a preset ID to its evaluation parameters. * * Returns one of three shapes: * - callback present: ['type' => 'callback', 'callback' => callable, 'presetId' => string] * - shortcode present: ['type' => 'shortcode', 'shortcode' => string, 'condition' => string, 'compareValue' => string] * - neither: ['type' => 'filter', 'presetId' => string] * * @param string $presetId * @return array|null */ public static function resolve($presetId) { } } class EmailNotificationMailer { public function register() { } public function registerAsyncMails() { } public function formatParsable($parsable) { } public function mailEmailsOfEvent($event, $data, $asyncHook = '', $asyncData = []) { } public function mailByEmailName($emailName, $data) { } public function getEmailFooter(): string { } public function parseEmailContent($notification, $data, $templateData = null): array { } public function sendAsyncOrderMail($emailName, $orderId) { } public function sendAsyncSubscriptionMail($emailName, $subscriptionId) { } /** * Generate a PDF receipt for the order in the given data array. * * @param array $data Event data containing 'order' key * @return string|null Path to generated PDF or null */ private function generateOrderPdf(array $data, string $templateId = 'order_receipt'): ?string { } } class EmailNotifications { const EMAIL_RECIPIENT_MAP = ['customer' => '{{order.customer.email}}', 'user' => '{{user.user_email}}', 'subscriber' => '{{order.customer.email}}']; const META_KEY = 'email_notifications_config'; public static function getNotifications(): array { } public static function getDefaultNotifications(): array { } public static function getNotificationsOfEvent($event, $viewData): array { } public static function formatNotification($notification, $viewData): array { } /** * Resolve the recipient template for a notification. * * A notification may declare its own `to` — a smartcode template, or a * literal address — which wins outright. Add-ons need this: they register * notifications that are not order-bound, and the built-in customer * recipient resolves to {{order.customer.email}}, which has nothing to read * from without an order. * * Falling back to the recipient map keeps every core notification, and any * add-on that does not declare `to`, on exactly the path it used before. * * The returned value is a template — parseEmailContent() runs it through * the shortcode parser before use. A declared `to` is returned as given: * wp_mail() accepts an array of recipients as well as a comma-separated * string, so an array is passed through rather than flattened. * * @param array $notification * @param array|null $mailingSettings resolved settings, passed in to avoid a repeat lookup in loops * @return string|array */ public static function resolveRecipientTemplate($notification, $mailingSettings = null) { } public static function getNotification($name) { } //returns only the notification settings public static function getNotificationConfig($notificationName = null) { } public static function updateNotification($name, $data) { } public static function defaultSettings(): array { } //returns all the settings public static function getSettings($key = null) { } public static function cachedSettings() { } public static function updateSettings($data) { } private static function updateCache(): void { } } class EmailPreviewService { public function getPreviewData(string $template): array { } private function getDummyCustomer(): object { } private function getDummyTransaction(): object { } private function getDummyOrder(): object { } private function getDummySubscription($order): object { } } class Mailer { private string $subject = ''; private string $body = ''; private string $footer = ''; private $to = ''; private string $from = ''; private array $cc = []; private array $bcc = []; private string $replyTo = ''; private bool $isHtml = true; private array $attachments = []; public function __construct($to = '', string $subject = '', string $body = '') { } public function subject(string $subject): \FluentCart\App\Services\Email\Mailer { } public function setDefaults($settings = null): \FluentCart\App\Services\Email\Mailer { } public function setSubject($subject): \FluentCart\App\Services\Email\Mailer { } public function body($body): \FluentCart\App\Services\Email\Mailer { } public function to($email, $name = ''): \FluentCart\App\Services\Email\Mailer { } public function setIsHtml($isHtml): \FluentCart\App\Services\Email\Mailer { } public function setFrom($from): \FluentCart\App\Services\Email\Mailer { } public function addCC($cc): \FluentCart\App\Services\Email\Mailer { } public function addBCC($bcc): \FluentCart\App\Services\Email\Mailer { } public function setReplyTo($replyTo): \FluentCart\App\Services\Email\Mailer { } public function addAttachment(string $filePath): \FluentCart\App\Services\Email\Mailer { } public function setAttachments(array $attachments): \FluentCart\App\Services\Email\Mailer { } public function send($cssInliner = false) { } public function wrapWithFooter($content): string { } public static function make(string $to = '', string $subject = '', string $body = ''): \FluentCart\App\Services\Email\Mailer { } } /** * Store Digest email — daily / weekly / monthly. * * A system email summarising store activity for a finished period. It does NOT * flow through the order-bound notification mailer; it builds its own body and * renders it through the shared general_template wrapper. * * Numbers mirror the admin Reports dashboard exactly: same aggregate method * (DefaultReportService::getAllGraphMetricsSeparate) and the same paid-status * filter (Status::getReportStatuses()). */ class StoreDigestService { const CADENCES = ['daily', 'weekly', 'monthly']; const OPTION_KEY = 'fluent_cart_store_digest_settings'; // Single (non-autoloaded) option holding the per-cadence "last sent" stamps. const LAST_SENT_OPTION = 'fluent_cart_digest_last_sent'; /** * Per-request settings cache (busted on save). * * @var array|null */ private static $settingsCache = null; /** * Default settings for this module. The store digest owns its own settings * store — it does NOT live inside the EmailNotifications config. */ public static function defaultSettings(): array { } /** * Read the module's settings, merged over defaults (cadence sub-arrays * deep-merged). Cached per request. * * @param string|null $key dot-path (e.g. 'recipients', 'daily.send_hour') * @return mixed */ public static function getSettings($key = null) { } /** * Sanitize raw input, derive the `enabled` master flag, and persist. * * The module owns its own input handling: callers pass the raw request data * and the service guarantees the stored shape is always clean. `enabled` is * derived server-side (ON when any cadence is enabled) so the hourly scheduler * can short-circuit on a single cheap check. * * @param array $input raw, unsanitized settings (e.g. $request->all()) * @return array the stored settings */ public static function saveSettings(array $input): array { } /** * Coerce raw input into the settings shape. `enabled` is intentionally not * read from input — it is derived in saveSettings(). */ private static function sanitize(array $input): array { } private static function clampInt($value, int $min, int $max): int { } /** * Hooked to fluent_cart/scheduler/hourly_tasks. Evaluates every cadence * against the current site-local time and dispatches the ones that are due. */ public static function runDueDigests(): void { } /** * Decide whether a single cadence is due, and send once if so. */ private static function maybeSend(string $frequency, $cadenceConfig, int $hour): void { } /** * Per-cadence idempotency key based on the site-local calendar. */ private static function dedupStamp(string $frequency): string { } /** * Build and send one digest. * * @param string $frequency daily|weekly|monthly * @param string $recipientsOverride optional comma-separated recipients (test send) * @return bool true when an email was dispatched */ public static function sendDigest(string $frequency, string $recipientsOverride = ''): bool { } /** * Assemble the digest payload: current + prior window totals, deltas, top products. */ public static function buildPayload(string $frequency): array { } /** * Window totals for a date range — same query + paid-status filter the * Reports dashboard uses, so numbers always agree. */ private static function metricsFor(string $startDate, string $endDate): array { } /** * Top 5 products by units sold, each carrying units and revenue. */ private static function topProducts(string $startDate, string $endDate): array { } /** * Current finished-period window as site-local wall-clock strings. * * created_at is stored in UTC, but — to match the dashboard exactly — we * query with bare local strings (no GMT conversion), built from * current_time() via the same gmdate() idiom the dashboard uses. * * @return array [startDate, endDate] */ private static function windowFor(string $frequency): array { } /** * The equivalent period immediately before the current window (for deltas). * * @return array [startDate, endDate] */ private static function priorWindowFor(string $frequency): array { } private static function resolveRecipients($raw, string $frequency, $config): array { } private static function renderEmailBody(array $payload): string { } private static function preheader(array $payload): string { } /** * Friendly opening line, varied per cadence. Uses a numbered placeholder so * the store name slots in (`%1$s`) for translators. */ private static function introLine(string $frequency, string $storeName): string { } private static function subjectFor(array $payload): string { } private static function frequencyLabel(string $frequency): string { } private static function periodLabel(string $frequency, string $start, string $end): string { } private static function storeName(): string { } /** * Report totals are already decimals (SQL divides by 100), but * Helper::toDecimal expects integer cents — convert back before formatting. */ private static function money($decimalAmount): string { } private static function fluctuation($fluctuations, string $key): float { } /** * Choose the Pro upsell angle for this digest and build its copy + tracked URL. * * Two layers: * - Contextual (phase 2): pick the angle from THIS period's own numbers — a * growing store, a quiet/declining one, and a high-volume one each hear a * different, relevant pitch. * - Rotation (phase 1): when no signal stands out, rotate through evergreen * angles deterministically, offset per store, so a recurring digest never * repeats the same line week after week (anti-fatigue) while still splitting * the population across angles at any given moment (so the angles are * measurable, not just decorative). * * Every CTA carries a utm_content of "{frequency}_{variant}" so conversions * are attributable per cadence and per angle. */ private static function proPromo(array $payload): array { } /** * Benefit-led copy per angle. All anchored to the same true Pro value * (premium payment gateways, integrations, customizations) but led by a * distinct motivational hook. tags are injected around the escaped * translatable text, so the returned body is safe HTML for the view to echo. * * @return array{body:string,cta:string} */ private static function proPromoCopy(string $variant, float $grossDelta, int $orderCount): array { } /** * Append campaign tracking so conversions are attributable per cadence and * per angle. Starts from the (already-filtered) pro_url carried in the payload. */ private static function proPromoUrl(array $payload, string $variant): string { } /** * Deterministic rotation seed = per-store offset + period index. The offset * (hash of the site URL) puts each store on a different phase, so at any given * moment the population is split across angles; the period index advances each * cadence, so a single store cycles through angles over time. */ private static function rotationSeed(string $frequency): int { } /** * Order volume that counts as "busy" for the save-time angle, scaled by cadence. */ private static function busyThreshold(string $frequency): int { } } } namespace FluentCart\App\Services\FileSystem { class DownloadService { public function register() { } public function registerDownloadRoutes($request) { } private function checkPermissionBeforeDownloadPermissionAndStoreLog($params) { } private function downloadFile($params) { } public static function downloadFileFromId($downloadId) { } public static function getDownloadableUrlFromDownload($productDownload): string { } public function getDownloadableUrl($params): string { } public function getDownloadablePath($params) { } } } namespace FluentCart\App\Services\FileSystem\Drivers { abstract class BaseDriver { protected ?string $dirPath; protected ?string $dirName; protected ?\FluentCart\App\Modules\StorageDrivers\BaseStorageDriver $storageDriver; public function __construct(?string $dirPath = null, ?string $dirName = null) { } public function getStorageDriver(): ?\FluentCart\App\Modules\StorageDrivers\BaseStorageDriver { } public function saveSettings($params) { } public function buckets() { } abstract protected function getDefaultDirPath(); abstract public function listFiles(array $params = []); abstract public function uploadFile($localFilePath, $uploadToFilePath, $file, $params = []); abstract public function downloadFile(string $filePath); abstract public function getSignedDownloadUrl(string $filePath, $bucket = null, $productDownload = null); abstract public function getFilePath(string $filePath); abstract protected function retrieveFileForDownload(string $downloadableFilePath); public function setDownloadHeader($fileName, $file, $fileSize = null) { } } } namespace FluentCart\App\Services\FileSystem\Drivers\Local { class LocalDriver extends \FluentCart\App\Services\FileSystem\Drivers\BaseDriver { public function getDirName(): string { } public function __construct(?string $dirPath = null, ?string $dirName = null) { } protected function getDefaultDirPath(): string { } private function ensureDirectoryExist() { } public function listFiles(array $params = []): array { } public function uploadFile($localFilePath, $uploadToFilePath, $file, $params = []) { } public function getSignedDownloadUrl(string $filePath, $bucket = null, $productDownload = null): string { } public function downloadFile(string $filePath, $fileName = null) { } public function getFilePath(string $filePath, $fileName = null): string { } protected function retrieveFileForDownload(string $downloadableFilePath) { } public function deleteFile(string $filePath) { } } } namespace FluentCart\App\Services\FileSystem\Drivers\S3 { class S3BucketCreator { private const DEFAULT_REGION = 'us-east-1'; private string $accessKey; private string $secretKey; private string $region; private string $bucket; private string $hashAlgorithm = 'sha256'; private string $httpMethod = 'PUT'; private string $signature; private $timeStamp; private $date; private string $requestUrl; private ?string $sessionToken = null; public static function create(string $secret, string $accessKey, string $bucket, string $region, ?string $sessionToken = null) { } public function __construct(string $secret, string $accessKey, string $bucket, string $region, ?string $sessionToken = null) { } public function createBucket() { } public function getSignature(): string { } public function generateSignature() { } private function createScope(): string { } private function getContentHash($payload = ''): string { } private function createCanonicalUrl($payloadHash): string { } private function getHost(): string { } private function getBucketBaseUrl(): string { } private function createStringToSign($payloadHash): string { } private function getSigningKey() { } // We need to re-generate signature dynamically based on body if needed, // but constructor runs once. So usage of this class instance: // Actually, let's just do it inside getHeaders since body is there private function generateSignatureKey($body = '') { } public function getHeaders($body = ''): array { } } class S3BucketList { private string $accessKey; private string $secretKey; private string $region; private string $hashAlgorithm = 'sha256'; private string $httpMethod; private string $signature; private $timeStamp; private $date; private string $requestUrl; private ?string $sessionToken = null; public static function get(string $secret, string $accessKey, string $region, ?string $sessionToken = null) { } public function __construct(string $secret, string $accessKey, string $region, ?string $sessionToken = null) { } public function getList() { } private function parseResponseXml($response): array { } public function getSignature(): string { } public function generateSignature() { } private function createScope(): string { } private function getContentHash(): string { } private function createCanonicalUrl(): string { } private function getHost(): string { } private function createStringToSign(): string { } private function getSigningKey() { } private function generateSignatureKey() { } public function getHeaders(): array { } } class S3ConnectionVerify { private const DEFAULT_REGION = 'us-east-1'; private const MAX_REGION_RETRIES = 2; private $date; private $timeStamp; private string $accessKey; private string $bucket; private string $hashAlgorithm = 'sha256'; private string $httpMethod; private string $region; private string $secretKey; private string $signature; private string $requestUrl; private ?string $sessionToken = null; private string $payloadBody = ''; private ?string $contentMD5 = null; private int $regionRetryCount = 0; public static function verify(string $secret, string $accessKey, ?string $sessionToken = null, string $bucket = '', string $region = 'us-east-1') { } public static function checkBucketExistence(string $secret, string $accessKey, ?string $sessionToken = null, string $bucket = '', string $region = 'us-east-1') { } public static function updatePublicAccessBlock(string $secret, string $accessKey, ?string $sessionToken = null, string $bucket = '', bool $enable = true, string $region = 'us-east-1') { } public static function updateObjectOwnership(string $secret, string $accessKey, ?string $sessionToken = null, string $bucket = '', bool $enforce = true, string $region = 'us-east-1') { } public static function checkSecuritySettings(string $secret, string $accessKey, ?string $sessionToken = null, string $bucket = '', string $region = 'us-east-1') { } public function __construct(string $secret, string $accessKey, ?string $sessionToken = null, string $region = 'us-east-1') { } public function testConnection() { } public function testBucketConnection() { } public function checkPublicAccessBlock() { } public function setPublicAccessBlock(bool $enable) { } public function checkObjectOwnership() { } public function getBucketLocation() { } public function setObjectOwnership(bool $enforce) { } private static function validateRequestInputs(string $region, string $bucket = '') { } private function getServiceListUrl(): string { } private function getBucketBaseUrlForRegion(string $region): string { } private function getBucketRequestUrl(string $querySuffix = '?max-keys=1'): string { } private function retryWithRegion(string $detectedRegion, string $querySuffix) { } private function generateSignature() { } private function createStringToSign(): string { } private function createCanonicalUrl(): string { } private function getHost(): string { } private function getContentHash(): string { } private function getScope(): string { } private function getSigningKey() { } private function getHeaders(): array { } private function isPathStyle() { } } class S3Driver extends \FluentCart\App\Services\FileSystem\Drivers\BaseDriver { private string $accessKey; private string $secretKey; private string $bucket; private string $region; public function __construct(?string $dirPath = null, ?string $dirName = null) { } public function buckets() { } public function uploadFile($localFilePath, $uploadToFilePath, $file, $params = []) { } public function listFiles(array $params = []) { } protected function generatePresignedDownloadUrlOld(string $filePath, $expirationMinutes = 15, $bucket = null, $fileName = null): string { } protected function generatePresignedDownloadUrl(string $filePath, $expirationMinutes = 15, $bucket = null, $fileName = null): string { } protected function retrieveFileForDownload(string $downloadableFilePath, $bucket = null) { } public function getSignedDownloadUrl(string $filePath, $bucket = null, $productDownload = null): string { } public function downloadFile(string $filePath, $fileName = null, $bucket = null) { } public function getFilePath(string $filePath, $fileName = null, $bucket = null) { } protected function getDefaultDirPath() { } public function deleteFile($filePath, $bucket = null) { } } class S3FileDeleter { private string $accessKey; private string $secretKey; private string $bucket; private string $region; private string $hashAlgorithm = 'sha256'; private string $httpMethod; private string $s3FilePath; private string $signature; private string $requestUrl; private $timeStamp; private $date; public function __construct(string $secret, string $accessKey, string $bucket, string $region, string $s3FilePath) { } public static function delete(string $secret, string $accessKey, string $bucket, string $region, string $s3FilePath) { } public function deleteFile() { } private function generateSignature() { } private function createStringToSign(): string { } private function createCanonicalUrl(): string { } private function getHost(): string { } private function getContentHash(): string { } private function getScope(): string { } private function getSigningKey() { } private function getHeaders(): array { } } class S3FileList { private string $date; private string $timeStamp; private string $accessKey; private string $bucket; private string $hashAlgorithm = 'sha256'; private string $httpMethod; private string $region; private string $secretKey; private string $signature; private string $requestUrl; private int $maxKeys = 10; public static function get(string $secret, string $accessKey, string $bucket, string $region, $search = '') { } public function __construct(string $secret, string $accessKey, string $bucket = '', string $region = '') { } public function getList($search = '') { } public function verifyAuth() { } private function parseResponseXml($response): array { } private function generateSignature(array $params = []): string { } private function createStringToSign(array $params = []): string { } private function createCanonicalUrl(array $params = []): string { } private function getHostOld(): string { } private function getHost(): string { } private function getContentHash(): string { } private function getScope(): string { } private function getSigningKey() { } private function getHeaders(): array { } } class S3FileUploader { private string $accessKey; private string $secretKey; private string $bucket; private string $region; private string $hashAlgorithm = 'sha256'; private string $httpMethod; private string $localFilePath; private string $s3FilePath; private string $signature; private string $requestUrl; private string $timeStamp; private string $date; /** * @throws \Exception */ public function __construct(string $secret, string $accessKey, string $bucket, string $region, string $localFilePath, string $s3FilePath) { } /** * @throws \Exception */ public static function upload(string $secret, string $accessKey, string $bucket, string $region, string $localFilePath, string $s3FilePath) { } /** * @throws \Exception */ public function uploadFile() { } public function getSignature(): string { } /** * @throws \Exception */ public function generateSignature() { } private function createScope(): string { } /** * @throws \Exception */ private function getContentHash(): string { } /** * @throws \Exception */ private function createCanonicalUrl(): string { } private function getUploadHostOld(): string { } private function getUploadHost(): string { } /** * @throws \Exception */ private function createStringToSign(): string { } private function getSigningKey() { } /** * @throws \Exception */ public function getHeaders(): array { } } class S3InputValidator { private const REGION_PATTERN = '/^(af|ap|ca|cn|eu|il|me|mx|sa|us)(-gov)?-[a-z0-9-]+-\d+$/'; public static function isValidBucket($bucket): bool { } public static function isValidRegion($region): bool { } public static function validateBucket($bucket) { } public static function validateRegion($region) { } public static function validateBucketAndRegion($bucket, $region) { } } } namespace FluentCart\App\Services\FileSystem { class FileManager { /** * @var \FluentCart\App\Services\FileSystem\Drivers\BaseDriver|\FluentCart\App\Services\FileSystem\Drivers\S3\S3Driver|\FluentCart\App\Services\FileSystem\Drivers\Local\LocalDriver $driver **/ private $driver; protected ?string $dirPath; protected ?string $dirName; public function getDriver() { } public function __construct(string $driver = 'local', ?string $dirPath = null, ?string $dirName = null, $inActiveMode = false) { } public function listFiles(array $params = []) { } public function bucketLists() { } public function uploadFile(string $localFilePath, string $uploadToFilePath, $file, array $params = []) { } public function downloadFile(string $filePath, string $fileName, $bucket = null) { } public function getSignedDownloadUrl(string $filePath, $bucket = null, $productDownload = null): ?string { } public function getFilePath(string $filePath, $bucket = null) { } public function deleteFile(string $filePath, $bucket = null) { } private function resolveDriver(string $driver, $inActiveMode) { } public function saveSettings($params) { } } } namespace FluentCart\App\Services\Filter\Concerns { trait HasIdTitleSlugSearch { public function applySimpleFilter(?string $search = null): void { } } } namespace FluentCart\App\Services\Filter { class AttrGroupFilter extends \FluentCart\App\Services\Filter\BaseFilter { use \FluentCart\App\Services\Filter\Concerns\HasIdTitleSlugSearch; // Groups render in the merchant's manual drag-order (fct_atts_groups.serial), // the same contract terms use. Forced here so the list the sidebar drags // matches the order the reorder endpoint persists. public string $defaultSortBy = 'serial'; public string $defaultSortType = 'asc'; protected function parseSortBy(): string { } protected function parseSortType(): string { } public function applySelect(): void { } protected function applyWith(): void { } protected function buildCommonQuery() { } public function tabsMap(): array { } public function getModel(): string { } public static function getFilterName(): string { } public function applyActiveViewFilter(?string $activeView = null): void { } private function whereStyling($query, string $styling): void { } } class AttrTermFilter extends \FluentCart\App\Services\Filter\BaseFilter { use \FluentCart\App\Services\Filter\Concerns\HasIdTitleSlugSearch; public string $defaultSortBy = 'serial'; public string $defaultSortType = 'asc'; protected function parseSortBy(): string { } protected function parseSortType(): string { } protected ?int $groupId = null; public function setGroupId(int $groupId): self { } public function applySelect(): void { } protected function buildCommonQuery() { } public function tabsMap(): array { } public function getModel(): string { } public static function getFilterName(): string { } public function applyActiveViewFilter(?string $activeView = null): void { } } class CouponFilter extends \FluentCart\App\Services\Filter\BaseFilter { public function applySimpleFilter(?string $search = null): void { } public function tabsMap(): array { } public function getModel(): string { } public static function getFilterName(): string { } public function applyActiveViewFilter(?string $activeView = null): void { } } class CustomerFilter extends \FluentCart\App\Services\Filter\BaseFilter { public function applySimpleFilter(?string $search = null): void { } public function tabsMap(): array { } public function getModel(): string { } public static function getFilterName(): string { } public function applyActiveViewFilter(?string $activeView = null): void { } public static function getSearchableFields(): array { } public static function advanceFilterOptions(): array { } public function dateColumns(): array { } public function centColumns(): array { } } class LabelFilter extends \FluentCart\App\Services\Filter\BaseFilter { public function applySimpleFilter(?string $search = null): void { } public function tabsMap(): array { } public function getModel(): string { } public static function getFilterName(): string { } public function applyActiveViewFilter(?string $activeView = null): void { } public static function getSelectFilterOptions(array $args): array { } public static function advanceFilterOptions() { } public static function advanceFilterOptionsForOther($otherFilters = []): array { } } class LicenseFilter extends \FluentCart\App\Services\Filter\BaseFilter { public function applySimpleFilter(?string $search = null): void { } public function tabsMap(): array { } public function getModel(): string { } public static function getFilterName(): string { } public function applyActiveViewFilter(?string $activeView = null): void { } public static function getSearchableFields(): array { } public static function advanceFilterOptions(): array { } } class LicenseSiteFilter extends \FluentCart\App\Services\Filter\BaseFilter { public function getModel(): string { } public static function getFilterName(): string { } public function tabsMap(): array { } public function applySimpleFilter(?string $search = null): void { } public function applyActiveViewFilter(?string $activeView = null): void { } public function customQuery() { } public static function getSearchableFields(): array { } public static function advanceFilterOptions(): array { } } class LogFilter extends \FluentCart\App\Services\Filter\BaseFilter { public function applySimpleFilter(?string $search = null): void { } public function tabsMap(): array { } public function getModel(): string { } public static function getFilterName(): string { } public function applyActiveViewFilter(?string $activeView = null): void { } } class OrderBumpFilter extends \FluentCart\App\Services\Filter\BaseFilter { public function applySimpleFilter(?string $search = null): void { } public function tabsMap(): array { } public function getModel(): string { } public static function getFilterName(): string { } public function applyActiveViewFilter(?string $activeView = null): void { } public static function getSearchableFields(): array { } public static function advanceFilterOptions(): array { } } class OrderFilter extends \FluentCart\App\Services\Filter\BaseFilter { protected static function statusFilterKeys(): array { } public function applySimpleFilter(?string $search = null): void { } public function tabsMap(): array { } public function getModel(): string { } public static function getFilterName(): string { } public static function parseableKeys(): array { } public static function b2bMetaCondition(): \Closure { } public function applyActiveViewFilter(?string $activeView = null): void { } public static function getSearchableFields(): array { } public static function advanceFilterOptions(): array { } public function centColumns(): array { } } class ProductFilter extends \FluentCart\App\Services\Filter\BaseFilter { public string $defaultSortBy = "ID"; public function applySimpleFilter(?string $search = null): void { } public function tabsMap(): array { } public function getModel(): string { } public static function getFilterName(): string { } // public static function parseableKeys(): array // { // return array_merge( // parent::parseableKeys(), // ['payment_statuses', 'order_statuses', 'shipping_statuses'] // ); // } public function applyActiveViewFilter(?string $activeView = null): void { } public static function getSearchableFields(): array { } public static function advanceFilterOptions(): array { } /** * Filter products by total available stock. * Variants with manage_stock=0 are unlimited (always in-stock). * For managed variants, SUM(available) is used. */ private static function filterByTotalAvailable($query, $operator, $value) { } public function centColumns(): array { } public static function makeNestedTreeOption($data): array { } } class TaxFilter extends \FluentCart\App\Services\Filter\BaseFilter { public function applySimpleFilter(?string $search = null): void { } public function tabsMap(): array { } public function getModel(): string { } public static function getFilterName(): string { } public function applyActiveViewFilter(?string $activeView = null): void { } public static function advanceFilterOptions(): array { } public static function getCountriesOptions() { } public static function getStatesOptions() { } } class VariationFilter extends \FluentCart\App\Services\Filter\BaseFilter { public function applySimpleFilter(?string $search = null): void { } protected function applyMustLoadIds() { } public function tabsMap(): array { } public function getModel(): string { } public static function getFilterName(): string { } public function applyActiveViewFilter(?string $activeView = null): void { } public static function getTreeFilterOptions(array $args): array { } } } namespace FluentCart\App\Services { class FrontendView { public static function make($title, $content = '', $params = []) { } public static function makeForBlock($title, $view) { } // public static function loadView(string $path, $data = []) // { // return App::view()->make('frontend/' . $path)->with($data); // } public static function loadView(string $pageTitle, array $data, string $filePath = '') { } public static function enqueueNotFoundPageAssets(): void { } public static function renderNotFoundPage($pageTitle = null, $title = null, $text = null, $buttonText = null, $notFoundImg = null, $buttonUrl = null) { } public static function renderFileNotFoundPage() { } public static function renderForPrint($content, $params = []) { } public static function getLocalizeData(): array { } } class Integration { public function register(): void { } private function init() { } } } namespace FluentCart\App\Services\Libs\Emogrifier { class Emogrifier { private $html = ''; public function __construct($html) { } public function emogrify() { } private function handleTijsVerkoyen() { } } } namespace { // autoload_real.php @generated by Composer class FluentEmogComposerAutoloaderInitFcart6ba88f1695515329cfc7e4b26033cc69 { private static $loader; public static function loadClassLoader($class) { } /** * @return \Composer\Autoload\ClassLoader */ public static function getLoader() { } } } namespace Composer\Autoload { class ComposerFluentStaticInitFcart6ba88f1695515329cfc7e4b26033cc69 { public static $prefixLengthsPsr4 = array('F' => array('FluentEmogrifier\Vendor\TijsVerkoyen\CssToInlineStyles\\' => 55, 'FluentEmogrifier\Vendor\Symfony\Component\CssSelector\\' => 54)); public static $prefixDirsPsr4 = array('FluentEmogrifier\Vendor\TijsVerkoyen\CssToInlineStyles\\' => array(0 => __DIR__ . '/..' . '/tijsverkoyen/css-to-inline-styles/src'), 'FluentEmogrifier\Vendor\Symfony\Component\CssSelector\\' => array(0 => __DIR__ . '/..' . '/symfony/css-selector')); public static $classMap = array('Composer\InstalledVersions' => __DIR__ . '/..' . '/composer/InstalledVersions.php'); public static function getInitializer(\Composer\Autoload\ClassLoader $loader) { } } } namespace FluentEmogrifier\Vendor\Symfony\Component\CssSelector { /** * CssSelectorConverter is the main entry point of the component and can convert CSS * selectors to XPath expressions. * * @author Christophe Coevoet */ class CssSelectorConverter { private $translator; private $cache; private static $xmlCache = []; private static $htmlCache = []; /** * @param bool $html Whether HTML support should be enabled. Disable it for XML documents */ public function __construct(bool $html = true) { } /** * Translates a CSS expression to its XPath equivalent. * * Optionally, a prefix can be added to the resulting XPath * expression with the $prefix parameter. * * @return string */ public function toXPath(string $cssExpr, string $prefix = 'descendant-or-self::') { } } } namespace FluentEmogrifier\Vendor\Symfony\Component\CssSelector\Exception { /** * Interface for exceptions. * * This component is a port of the Python cssselect library, * which is copyright Ian Bicking, @see https://github.com/SimonSapin/cssselect. * * @author Jean-François Simon */ interface ExceptionInterface extends \Throwable { } /** * ParseException is thrown when a CSS selector syntax is not valid. * * This component is a port of the Python cssselect library, * which is copyright Ian Bicking, @see https://github.com/SimonSapin/cssselect. * * @author Fabien Potencier */ class ParseException extends \Exception implements \FluentEmogrifier\Vendor\Symfony\Component\CssSelector\Exception\ExceptionInterface { } /** * ParseException is thrown when a CSS selector syntax is not valid. * * This component is a port of the Python cssselect library, * which is copyright Ian Bicking, @see https://github.com/SimonSapin/cssselect. * * @author Jean-François Simon */ class ExpressionErrorException extends \FluentEmogrifier\Vendor\Symfony\Component\CssSelector\Exception\ParseException { } /** * ParseException is thrown when a CSS selector syntax is not valid. * * This component is a port of the Python cssselect library, * which is copyright Ian Bicking, @see https://github.com/SimonSapin/cssselect. * * @author Jean-François Simon */ class InternalErrorException extends \FluentEmogrifier\Vendor\Symfony\Component\CssSelector\Exception\ParseException { } /** * ParseException is thrown when a CSS selector syntax is not valid. * * This component is a port of the Python cssselect library, * which is copyright Ian Bicking, @see https://github.com/SimonSapin/cssselect. * * @author Jean-François Simon */ class SyntaxErrorException extends \FluentEmogrifier\Vendor\Symfony\Component\CssSelector\Exception\ParseException { /** * @return self */ public static function unexpectedToken(string $expectedValue, \FluentEmogrifier\Vendor\Symfony\Component\CssSelector\Parser\Token $foundToken) { } /** * @return self */ public static function pseudoElementFound(string $pseudoElement, string $unexpectedLocation) { } /** * @return self */ public static function unclosedString(int $position) { } /** * @return self */ public static function nestedNot() { } /** * @return self */ public static function stringAsFunctionArgument() { } } } namespace FluentEmogrifier\Vendor\Symfony\Component\CssSelector\Node { /** * Interface for nodes. * * This component is a port of the Python cssselect library, * which is copyright Ian Bicking, @see https://github.com/SimonSapin/cssselect. * * @author Jean-François Simon * * @internal */ interface NodeInterface { public function getNodeName(): string; public function getSpecificity(): \FluentEmogrifier\Vendor\Symfony\Component\CssSelector\Node\Specificity; public function __toString(): string; } /** * Abstract base node class. * * This component is a port of the Python cssselect library, * which is copyright Ian Bicking, @see https://github.com/SimonSapin/cssselect. * * @author Jean-François Simon * * @internal */ abstract class AbstractNode implements \FluentEmogrifier\Vendor\Symfony\Component\CssSelector\Node\NodeInterface { /** * @var string */ private $nodeName; public function getNodeName(): string { } } /** * Represents a "[| ]" node. * * This component is a port of the Python cssselect library, * which is copyright Ian Bicking, @see https://github.com/SimonSapin/cssselect. * * @author Jean-François Simon * * @internal */ class AttributeNode extends \FluentEmogrifier\Vendor\Symfony\Component\CssSelector\Node\AbstractNode { private $selector; private $namespace; private $attribute; private $operator; private $value; public function __construct(\FluentEmogrifier\Vendor\Symfony\Component\CssSelector\Node\NodeInterface $selector, ?string $namespace, string $attribute, string $operator, ?string $value) { } public function getSelector(): \FluentEmogrifier\Vendor\Symfony\Component\CssSelector\Node\NodeInterface { } public function getNamespace(): ?string { } public function getAttribute(): string { } public function getOperator(): string { } public function getValue(): ?string { } /** * {@inheritdoc} */ public function getSpecificity(): \FluentEmogrifier\Vendor\Symfony\Component\CssSelector\Node\Specificity { } public function __toString(): string { } } /** * Represents a "." node. * * This component is a port of the Python cssselect library, * which is copyright Ian Bicking, @see https://github.com/SimonSapin/cssselect. * * @author Jean-François Simon * * @internal */ class ClassNode extends \FluentEmogrifier\Vendor\Symfony\Component\CssSelector\Node\AbstractNode { private $selector; private $name; public function __construct(\FluentEmogrifier\Vendor\Symfony\Component\CssSelector\Node\NodeInterface $selector, string $name) { } public function getSelector(): \FluentEmogrifier\Vendor\Symfony\Component\CssSelector\Node\NodeInterface { } public function getName(): string { } /** * {@inheritdoc} */ public function getSpecificity(): \FluentEmogrifier\Vendor\Symfony\Component\CssSelector\Node\Specificity { } public function __toString(): string { } } /** * Represents a combined node. * * This component is a port of the Python cssselect library, * which is copyright Ian Bicking, @see https://github.com/SimonSapin/cssselect. * * @author Jean-François Simon * * @internal */ class CombinedSelectorNode extends \FluentEmogrifier\Vendor\Symfony\Component\CssSelector\Node\AbstractNode { private $selector; private $combinator; private $subSelector; public function __construct(\FluentEmogrifier\Vendor\Symfony\Component\CssSelector\Node\NodeInterface $selector, string $combinator, \FluentEmogrifier\Vendor\Symfony\Component\CssSelector\Node\NodeInterface $subSelector) { } public function getSelector(): \FluentEmogrifier\Vendor\Symfony\Component\CssSelector\Node\NodeInterface { } public function getCombinator(): string { } public function getSubSelector(): \FluentEmogrifier\Vendor\Symfony\Component\CssSelector\Node\NodeInterface { } /** * {@inheritdoc} */ public function getSpecificity(): \FluentEmogrifier\Vendor\Symfony\Component\CssSelector\Node\Specificity { } public function __toString(): string { } } /** * Represents a "|" node. * * This component is a port of the Python cssselect library, * which is copyright Ian Bicking, @see https://github.com/SimonSapin/cssselect. * * @author Jean-François Simon * * @internal */ class ElementNode extends \FluentEmogrifier\Vendor\Symfony\Component\CssSelector\Node\AbstractNode { private $namespace; private $element; public function __construct(?string $namespace = null, ?string $element = null) { } public function getNamespace(): ?string { } public function getElement(): ?string { } /** * {@inheritdoc} */ public function getSpecificity(): \FluentEmogrifier\Vendor\Symfony\Component\CssSelector\Node\Specificity { } public function __toString(): string { } } /** * Represents a ":()" node. * * This component is a port of the Python cssselect library, * which is copyright Ian Bicking, @see https://github.com/SimonSapin/cssselect. * * @author Jean-François Simon * * @internal */ class FunctionNode extends \FluentEmogrifier\Vendor\Symfony\Component\CssSelector\Node\AbstractNode { private $selector; private $name; private $arguments; /** * @param \FluentEmogrifier\Vendor\Symfony\Component\CssSelector\Parser\Token[] $arguments */ public function __construct(\FluentEmogrifier\Vendor\Symfony\Component\CssSelector\Node\NodeInterface $selector, string $name, array $arguments = []) { } public function getSelector(): \FluentEmogrifier\Vendor\Symfony\Component\CssSelector\Node\NodeInterface { } public function getName(): string { } /** * @return \FluentEmogrifier\Vendor\Symfony\Component\CssSelector\Parser\Token[] */ public function getArguments(): array { } /** * {@inheritdoc} */ public function getSpecificity(): \FluentEmogrifier\Vendor\Symfony\Component\CssSelector\Node\Specificity { } public function __toString(): string { } } /** * Represents a "#" node. * * This component is a port of the Python cssselect library, * which is copyright Ian Bicking, @see https://github.com/SimonSapin/cssselect. * * @author Jean-François Simon * * @internal */ class HashNode extends \FluentEmogrifier\Vendor\Symfony\Component\CssSelector\Node\AbstractNode { private $selector; private $id; public function __construct(\FluentEmogrifier\Vendor\Symfony\Component\CssSelector\Node\NodeInterface $selector, string $id) { } public function getSelector(): \FluentEmogrifier\Vendor\Symfony\Component\CssSelector\Node\NodeInterface { } public function getId(): string { } /** * {@inheritdoc} */ public function getSpecificity(): \FluentEmogrifier\Vendor\Symfony\Component\CssSelector\Node\Specificity { } public function __toString(): string { } } /** * Represents a ":not()" node. * * This component is a port of the Python cssselect library, * which is copyright Ian Bicking, @see https://github.com/SimonSapin/cssselect. * * @author Jean-François Simon * * @internal */ class NegationNode extends \FluentEmogrifier\Vendor\Symfony\Component\CssSelector\Node\AbstractNode { private $selector; private $subSelector; public function __construct(\FluentEmogrifier\Vendor\Symfony\Component\CssSelector\Node\NodeInterface $selector, \FluentEmogrifier\Vendor\Symfony\Component\CssSelector\Node\NodeInterface $subSelector) { } public function getSelector(): \FluentEmogrifier\Vendor\Symfony\Component\CssSelector\Node\NodeInterface { } public function getSubSelector(): \FluentEmogrifier\Vendor\Symfony\Component\CssSelector\Node\NodeInterface { } /** * {@inheritdoc} */ public function getSpecificity(): \FluentEmogrifier\Vendor\Symfony\Component\CssSelector\Node\Specificity { } public function __toString(): string { } } /** * Represents a ":" node. * * This component is a port of the Python cssselect library, * which is copyright Ian Bicking, @see https://github.com/SimonSapin/cssselect. * * @author Jean-François Simon * * @internal */ class PseudoNode extends \FluentEmogrifier\Vendor\Symfony\Component\CssSelector\Node\AbstractNode { private $selector; private $identifier; public function __construct(\FluentEmogrifier\Vendor\Symfony\Component\CssSelector\Node\NodeInterface $selector, string $identifier) { } public function getSelector(): \FluentEmogrifier\Vendor\Symfony\Component\CssSelector\Node\NodeInterface { } public function getIdentifier(): string { } /** * {@inheritdoc} */ public function getSpecificity(): \FluentEmogrifier\Vendor\Symfony\Component\CssSelector\Node\Specificity { } public function __toString(): string { } } /** * Represents a "(::|:)" node. * * This component is a port of the Python cssselect library, * which is copyright Ian Bicking, @see https://github.com/SimonSapin/cssselect. * * @author Jean-François Simon * * @internal */ class SelectorNode extends \FluentEmogrifier\Vendor\Symfony\Component\CssSelector\Node\AbstractNode { private $tree; private $pseudoElement; public function __construct(\FluentEmogrifier\Vendor\Symfony\Component\CssSelector\Node\NodeInterface $tree, ?string $pseudoElement = null) { } public function getTree(): \FluentEmogrifier\Vendor\Symfony\Component\CssSelector\Node\NodeInterface { } public function getPseudoElement(): ?string { } /** * {@inheritdoc} */ public function getSpecificity(): \FluentEmogrifier\Vendor\Symfony\Component\CssSelector\Node\Specificity { } public function __toString(): string { } } /** * Represents a node specificity. * * This component is a port of the Python cssselect library, * which is copyright Ian Bicking, @see https://github.com/SimonSapin/cssselect. * * @see http://www.w3.org/TR/selectors/#specificity * * @author Jean-François Simon * * @internal */ class Specificity { public const A_FACTOR = 100; public const B_FACTOR = 10; public const C_FACTOR = 1; private $a; private $b; private $c; public function __construct(int $a, int $b, int $c) { } public function plus(self $specificity): self { } public function getValue(): int { } /** * Returns -1 if the object specificity is lower than the argument, * 0 if they are equal, and 1 if the argument is lower. */ public function compareTo(self $specificity): int { } } } namespace FluentEmogrifier\Vendor\Symfony\Component\CssSelector\Parser\Handler { /** * CSS selector handler interface. * * This component is a port of the Python cssselect library, * which is copyright Ian Bicking, @see https://github.com/SimonSapin/cssselect. * * @author Jean-François Simon * * @internal */ interface HandlerInterface { public function handle(\FluentEmogrifier\Vendor\Symfony\Component\CssSelector\Parser\Reader $reader, \FluentEmogrifier\Vendor\Symfony\Component\CssSelector\Parser\TokenStream $stream): bool; } /** * CSS selector comment handler. * * This component is a port of the Python cssselect library, * which is copyright Ian Bicking, @see https://github.com/SimonSapin/cssselect. * * @author Jean-François Simon * * @internal */ class CommentHandler implements \FluentEmogrifier\Vendor\Symfony\Component\CssSelector\Parser\Handler\HandlerInterface { /** * {@inheritdoc} */ public function handle(\FluentEmogrifier\Vendor\Symfony\Component\CssSelector\Parser\Reader $reader, \FluentEmogrifier\Vendor\Symfony\Component\CssSelector\Parser\TokenStream $stream): bool { } } /** * CSS selector comment handler. * * This component is a port of the Python cssselect library, * which is copyright Ian Bicking, @see https://github.com/SimonSapin/cssselect. * * @author Jean-François Simon * * @internal */ class HashHandler implements \FluentEmogrifier\Vendor\Symfony\Component\CssSelector\Parser\Handler\HandlerInterface { private $patterns; private $escaping; public function __construct(\FluentEmogrifier\Vendor\Symfony\Component\CssSelector\Parser\Tokenizer\TokenizerPatterns $patterns, \FluentEmogrifier\Vendor\Symfony\Component\CssSelector\Parser\Tokenizer\TokenizerEscaping $escaping) { } /** * {@inheritdoc} */ public function handle(\FluentEmogrifier\Vendor\Symfony\Component\CssSelector\Parser\Reader $reader, \FluentEmogrifier\Vendor\Symfony\Component\CssSelector\Parser\TokenStream $stream): bool { } } /** * CSS selector comment handler. * * This component is a port of the Python cssselect library, * which is copyright Ian Bicking, @see https://github.com/SimonSapin/cssselect. * * @author Jean-François Simon * * @internal */ class IdentifierHandler implements \FluentEmogrifier\Vendor\Symfony\Component\CssSelector\Parser\Handler\HandlerInterface { private $patterns; private $escaping; public function __construct(\FluentEmogrifier\Vendor\Symfony\Component\CssSelector\Parser\Tokenizer\TokenizerPatterns $patterns, \FluentEmogrifier\Vendor\Symfony\Component\CssSelector\Parser\Tokenizer\TokenizerEscaping $escaping) { } /** * {@inheritdoc} */ public function handle(\FluentEmogrifier\Vendor\Symfony\Component\CssSelector\Parser\Reader $reader, \FluentEmogrifier\Vendor\Symfony\Component\CssSelector\Parser\TokenStream $stream): bool { } } /** * CSS selector comment handler. * * This component is a port of the Python cssselect library, * which is copyright Ian Bicking, @see https://github.com/SimonSapin/cssselect. * * @author Jean-François Simon * * @internal */ class NumberHandler implements \FluentEmogrifier\Vendor\Symfony\Component\CssSelector\Parser\Handler\HandlerInterface { private $patterns; public function __construct(\FluentEmogrifier\Vendor\Symfony\Component\CssSelector\Parser\Tokenizer\TokenizerPatterns $patterns) { } /** * {@inheritdoc} */ public function handle(\FluentEmogrifier\Vendor\Symfony\Component\CssSelector\Parser\Reader $reader, \FluentEmogrifier\Vendor\Symfony\Component\CssSelector\Parser\TokenStream $stream): bool { } } /** * CSS selector comment handler. * * This component is a port of the Python cssselect library, * which is copyright Ian Bicking, @see https://github.com/SimonSapin/cssselect. * * @author Jean-François Simon * * @internal */ class StringHandler implements \FluentEmogrifier\Vendor\Symfony\Component\CssSelector\Parser\Handler\HandlerInterface { private $patterns; private $escaping; public function __construct(\FluentEmogrifier\Vendor\Symfony\Component\CssSelector\Parser\Tokenizer\TokenizerPatterns $patterns, \FluentEmogrifier\Vendor\Symfony\Component\CssSelector\Parser\Tokenizer\TokenizerEscaping $escaping) { } /** * {@inheritdoc} */ public function handle(\FluentEmogrifier\Vendor\Symfony\Component\CssSelector\Parser\Reader $reader, \FluentEmogrifier\Vendor\Symfony\Component\CssSelector\Parser\TokenStream $stream): bool { } } /** * CSS selector whitespace handler. * * This component is a port of the Python cssselect library, * which is copyright Ian Bicking, @see https://github.com/SimonSapin/cssselect. * * @author Jean-François Simon * * @internal */ class WhitespaceHandler implements \FluentEmogrifier\Vendor\Symfony\Component\CssSelector\Parser\Handler\HandlerInterface { /** * {@inheritdoc} */ public function handle(\FluentEmogrifier\Vendor\Symfony\Component\CssSelector\Parser\Reader $reader, \FluentEmogrifier\Vendor\Symfony\Component\CssSelector\Parser\TokenStream $stream): bool { } } } namespace FluentEmogrifier\Vendor\Symfony\Component\CssSelector\Parser { /** * CSS selector parser interface. * * This component is a port of the Python cssselect library, * which is copyright Ian Bicking, @see https://github.com/SimonSapin/cssselect. * * @author Jean-François Simon * * @internal */ interface ParserInterface { /** * Parses given selector source into an array of tokens. * * @return \FluentEmogrifier\Vendor\Symfony\Component\CssSelector\Node\SelectorNode[] */ public function parse(string $source): array; } /** * CSS selector parser. * * This component is a port of the Python cssselect library, * which is copyright Ian Bicking, @see https://github.com/SimonSapin/cssselect. * * @author Jean-François Simon * * @internal */ class Parser implements \FluentEmogrifier\Vendor\Symfony\Component\CssSelector\Parser\ParserInterface { private $tokenizer; public function __construct(?\FluentEmogrifier\Vendor\Symfony\Component\CssSelector\Parser\Tokenizer\Tokenizer $tokenizer = null) { } /** * {@inheritdoc} */ public function parse(string $source): array { } /** * Parses the arguments for ":nth-child()" and friends. * * @param Token[] $tokens * * @throws \FluentEmogrifier\Vendor\Symfony\Component\CssSelector\Exception\SyntaxErrorException */ public static function parseSeries(array $tokens): array { } private function parseSelectorList(\FluentEmogrifier\Vendor\Symfony\Component\CssSelector\Parser\TokenStream $stream): array { } private function parserSelectorNode(\FluentEmogrifier\Vendor\Symfony\Component\CssSelector\Parser\TokenStream $stream): \FluentEmogrifier\Vendor\Symfony\Component\CssSelector\Node\SelectorNode { } /** * Parses next simple node (hash, class, pseudo, negation). * * @throws \FluentEmogrifier\Vendor\Symfony\Component\CssSelector\Exception\SyntaxErrorException */ private function parseSimpleSelector(\FluentEmogrifier\Vendor\Symfony\Component\CssSelector\Parser\TokenStream $stream, bool $insideNegation = false): array { } private function parseElementNode(\FluentEmogrifier\Vendor\Symfony\Component\CssSelector\Parser\TokenStream $stream): \FluentEmogrifier\Vendor\Symfony\Component\CssSelector\Node\ElementNode { } private function parseAttributeNode(\FluentEmogrifier\Vendor\Symfony\Component\CssSelector\Node\NodeInterface $selector, \FluentEmogrifier\Vendor\Symfony\Component\CssSelector\Parser\TokenStream $stream): \FluentEmogrifier\Vendor\Symfony\Component\CssSelector\Node\AttributeNode { } } /** * CSS selector reader. * * This component is a port of the Python cssselect library, * which is copyright Ian Bicking, @see https://github.com/SimonSapin/cssselect. * * @author Jean-François Simon * * @internal */ class Reader { private $source; private $length; private $position = 0; public function __construct(string $source) { } public function isEOF(): bool { } public function getPosition(): int { } public function getRemainingLength(): int { } public function getSubstring(int $length, int $offset = 0): string { } public function getOffset(string $string) { } /** * @return array|false */ public function findPattern(string $pattern) { } public function moveForward(int $length) { } public function moveToEnd() { } } } namespace FluentEmogrifier\Vendor\Symfony\Component\CssSelector\Parser\Shortcut { /** * CSS selector class parser shortcut. * * This component is a port of the Python cssselect library, * which is copyright Ian Bicking, @see https://github.com/SimonSapin/cssselect. * * @author Jean-François Simon * * @internal */ class ClassParser implements \FluentEmogrifier\Vendor\Symfony\Component\CssSelector\Parser\ParserInterface { /** * {@inheritdoc} */ public function parse(string $source): array { } } /** * CSS selector element parser shortcut. * * This component is a port of the Python cssselect library, * which is copyright Ian Bicking, @see https://github.com/SimonSapin/cssselect. * * @author Jean-François Simon * * @internal */ class ElementParser implements \FluentEmogrifier\Vendor\Symfony\Component\CssSelector\Parser\ParserInterface { /** * {@inheritdoc} */ public function parse(string $source): array { } } /** * CSS selector class parser shortcut. * * This shortcut ensure compatibility with previous version. * - The parser fails to parse an empty string. * - In the previous version, an empty string matches each tags. * * This component is a port of the Python cssselect library, * which is copyright Ian Bicking, @see https://github.com/SimonSapin/cssselect. * * @author Jean-François Simon * * @internal */ class EmptyStringParser implements \FluentEmogrifier\Vendor\Symfony\Component\CssSelector\Parser\ParserInterface { /** * {@inheritdoc} */ public function parse(string $source): array { } } /** * CSS selector hash parser shortcut. * * This component is a port of the Python cssselect library, * which is copyright Ian Bicking, @see https://github.com/SimonSapin/cssselect. * * @author Jean-François Simon * * @internal */ class HashParser implements \FluentEmogrifier\Vendor\Symfony\Component\CssSelector\Parser\ParserInterface { /** * {@inheritdoc} */ public function parse(string $source): array { } } } namespace FluentEmogrifier\Vendor\Symfony\Component\CssSelector\Parser { /** * CSS selector token. * * This component is a port of the Python cssselect library, * which is copyright Ian Bicking, @see https://github.com/SimonSapin/cssselect. * * @author Jean-François Simon * * @internal */ class Token { public const TYPE_FILE_END = 'eof'; public const TYPE_DELIMITER = 'delimiter'; public const TYPE_WHITESPACE = 'whitespace'; public const TYPE_IDENTIFIER = 'identifier'; public const TYPE_HASH = 'hash'; public const TYPE_NUMBER = 'number'; public const TYPE_STRING = 'string'; private $type; private $value; private $position; public function __construct(?string $type, ?string $value, ?int $position) { } public function getType(): ?int { } public function getValue(): ?string { } public function getPosition(): ?int { } public function isFileEnd(): bool { } public function isDelimiter(array $values = []): bool { } public function isWhitespace(): bool { } public function isIdentifier(): bool { } public function isHash(): bool { } public function isNumber(): bool { } public function isString(): bool { } public function __toString(): string { } } /** * CSS selector token stream. * * This component is a port of the Python cssselect library, * which is copyright Ian Bicking, @see https://github.com/SimonSapin/cssselect. * * @author Jean-François Simon * * @internal */ class TokenStream { /** * @var Token[] */ private $tokens = []; /** * @var Token[] */ private $used = []; /** * @var int */ private $cursor = 0; /** * @var Token|null */ private $peeked; /** * @var bool */ private $peeking = false; /** * Pushes a token. * * @return $this */ public function push(\FluentEmogrifier\Vendor\Symfony\Component\CssSelector\Parser\Token $token): self { } /** * Freezes stream. * * @return $this */ public function freeze(): self { } /** * Returns next token. * * @throws \FluentEmogrifier\Vendor\Symfony\Component\CssSelector\Exception\InternalErrorException If there is no more token */ public function getNext(): \FluentEmogrifier\Vendor\Symfony\Component\CssSelector\Parser\Token { } /** * Returns peeked token. */ public function getPeek(): \FluentEmogrifier\Vendor\Symfony\Component\CssSelector\Parser\Token { } /** * Returns used tokens. * * @return Token[] */ public function getUsed(): array { } /** * Returns next identifier token. * * @throws \FluentEmogrifier\Vendor\Symfony\Component\CssSelector\Exception\SyntaxErrorException If next token is not an identifier */ public function getNextIdentifier(): string { } /** * Returns next identifier or null if star delimiter token is found. * * @throws \FluentEmogrifier\Vendor\Symfony\Component\CssSelector\Exception\SyntaxErrorException If next token is not an identifier or a star delimiter */ public function getNextIdentifierOrStar(): ?string { } /** * Skips next whitespace if any. */ public function skipWhitespace() { } } } namespace FluentEmogrifier\Vendor\Symfony\Component\CssSelector\Parser\Tokenizer { /** * CSS selector tokenizer. * * This component is a port of the Python cssselect library, * which is copyright Ian Bicking, @see https://github.com/SimonSapin/cssselect. * * @author Jean-François Simon * * @internal */ class Tokenizer { /** * @var \FluentEmogrifier\Vendor\Symfony\Component\CssSelector\Parser\Handler\HandlerInterface[] */ private $handlers; public function __construct() { } /** * Tokenize selector source code. */ public function tokenize(\FluentEmogrifier\Vendor\Symfony\Component\CssSelector\Parser\Reader $reader): \FluentEmogrifier\Vendor\Symfony\Component\CssSelector\Parser\TokenStream { } } /** * CSS selector tokenizer escaping applier. * * This component is a port of the Python cssselect library, * which is copyright Ian Bicking, @see https://github.com/SimonSapin/cssselect. * * @author Jean-François Simon * * @internal */ class TokenizerEscaping { private $patterns; public function __construct(\FluentEmogrifier\Vendor\Symfony\Component\CssSelector\Parser\Tokenizer\TokenizerPatterns $patterns) { } public function escapeUnicode(string $value): string { } public function escapeUnicodeAndNewLine(string $value): string { } private function replaceUnicodeSequences(string $value): string { } } /** * CSS selector tokenizer patterns builder. * * This component is a port of the Python cssselect library, * which is copyright Ian Bicking, @see https://github.com/SimonSapin/cssselect. * * @author Jean-François Simon * * @internal */ class TokenizerPatterns { private $unicodeEscapePattern; private $simpleEscapePattern; private $newLineEscapePattern; private $escapePattern; private $stringEscapePattern; private $nonAsciiPattern; private $nmCharPattern; private $nmStartPattern; private $identifierPattern; private $hashPattern; private $numberPattern; private $quotedStringPattern; public function __construct() { } public function getNewLineEscapePattern(): string { } public function getSimpleEscapePattern(): string { } public function getUnicodeEscapePattern(): string { } public function getIdentifierPattern(): string { } public function getHashPattern(): string { } public function getNumberPattern(): string { } public function getQuotedStringPattern(string $quote): string { } } } namespace FluentEmogrifier\Vendor\Symfony\Component\CssSelector\Util { /** * Minimal compatibility helpers for keeping scoped css-selector PHP 7.4-safe. */ final class Php74Compat { public static function strContains(string $haystack, string $needle): bool { } } } namespace FluentEmogrifier\Vendor\Symfony\Component\CssSelector\XPath\Extension { /** * XPath expression translator extension interface. * * This component is a port of the Python cssselect library, * which is copyright Ian Bicking, @see https://github.com/SimonSapin/cssselect. * * @author Jean-François Simon * * @internal */ interface ExtensionInterface { /** * Returns node translators. * * These callables will receive the node as first argument and the translator as second argument. * * @return callable[] */ public function getNodeTranslators(): array; /** * Returns combination translators. * * @return callable[] */ public function getCombinationTranslators(): array; /** * Returns function translators. * * @return callable[] */ public function getFunctionTranslators(): array; /** * Returns pseudo-class translators. * * @return callable[] */ public function getPseudoClassTranslators(): array; /** * Returns attribute operation translators. * * @return callable[] */ public function getAttributeMatchingTranslators(): array; /** * Returns extension name. */ public function getName(): string; } /** * XPath expression translator abstract extension. * * This component is a port of the Python cssselect library, * which is copyright Ian Bicking, @see https://github.com/SimonSapin/cssselect. * * @author Jean-François Simon * * @internal */ abstract class AbstractExtension implements \FluentEmogrifier\Vendor\Symfony\Component\CssSelector\XPath\Extension\ExtensionInterface { /** * {@inheritdoc} */ public function getNodeTranslators(): array { } /** * {@inheritdoc} */ public function getCombinationTranslators(): array { } /** * {@inheritdoc} */ public function getFunctionTranslators(): array { } /** * {@inheritdoc} */ public function getPseudoClassTranslators(): array { } /** * {@inheritdoc} */ public function getAttributeMatchingTranslators(): array { } } /** * XPath expression translator attribute extension. * * This component is a port of the Python cssselect library, * which is copyright Ian Bicking, @see https://github.com/SimonSapin/cssselect. * * @author Jean-François Simon * * @internal */ class AttributeMatchingExtension extends \FluentEmogrifier\Vendor\Symfony\Component\CssSelector\XPath\Extension\AbstractExtension { /** * {@inheritdoc} */ public function getAttributeMatchingTranslators(): array { } public function translateExists(\FluentEmogrifier\Vendor\Symfony\Component\CssSelector\XPath\XPathExpr $xpath, string $attribute, ?string $value): \FluentEmogrifier\Vendor\Symfony\Component\CssSelector\XPath\XPathExpr { } public function translateEquals(\FluentEmogrifier\Vendor\Symfony\Component\CssSelector\XPath\XPathExpr $xpath, string $attribute, ?string $value): \FluentEmogrifier\Vendor\Symfony\Component\CssSelector\XPath\XPathExpr { } public function translateIncludes(\FluentEmogrifier\Vendor\Symfony\Component\CssSelector\XPath\XPathExpr $xpath, string $attribute, ?string $value): \FluentEmogrifier\Vendor\Symfony\Component\CssSelector\XPath\XPathExpr { } public function translateDashMatch(\FluentEmogrifier\Vendor\Symfony\Component\CssSelector\XPath\XPathExpr $xpath, string $attribute, ?string $value): \FluentEmogrifier\Vendor\Symfony\Component\CssSelector\XPath\XPathExpr { } public function translatePrefixMatch(\FluentEmogrifier\Vendor\Symfony\Component\CssSelector\XPath\XPathExpr $xpath, string $attribute, ?string $value): \FluentEmogrifier\Vendor\Symfony\Component\CssSelector\XPath\XPathExpr { } public function translateSuffixMatch(\FluentEmogrifier\Vendor\Symfony\Component\CssSelector\XPath\XPathExpr $xpath, string $attribute, ?string $value): \FluentEmogrifier\Vendor\Symfony\Component\CssSelector\XPath\XPathExpr { } public function translateSubstringMatch(\FluentEmogrifier\Vendor\Symfony\Component\CssSelector\XPath\XPathExpr $xpath, string $attribute, ?string $value): \FluentEmogrifier\Vendor\Symfony\Component\CssSelector\XPath\XPathExpr { } public function translateDifferent(\FluentEmogrifier\Vendor\Symfony\Component\CssSelector\XPath\XPathExpr $xpath, string $attribute, ?string $value): \FluentEmogrifier\Vendor\Symfony\Component\CssSelector\XPath\XPathExpr { } /** * {@inheritdoc} */ public function getName(): string { } } /** * XPath expression translator combination extension. * * This component is a port of the Python cssselect library, * which is copyright Ian Bicking, @see https://github.com/SimonSapin/cssselect. * * @author Jean-François Simon * * @internal */ class CombinationExtension extends \FluentEmogrifier\Vendor\Symfony\Component\CssSelector\XPath\Extension\AbstractExtension { /** * {@inheritdoc} */ public function getCombinationTranslators(): array { } public function translateDescendant(\FluentEmogrifier\Vendor\Symfony\Component\CssSelector\XPath\XPathExpr $xpath, \FluentEmogrifier\Vendor\Symfony\Component\CssSelector\XPath\XPathExpr $combinedXpath): \FluentEmogrifier\Vendor\Symfony\Component\CssSelector\XPath\XPathExpr { } public function translateChild(\FluentEmogrifier\Vendor\Symfony\Component\CssSelector\XPath\XPathExpr $xpath, \FluentEmogrifier\Vendor\Symfony\Component\CssSelector\XPath\XPathExpr $combinedXpath): \FluentEmogrifier\Vendor\Symfony\Component\CssSelector\XPath\XPathExpr { } public function translateDirectAdjacent(\FluentEmogrifier\Vendor\Symfony\Component\CssSelector\XPath\XPathExpr $xpath, \FluentEmogrifier\Vendor\Symfony\Component\CssSelector\XPath\XPathExpr $combinedXpath): \FluentEmogrifier\Vendor\Symfony\Component\CssSelector\XPath\XPathExpr { } public function translateIndirectAdjacent(\FluentEmogrifier\Vendor\Symfony\Component\CssSelector\XPath\XPathExpr $xpath, \FluentEmogrifier\Vendor\Symfony\Component\CssSelector\XPath\XPathExpr $combinedXpath): \FluentEmogrifier\Vendor\Symfony\Component\CssSelector\XPath\XPathExpr { } /** * {@inheritdoc} */ public function getName(): string { } } /** * XPath expression translator function extension. * * This component is a port of the Python cssselect library, * which is copyright Ian Bicking, @see https://github.com/SimonSapin/cssselect. * * @author Jean-François Simon * * @internal */ class FunctionExtension extends \FluentEmogrifier\Vendor\Symfony\Component\CssSelector\XPath\Extension\AbstractExtension { /** * {@inheritdoc} */ public function getFunctionTranslators(): array { } /** * @throws \FluentEmogrifier\Vendor\Symfony\Component\CssSelector\Exception\ExpressionErrorException */ public function translateNthChild(\FluentEmogrifier\Vendor\Symfony\Component\CssSelector\XPath\XPathExpr $xpath, \FluentEmogrifier\Vendor\Symfony\Component\CssSelector\Node\FunctionNode $function, bool $last = false, bool $addNameTest = true): \FluentEmogrifier\Vendor\Symfony\Component\CssSelector\XPath\XPathExpr { } public function translateNthLastChild(\FluentEmogrifier\Vendor\Symfony\Component\CssSelector\XPath\XPathExpr $xpath, \FluentEmogrifier\Vendor\Symfony\Component\CssSelector\Node\FunctionNode $function): \FluentEmogrifier\Vendor\Symfony\Component\CssSelector\XPath\XPathExpr { } public function translateNthOfType(\FluentEmogrifier\Vendor\Symfony\Component\CssSelector\XPath\XPathExpr $xpath, \FluentEmogrifier\Vendor\Symfony\Component\CssSelector\Node\FunctionNode $function): \FluentEmogrifier\Vendor\Symfony\Component\CssSelector\XPath\XPathExpr { } /** * @throws \FluentEmogrifier\Vendor\Symfony\Component\CssSelector\Exception\ExpressionErrorException */ public function translateNthLastOfType(\FluentEmogrifier\Vendor\Symfony\Component\CssSelector\XPath\XPathExpr $xpath, \FluentEmogrifier\Vendor\Symfony\Component\CssSelector\Node\FunctionNode $function): \FluentEmogrifier\Vendor\Symfony\Component\CssSelector\XPath\XPathExpr { } /** * @throws \FluentEmogrifier\Vendor\Symfony\Component\CssSelector\Exception\ExpressionErrorException */ public function translateContains(\FluentEmogrifier\Vendor\Symfony\Component\CssSelector\XPath\XPathExpr $xpath, \FluentEmogrifier\Vendor\Symfony\Component\CssSelector\Node\FunctionNode $function): \FluentEmogrifier\Vendor\Symfony\Component\CssSelector\XPath\XPathExpr { } /** * @throws \FluentEmogrifier\Vendor\Symfony\Component\CssSelector\Exception\ExpressionErrorException */ public function translateLang(\FluentEmogrifier\Vendor\Symfony\Component\CssSelector\XPath\XPathExpr $xpath, \FluentEmogrifier\Vendor\Symfony\Component\CssSelector\Node\FunctionNode $function): \FluentEmogrifier\Vendor\Symfony\Component\CssSelector\XPath\XPathExpr { } /** * {@inheritdoc} */ public function getName(): string { } } /** * XPath expression translator HTML extension. * * This component is a port of the Python cssselect library, * which is copyright Ian Bicking, @see https://github.com/SimonSapin/cssselect. * * @author Jean-François Simon * * @internal */ class HtmlExtension extends \FluentEmogrifier\Vendor\Symfony\Component\CssSelector\XPath\Extension\AbstractExtension { public function __construct(\FluentEmogrifier\Vendor\Symfony\Component\CssSelector\XPath\Translator $translator) { } /** * {@inheritdoc} */ public function getPseudoClassTranslators(): array { } /** * {@inheritdoc} */ public function getFunctionTranslators(): array { } public function translateChecked(\FluentEmogrifier\Vendor\Symfony\Component\CssSelector\XPath\XPathExpr $xpath): \FluentEmogrifier\Vendor\Symfony\Component\CssSelector\XPath\XPathExpr { } public function translateLink(\FluentEmogrifier\Vendor\Symfony\Component\CssSelector\XPath\XPathExpr $xpath): \FluentEmogrifier\Vendor\Symfony\Component\CssSelector\XPath\XPathExpr { } public function translateDisabled(\FluentEmogrifier\Vendor\Symfony\Component\CssSelector\XPath\XPathExpr $xpath): \FluentEmogrifier\Vendor\Symfony\Component\CssSelector\XPath\XPathExpr { } public function translateEnabled(\FluentEmogrifier\Vendor\Symfony\Component\CssSelector\XPath\XPathExpr $xpath): \FluentEmogrifier\Vendor\Symfony\Component\CssSelector\XPath\XPathExpr { } /** * @throws \FluentEmogrifier\Vendor\Symfony\Component\CssSelector\Exception\ExpressionErrorException */ public function translateLang(\FluentEmogrifier\Vendor\Symfony\Component\CssSelector\XPath\XPathExpr $xpath, \FluentEmogrifier\Vendor\Symfony\Component\CssSelector\Node\FunctionNode $function): \FluentEmogrifier\Vendor\Symfony\Component\CssSelector\XPath\XPathExpr { } public function translateSelected(\FluentEmogrifier\Vendor\Symfony\Component\CssSelector\XPath\XPathExpr $xpath): \FluentEmogrifier\Vendor\Symfony\Component\CssSelector\XPath\XPathExpr { } public function translateInvalid(\FluentEmogrifier\Vendor\Symfony\Component\CssSelector\XPath\XPathExpr $xpath): \FluentEmogrifier\Vendor\Symfony\Component\CssSelector\XPath\XPathExpr { } public function translateHover(\FluentEmogrifier\Vendor\Symfony\Component\CssSelector\XPath\XPathExpr $xpath): \FluentEmogrifier\Vendor\Symfony\Component\CssSelector\XPath\XPathExpr { } public function translateVisited(\FluentEmogrifier\Vendor\Symfony\Component\CssSelector\XPath\XPathExpr $xpath): \FluentEmogrifier\Vendor\Symfony\Component\CssSelector\XPath\XPathExpr { } /** * {@inheritdoc} */ public function getName(): string { } } /** * XPath expression translator node extension. * * This component is a port of the Python cssselect library, * which is copyright Ian Bicking, @see https://github.com/SimonSapin/cssselect. * * @author Jean-François Simon * * @internal */ class NodeExtension extends \FluentEmogrifier\Vendor\Symfony\Component\CssSelector\XPath\Extension\AbstractExtension { public const ELEMENT_NAME_IN_LOWER_CASE = 1; public const ATTRIBUTE_NAME_IN_LOWER_CASE = 2; public const ATTRIBUTE_VALUE_IN_LOWER_CASE = 4; private $flags; public function __construct(int $flags = 0) { } /** * @return $this */ public function setFlag(int $flag, bool $on): self { } public function hasFlag(int $flag): bool { } /** * {@inheritdoc} */ public function getNodeTranslators(): array { } public function translateSelector(\FluentEmogrifier\Vendor\Symfony\Component\CssSelector\Node\SelectorNode $node, \FluentEmogrifier\Vendor\Symfony\Component\CssSelector\XPath\Translator $translator): \FluentEmogrifier\Vendor\Symfony\Component\CssSelector\XPath\XPathExpr { } public function translateCombinedSelector(\FluentEmogrifier\Vendor\Symfony\Component\CssSelector\Node\CombinedSelectorNode $node, \FluentEmogrifier\Vendor\Symfony\Component\CssSelector\XPath\Translator $translator): \FluentEmogrifier\Vendor\Symfony\Component\CssSelector\XPath\XPathExpr { } public function translateNegation(\FluentEmogrifier\Vendor\Symfony\Component\CssSelector\Node\NegationNode $node, \FluentEmogrifier\Vendor\Symfony\Component\CssSelector\XPath\Translator $translator): \FluentEmogrifier\Vendor\Symfony\Component\CssSelector\XPath\XPathExpr { } public function translateFunction(\FluentEmogrifier\Vendor\Symfony\Component\CssSelector\Node\FunctionNode $node, \FluentEmogrifier\Vendor\Symfony\Component\CssSelector\XPath\Translator $translator): \FluentEmogrifier\Vendor\Symfony\Component\CssSelector\XPath\XPathExpr { } public function translatePseudo(\FluentEmogrifier\Vendor\Symfony\Component\CssSelector\Node\PseudoNode $node, \FluentEmogrifier\Vendor\Symfony\Component\CssSelector\XPath\Translator $translator): \FluentEmogrifier\Vendor\Symfony\Component\CssSelector\XPath\XPathExpr { } public function translateAttribute(\FluentEmogrifier\Vendor\Symfony\Component\CssSelector\Node\AttributeNode $node, \FluentEmogrifier\Vendor\Symfony\Component\CssSelector\XPath\Translator $translator): \FluentEmogrifier\Vendor\Symfony\Component\CssSelector\XPath\XPathExpr { } public function translateClass(\FluentEmogrifier\Vendor\Symfony\Component\CssSelector\Node\ClassNode $node, \FluentEmogrifier\Vendor\Symfony\Component\CssSelector\XPath\Translator $translator): \FluentEmogrifier\Vendor\Symfony\Component\CssSelector\XPath\XPathExpr { } public function translateHash(\FluentEmogrifier\Vendor\Symfony\Component\CssSelector\Node\HashNode $node, \FluentEmogrifier\Vendor\Symfony\Component\CssSelector\XPath\Translator $translator): \FluentEmogrifier\Vendor\Symfony\Component\CssSelector\XPath\XPathExpr { } public function translateElement(\FluentEmogrifier\Vendor\Symfony\Component\CssSelector\Node\ElementNode $node): \FluentEmogrifier\Vendor\Symfony\Component\CssSelector\XPath\XPathExpr { } /** * {@inheritdoc} */ public function getName(): string { } private function isSafeName(string $name): bool { } } /** * XPath expression translator pseudo-class extension. * * This component is a port of the Python cssselect library, * which is copyright Ian Bicking, @see https://github.com/SimonSapin/cssselect. * * @author Jean-François Simon * * @internal */ class PseudoClassExtension extends \FluentEmogrifier\Vendor\Symfony\Component\CssSelector\XPath\Extension\AbstractExtension { /** * {@inheritdoc} */ public function getPseudoClassTranslators(): array { } public function translateRoot(\FluentEmogrifier\Vendor\Symfony\Component\CssSelector\XPath\XPathExpr $xpath): \FluentEmogrifier\Vendor\Symfony\Component\CssSelector\XPath\XPathExpr { } public function translateFirstChild(\FluentEmogrifier\Vendor\Symfony\Component\CssSelector\XPath\XPathExpr $xpath): \FluentEmogrifier\Vendor\Symfony\Component\CssSelector\XPath\XPathExpr { } public function translateLastChild(\FluentEmogrifier\Vendor\Symfony\Component\CssSelector\XPath\XPathExpr $xpath): \FluentEmogrifier\Vendor\Symfony\Component\CssSelector\XPath\XPathExpr { } /** * @throws \FluentEmogrifier\Vendor\Symfony\Component\CssSelector\Exception\ExpressionErrorException */ public function translateFirstOfType(\FluentEmogrifier\Vendor\Symfony\Component\CssSelector\XPath\XPathExpr $xpath): \FluentEmogrifier\Vendor\Symfony\Component\CssSelector\XPath\XPathExpr { } /** * @throws \FluentEmogrifier\Vendor\Symfony\Component\CssSelector\Exception\ExpressionErrorException */ public function translateLastOfType(\FluentEmogrifier\Vendor\Symfony\Component\CssSelector\XPath\XPathExpr $xpath): \FluentEmogrifier\Vendor\Symfony\Component\CssSelector\XPath\XPathExpr { } public function translateOnlyChild(\FluentEmogrifier\Vendor\Symfony\Component\CssSelector\XPath\XPathExpr $xpath): \FluentEmogrifier\Vendor\Symfony\Component\CssSelector\XPath\XPathExpr { } public function translateOnlyOfType(\FluentEmogrifier\Vendor\Symfony\Component\CssSelector\XPath\XPathExpr $xpath): \FluentEmogrifier\Vendor\Symfony\Component\CssSelector\XPath\XPathExpr { } public function translateEmpty(\FluentEmogrifier\Vendor\Symfony\Component\CssSelector\XPath\XPathExpr $xpath): \FluentEmogrifier\Vendor\Symfony\Component\CssSelector\XPath\XPathExpr { } /** * {@inheritdoc} */ public function getName(): string { } } } namespace FluentEmogrifier\Vendor\Symfony\Component\CssSelector\XPath { /** * XPath expression translator interface. * * This component is a port of the Python cssselect library, * which is copyright Ian Bicking, @see https://github.com/SimonSapin/cssselect. * * @author Jean-François Simon * * @internal */ interface TranslatorInterface { /** * Translates a CSS selector to an XPath expression. */ public function cssToXPath(string $cssExpr, string $prefix = 'descendant-or-self::'): string; /** * Translates a parsed selector node to an XPath expression. */ public function selectorToXPath(\FluentEmogrifier\Vendor\Symfony\Component\CssSelector\Node\SelectorNode $selector, string $prefix = 'descendant-or-self::'): string; } /** * XPath expression translator interface. * * This component is a port of the Python cssselect library, * which is copyright Ian Bicking, @see https://github.com/SimonSapin/cssselect. * * @author Jean-François Simon * * @internal */ class Translator implements \FluentEmogrifier\Vendor\Symfony\Component\CssSelector\XPath\TranslatorInterface { private $mainParser; /** * @var \FluentEmogrifier\Vendor\Symfony\Component\CssSelector\Parser\ParserInterface[] */ private $shortcutParsers = []; /** * @var Extension\ExtensionInterface[] */ private $extensions = []; private $nodeTranslators = []; private $combinationTranslators = []; private $functionTranslators = []; private $pseudoClassTranslators = []; private $attributeMatchingTranslators = []; public function __construct(?\FluentEmogrifier\Vendor\Symfony\Component\CssSelector\Parser\ParserInterface $parser = null) { } public static function getXpathLiteral(string $element): string { } /** * {@inheritdoc} */ public function cssToXPath(string $cssExpr, string $prefix = 'descendant-or-self::'): string { } /** * {@inheritdoc} */ public function selectorToXPath(\FluentEmogrifier\Vendor\Symfony\Component\CssSelector\Node\SelectorNode $selector, string $prefix = 'descendant-or-self::'): string { } /** * @return $this */ public function registerExtension(\FluentEmogrifier\Vendor\Symfony\Component\CssSelector\XPath\Extension\ExtensionInterface $extension): self { } /** * @throws \FluentEmogrifier\Vendor\Symfony\Component\CssSelector\Exception\ExpressionErrorException */ public function getExtension(string $name): \FluentEmogrifier\Vendor\Symfony\Component\CssSelector\XPath\Extension\ExtensionInterface { } /** * @return $this */ public function registerParserShortcut(\FluentEmogrifier\Vendor\Symfony\Component\CssSelector\Parser\ParserInterface $shortcut): self { } /** * @throws \FluentEmogrifier\Vendor\Symfony\Component\CssSelector\Exception\ExpressionErrorException */ public function nodeToXPath(\FluentEmogrifier\Vendor\Symfony\Component\CssSelector\Node\NodeInterface $node): \FluentEmogrifier\Vendor\Symfony\Component\CssSelector\XPath\XPathExpr { } /** * @throws \FluentEmogrifier\Vendor\Symfony\Component\CssSelector\Exception\ExpressionErrorException */ public function addCombination(string $combiner, \FluentEmogrifier\Vendor\Symfony\Component\CssSelector\Node\NodeInterface $xpath, \FluentEmogrifier\Vendor\Symfony\Component\CssSelector\Node\NodeInterface $combinedXpath): \FluentEmogrifier\Vendor\Symfony\Component\CssSelector\XPath\XPathExpr { } /** * @throws \FluentEmogrifier\Vendor\Symfony\Component\CssSelector\Exception\ExpressionErrorException */ public function addFunction(\FluentEmogrifier\Vendor\Symfony\Component\CssSelector\XPath\XPathExpr $xpath, \FluentEmogrifier\Vendor\Symfony\Component\CssSelector\Node\FunctionNode $function): \FluentEmogrifier\Vendor\Symfony\Component\CssSelector\XPath\XPathExpr { } /** * @throws \FluentEmogrifier\Vendor\Symfony\Component\CssSelector\Exception\ExpressionErrorException */ public function addPseudoClass(\FluentEmogrifier\Vendor\Symfony\Component\CssSelector\XPath\XPathExpr $xpath, string $pseudoClass): \FluentEmogrifier\Vendor\Symfony\Component\CssSelector\XPath\XPathExpr { } /** * @throws \FluentEmogrifier\Vendor\Symfony\Component\CssSelector\Exception\ExpressionErrorException */ public function addAttributeMatching(\FluentEmogrifier\Vendor\Symfony\Component\CssSelector\XPath\XPathExpr $xpath, string $operator, string $attribute, ?string $value): \FluentEmogrifier\Vendor\Symfony\Component\CssSelector\XPath\XPathExpr { } /** * @return \FluentEmogrifier\Vendor\Symfony\Component\CssSelector\Node\SelectorNode[] */ private function parseSelectors(string $css): array { } } /** * XPath expression translator interface. * * This component is a port of the Python cssselect library, * which is copyright Ian Bicking, @see https://github.com/SimonSapin/cssselect. * * @author Jean-François Simon * * @internal */ class XPathExpr { private $path; private $element; private $condition; public function __construct(string $path = '', string $element = '*', string $condition = '', bool $starPrefix = false) { } public function getElement(): string { } /** * @return $this */ public function addCondition(string $condition): self { } public function getCondition(): string { } /** * @return $this */ public function addNameTest(): self { } /** * @return $this */ public function addStarPrefix(): self { } /** * Joins another XPathExpr with a combiner. * * @return $this */ public function join(string $combiner, self $expr): self { } public function __toString(): string { } } } namespace FluentEmogrifier\Vendor\TijsVerkoyen\CssToInlineStyles\Css { class Processor { public function getRules($css, $existingRules = array()) { } public function getCssFromStyleTags($html) { } private function doCleanup($css) { } } } namespace FluentEmogrifier\Vendor\TijsVerkoyen\CssToInlineStyles\Css\Property { class Processor { public function splitIntoSeparateProperties($propertiesString) { } private function cleanup($string) { } public function convertToObject($property, ?\FluentEmogrifier\Vendor\Symfony\Component\CssSelector\Node\Specificity $specificity = null) { } public function convertArrayToObjects(array $properties, ?\FluentEmogrifier\Vendor\Symfony\Component\CssSelector\Node\Specificity $specificity = null) { } public function buildPropertiesString(array $properties) { } } final class Property { private $name; private $value; private $originalSpecificity; public function __construct($name, $value, ?\FluentEmogrifier\Vendor\Symfony\Component\CssSelector\Node\Specificity $specificity = null) { } public function getName() { } public function getValue() { } public function getOriginalSpecificity() { } public function isImportant() { } public function toString() { } } } namespace FluentEmogrifier\Vendor\TijsVerkoyen\CssToInlineStyles\Css\Rule { class Processor { public function splitIntoSeparateRules($rulesString) { } private function cleanup($string) { } public function convertToObjects($rule, $originalOrder) { } public function calculateSpecificityBasedOnASelector($selector) { } public function convertArrayToObjects(array $rules, array $objects = array()) { } public static function sortOnSpecificity(\FluentEmogrifier\Vendor\TijsVerkoyen\CssToInlineStyles\Css\Rule\Rule $e1, \FluentEmogrifier\Vendor\TijsVerkoyen\CssToInlineStyles\Css\Rule\Rule $e2) { } } final class Rule { private $selector; private $properties; private $specificity; private $order; public function __construct($selector, array $properties, \FluentEmogrifier\Vendor\Symfony\Component\CssSelector\Node\Specificity $specificity, $order) { } public function getSelector() { } public function getProperties() { } public function getSpecificity() { } public function getOrder() { } } } namespace FluentEmogrifier\Vendor\TijsVerkoyen\CssToInlineStyles { class CssToInlineStyles { private $cssConverter; public function __construct() { } public function convert($html, $css = null) { } public function inlineCssOnElement(\DOMElement $element, array $properties) { } public function getInlineStyles(\DOMElement $element) { } protected function createDomDocumentFromHtml($html) { } protected function getHtmlFromDocument(\DOMDocument $document) { } protected function inline(\DOMDocument $document, array $rules) { } private function calculatePropertiesToBeApplied(array $properties, array $cssProperties): array { } } } namespace FluentCart\App\Services\Localization { class LocalizationManager { private static ?\FluentCart\App\Services\Localization\LocalizationManager $instance = null; static ?array $countries = null; static ?array $timeZones = null; static ?array $continents = null; static ?array $taxContinents = null; static ?array $locale = null; static ?array $addressLocales = null; static ?array $phones = null; static ?array $states = null; static ?array $units = null; private static ?\FluentCart\App\Services\Localization\PostcodeVerification $postcodeInstance = null; /** * Get the singleton instance */ public static function getInstance(): \FluentCart\App\Services\Localization\LocalizationManager { } /** * Get all countries */ public function countries(): array { } public function getCountryNameByCode($countryCode) { } /** * Get all timezones */ public function timezones(): array { } /** * Get all continents */ public function continents($countryCode = null): array { } /** * Get all continents */ public function taxContinents($countryCode = null): array { } /** * Get all phone codes */ public function phones(): array { } /** * Get all locale information */ public function locales($countryCode = null): array { } public function addressLocales($countryCode = null): array { } /** * Get all states/provinces */ public function states($countryCode = null): array { } public function getStateNameByCode($stateCode, $countryCode = null) { } /** * Get all measurement units */ public function units(): array { } /** * Convert array to options format */ private function toOptions(array $items, bool $includeCountries = false): array { } /** * Get country ISO lists */ public function countryIsoList(): array { } /** * Get countries as options */ public function countriesOptions(): array { } /** * Get phone codes as options */ public function phonesOptions(): array { } /** * Get continents as options */ public function continentsOptions(): array { } public function continentsCountries(string $continentCode): array { } public function continentsCountriesOptions(string $continentCode): array { } public function timeZonesOptions(): array { } public function localesOptions(): array { } public function statesOptions($countryCode = null): array { } /** * Guess country code from timezone */ public function guessCountryTimezone(string $timezone): ?string { } /** * Get continent code for a country */ public function continentFromCountry(string $countryCode): string { } /** * Check whether a country is part of the EU VAT country list. */ public function isEuTaxCountry(string $countryCode): bool { } /** * Get calling code for a country */ public function callingCode(string $countryCode): string { } /** * Get locale for a country */ public function localeForCountry(string $countryCode): string { } /** * Get states for a country */ public function countryStates(string $countryCode): array { } /** * Get states for a country as options */ public function countryStatesOptions(string $countryCode): array { } // Static proxy methods for backward compatibility public static function getCountries(): array { } public static function getTimeZones(): array { } public static function getContinents(): array { } public static function getPhones(): array { } public static function getLocale($countryCode = null): array { } public static function getStates(): array { } public static function getUnits(): array { } public static function getCountyIsoLists(): array { } public static function guessCountryFromTimezone(string $timezone): ?string { } public static function getCountryCallingCode($countryCode): string { } public static function getCountryStates($countryCode): array { } public static function getAddressLocales($countryCode): array { } public static function isValidCountryCode($code) { } public static function getCountryInfoFromRequest($timezone, $countryCode): array { } /** * Magic method to access properties */ public function __get($name) { } /** * Get postcode verification instance */ private function getPostcodeInstance(): \FluentCart\App\Services\Localization\PostcodeVerification { } /** * Static method to get postcode verification instance */ public static function postcode() { } public function getZipCodeValidationRule($countryCode): array { } public function getValidationRule($data, $prefix = '', $defaultRoles = []): array { } } class PostcodeVerification { public function formatPostcode($postcode, $country) { } /** * Normalize postcodes. * * Remove spaces and convert characters to uppercase. * * @param string $postcode Postcode. * @return string */ public function normalizePostcode($postcode) { } public static function fctStrtoupper($string) { } public function isValid($postcode, $country) { } public static function isGBPostcode($to_check) { } } } namespace FluentCart\App\Services { class OrderService { /** * Group address and other data from the order data array. * * @param array $order_data * @return array */ public static function groupSanitizedData($order_data = []): array { } private static function extractAddressData($data, $prefix): array { } private static function extractOtherData($data): array { } private static function finalizeAddress($address, $type): array { } /** * Sanitize email or text field based on the key. * * @param string $key * @param string $value * @return string */ public static function sanitizeEmailOrText($key, $value): string { } /** * Pluck product IDs from the order. * * @param \FluentCart\App\Models\Order $order * @return array */ public static function pluckProductIds(\FluentCart\App\Models\Order $order): array { } /** * Validate products and check if they are available by stock. * * @param array $products * @return void * @throws \Exception */ public static function validateProducts($products, $prevOrder = null) { } private static function validateProductAvailability($product, $currentVariations) { } private static function validateSubscriptionQuantity($product) { } private static function validateStockStatus($product, $currentVariations, $prevOrder = null) { } private static function validateStockQuantity($product, $currentVariations, $prevOrder = null) { } /** * Check if the item can be ordered based on stock availability. * * @param array $variation * @param int $updatedQuantity * @return bool */ private static function allowItemToOrder($variation, $updatedQuantity): bool { } /** * Get the total amount of items without discount. * * @param array $orderItems * @return float */ public static function getItemsAmountWithoutDiscount(array $orderItems) { } private static function isDiscountedSubscription($orderItem): bool { } private static function isPlanChangeAdjustment($orderItem, $paymentType): bool { } private static function calculateItemTotal($orderItem, $paymentType): float { } /** * Get the total amount of items. * * @param array|\FluentCart\App\Models\Model $items * @param bool $formatted * @param bool $withCurrency * @return float|string */ public static function getItemsAmountTotal($items = [], $formatted = true, $withCurrency = true, $shippingTotal = 0) { } private static function calculateItemAmount(array $cartItem, $price, $paymentType, $formatted, $withCurrency) { } /** * Create line items from order items. * * @param array $orderItems * @return array */ public static function makeLineItemsFromOrderItems($orderItems): array { } private static function isSubscriptionItem(array $orderItem): bool { } private static function prepareSubscriptionItem(array $orderItem): array { } private static function prepareRegularItem(array $orderItem): array { } /** * Get the root order ID from a given order. * * @param \FluentCart\App\Models\Order $order * @return id|null */ public static function getRootOrderId($order, $visited = []) { } public static function getCouponDiscountTotal($orderItems) { } public static function getNextReceiptNumber() { } public static function getInvoicePrefix() { } public static function transformSubscription(\FluentCart\App\Models\Subscription $subscription) { } /** * A system renewal order still inside its auto-charge retry window has no * Pay Now — the charge is coming automatically. Other renewals unaffected. */ protected static function renewalPayNowAllowed(\FluentCart\App\Models\Order $order): bool { } public static function transformTransaction(\FluentCart\App\Models\OrderTransaction $transaction) { } public static function canGenerateReceiptPdf(): bool { } } class OrdersQuery { private $args = []; private $model = null; public function __construct($args = []) { } private function setupQuery() { } public function get() { } public function paginate($perPage = 10) { } public function getModel() { } private function returnOrders($orders) { } private function formatAdvancedFilters() { } } } namespace FluentCart\App\Services\PDF { /** * Default block-editor PDF structures for FluentCart receipts. * * Design system (A4 Portrait) — minimal: * TEXT #111111 primary text * META #666666 labels / secondary text * BORDER #DDDDDD dividers * WHITE #FFFFFF */ class DefaultPdfStructures { private const TEXT = '#111111'; private const META = '#666666'; private const BORDER = '#DDDDDD'; private const WHITE = '#FFFFFF'; /** * Default meta for all PDF templates. */ public static function getDefaultMeta(): array { } // ── Order Receipt ──────────────────────────────────────────────────────── /** * @return array{content:string, blocks:array, meta:array} */ public static function getDefaultReceiptStructure(): array { } private static function buildReceiptBlocks(): array { } // ── Renewal Receipt ─────────────────────────────────────────────────────── /** * @return array{content:string, blocks:array, meta:array} */ public static function getDefaultRenewalReceiptStructure(): array { } private static function buildRenewalReceiptBlocks(): array { } // ── Refund Notice ───────────────────────────────────────────────────────── /** * @return array{content:string, blocks:array, meta:array} */ public static function getDefaultRefundNoticeStructure(): array { } private static function buildRefundNoticeBlocks(): array { } // ── Proforma Invoice ────────────────────────────────────────────────────── /** * @return array{content:string, blocks:array, meta:array} */ public static function getDefaultProformaInvoiceStructure(): array { } private static function buildProformaInvoiceBlocks(): array { } // ── Shared block builders ───────────────────────────────────────────────── /** * Document header: logo left, title right, bottom rule. */ private static function header(string $title): array { } /** * Two-column FROM / BILL TO address block. */ private static function addressColumns(?string $billingLabel = null): array { } /** * Key/value meta rows (order number, date, etc.). * * @param array $rows label => smartcode */ private static function metaTable(array $rows): array { } /** * Line-items table (delegated to the order variable). */ private static function itemsTable(): array { } /** * Payment summary with optional sub-rows and a bold total row. * * @param array $rows label => smartcode */ private static function summaryTable(array $rows, string $totalLabel, string $totalValue): array { } /** * Footer note, centred, small text. */ private static function footer(string $text): array { } // ── Low-level helpers ───────────────────────────────────────────────────── private static function block(string $name, array $attrs = [], ?string $content = null, array $innerBlocks = []): array { } /** * Serialize blocks array to Gutenberg block comment format. */ public static function blocksToContent(array $blocks): string { } } class PdfGeneratorService { private $workingDir = ''; private $tempDir = ''; private $pdfCacheDir = ''; private $fontDir = ''; public function __construct() { } public function getGenerator(array $mpdfConfig = []): \FluentPdf\Vendor\Mpdf\Mpdf { } public function getTempDirectory(): string { } /** * Resolve same-site image URLs in HTML to local filesystem paths for mPDF. * * @param string $html * @return string */ public function prepareHtmlForPdf(string $html): string { } /** * If $path is a PNG with an alpha channel, composite it onto a white * canvas and return a base64 JPEG data URI. * * @param string $path * @return string|null */ private function flattenPngTransparency(string $path): ?string { } } class ReceiptPdfTemplateService { protected $metaKey = 'receipt_pdf_templates'; /** * Get all built-in default templates. */ public function getDefaultTemplates(): array { } /** * Get saved templates, migrating from old format if needed. */ public function getTemplates(): array { } /** * Migrate from old single 'default' template to new multi-template format. */ private function migrateOldFormat(array $saved): array { } /** * Update a template by key. */ public function updateTemplate(string $key, array $template): bool { } /** * Save the PDF structure for a specific template. */ public function setTemplateProperties(array $data, string $templateId = 'order_receipt'): bool { } /** * Create a new custom template. * * @return string The generated template slug */ public function createTemplate(string $title): string { } /** * Delete a custom template. Built-in templates cannot be deleted. */ public function deleteTemplate(string $key): bool { } /** * Get the factory default template structures (ignoring saved data). */ public function getFactoryDefault(): array { } /** * Get the current PDF structure for a specific template. */ public function getPdfStructure(string $templateId = 'order_receipt'): array { } /** * Get a simplified list of templates for dropdown selection. */ public function getTemplateList(): array { } } } namespace FluentCart\App\Services\Payments { class PaymentHelper { public string $slug = ''; public function __construct($slug) { } public function listenerUrl($args = []) { } public function successUrl($uuid, $args = null) { } public static function getCustomPaymentLink($orderHash): string { } /* *This will be hooked from basePaymentMethod * validate payment method is active for checkout items, before order creation */ public static function validateAndGetPayMethod($cartCheckoutHelper, $orderData, $extraCharge = 0) { } public static function updateTransactionRefundedTotal($parentTransaction, $refundedAmount) { } // public static function updateOrderRefundedTotal($order, $refundedAmount, &$type): void // { // // update order data // $netOrderPaidAmount = $order->total_paid - $order->total_refunded; // $isFullRefund = $refundedAmount == $netOrderPaidAmount; // // if ($isFullRefund) { // $order->payment_status = Status::PAYMENT_REFUNDED; // $type = 'full'; // } else { // $order->payment_status = Status::PAYMENT_PARTIALLY_REFUNDED; // $type = 'partial'; // } // $order->total_refund += $refundedAmount; // $order->save(); // } /** * @param string $paymentMethod * @param array $paymentMethodDetails * @param array $additionalData * @return array * parse payment method details and return a common format * filter hook: 'fluent_cart/payments/parse_payment_method_details' */ public static function parsePaymentMethodDetails($paymentGateway, $paymentMethodDetails, $additionalData = []): array { } public static function getIntervalDays($interval = ''): int { } } class PaymentInstance { /** * @var \FluentCart\App\Models\Order */ public $order; public $transaction; public $subscription; public $paymentType; public function __construct(\FluentCart\App\Models\Order $order) { } public function setupData() { } public function setTransaction(\FluentCart\App\Models\OrderTransaction $transaction) { } /** * Gateway-agnostic idempotency seed for the current charge attempt. The ONLY * seed source for gateway idempotency keys — full contract in * .claude/skills/coding-rules/payment-idempotency.md. * * Stable across duplicate submissions (transaction uuid survives draft-order * re-submission -> gateway dedupes), fresh after an observed failure * (payment_attempt is bumped when a FAILED transaction is re-submitted -> * retries are never blocked or answered with a cached gateway error). * * @return string Empty string when no charge transaction exists — callers * must skip idempotency rather than share a static key. */ public function getIdempotencySeed() { } public function getExtraAddonAmount() { } public function getSubscriptionCancelAtTimeStamp() { } } class PaymentReceipt { protected $order; public function __construct($order) { } public function getItems() { } public function date($format = 'd M Y') { } public function getEmail() { } public function total() { } public function shippingCharge() { } public function subtotal() { } public function formatPriceHtml($amount, $code = null) { } public function getItemImage() { } public function __call($name, $arguments) { } public function totalDiscount($formatted = true) { } public function discount($formatted = true) { } public function proratedCredit() { } } class Refund { public function processRefund($transaction, $refundAmount, $args = []) { } public static function createOrRecordRefund($refundData, \FluentCart\App\Models\OrderTransaction $parentTransaction) { } public static function recordRefund($refundData, \FluentCart\App\Models\OrderTransaction $parentTransaction) { } } class SubscriptionHelper { /* * @param $subscriptionModel * @return string|null * * */ public static function getNextBillingDate(\FluentCart\App\Models\Subscription $subscriptionModel) { } /* * @param $trialDays * @param $billTimes * @param $interval * * */ public static function getSubscriptionCancelAtTimeStamp($trialDays, $billTimes, $interval) { } // can be used to catch 1 day trial loop-hole public static function checkTrailDaysLoopHole($subscription, $trialDays) { } /** * Safely convert a date string or Unix timestamp to a GMT datetime string. * Returns null when the value is falsy, zero, or a negative timestamp * (guards against strtotime() returning false or a year-0 negative value). * * @param string|int|null $value * @return string|null */ public static function safeTimestampToDatetime($value): ?string { } public static function getSubscriptionsGracePeriodDays() { } /** * Grace period (days past due before expiry) for a billing interval, resolved * from the per-interval grace map. Defaults to 7 for unknown intervals. */ public static function getGracePeriodDaysForInterval(string $interval): int { } } } namespace FluentCart\App\Services\Permission { class PermissionManager { static $metaKey = '_fluent_cart_admin_role'; public const ADMIN_CAP = 'fluent_cart_admin'; public static function getAllRoles(): array { } public static function getUserPermissions($userId = false) { } public static function hasPermission($permissions, $userId = false): bool { } public static function hasAnyPermission(array $permissions, $userId = false): bool { } public static function getShopRole($userId) { } public static function getAllPermissions(): array { } /** * Get all users that have a FluentCart admin role assigned * * @return array */ public static function getUsersWithShopRole(): array { } public static function attachRole($userId, $role) { } public static function detachRole($userId, $role) { } public static function userCan($permission): bool { } } } namespace FluentCart\App\Services { class PlanUpgradeService { static string $metaType = 'variant_upgrade'; static string $metaKey = 'variant_upgrade_path'; public static function getUpgradeSettings($productId, $variantId = null) { } public static function getAvailableUpgradePaths($variantId, $metaValue) { } public static function saveUpgradeSetting($settings) { } public static function updateUpgradeSetting($id, $settings) { } public static function validateUpgradePaths($paths) { } public static function getUpgardePathsFromVariation($variationId, $orderHash) { } public static function calculateUpgradeToDiscount(\FluentCart\App\Models\Order $order, \FluentCart\App\Models\OrderItem $originalItem) { } /** * Unrefunded amount the customer actually paid for an order item, tax included (cents). * * Exclusive tax was added on top of line_total, so it is added back here. Inclusive * tax is already part of line_total and must not be double-counted. * * Refunds are allocated against line_total (see Order::updateRefundedItems), so the * exclusive tax is scaled to the unrefunded fraction of the line — otherwise a * refunded line would still contribute its tax_amount to the upgrade credit. */ private static function itemUnrefundedPaidWithTax(\FluentCart\App\Models\OrderItem $item) { } } } namespace FluentCart\App\Services\PluginInstaller { class AddonManager { public function installAddon($sourceType, $sourceLink, $pluginSlug, $path = 'zipball_url') { } public function activateAddon($pluginFile) { } public static function getAddonStatus($pluginSlug, $pluginFile) { } /** * Check for updates based on source type * * @param string $sourceType Source type (github, wordpress, other) * @param string $sourceLink Source URL (for github, other sources) * @param string $pluginFile Plugin file path * @param string $pluginSlug Plugin slug (for wordpress) * @return array|\WP_Error */ public function checkForUpdate($sourceType, $sourceLink, $pluginFile, $pluginSlug = '') { } /** * Check for updates from GitHub * * @param string $sourceLink releases/latest URL * @param string $currentVersion Current plugin version * @return array|\WP_Error */ private function checkUpdateFromGitHub($sourceLink, $currentVersion) { } /** * Check for updates from WordPress.org * * @param string $pluginFile Plugin file path * @param string $currentVersion Current plugin version * @return array|\WP_Error */ private function checkUpdateFromWordPress($pluginFile, $currentVersion) { } /** * Check for updates from other sources (placeholder) * * @param string $sourceType Source type * @param string $sourceLink Source link * @param string $currentVersion Current plugin version * @return array|\WP_Error */ private function checkUpdateFromOther($sourceType, $sourceLink, $currentVersion) { } /** * Get latest version info from GitHub * * @param string $releasesUrl GitHub releases URL * @return array|\WP_Error */ private function getLatestGitHubVersion($releasesUrl) { } /** * Update addon from WordPress.org * * @param string $pluginFile Plugin file path * @return bool|\WP_Error */ private function updateFromWordPress($pluginFile) { } /** * Update addon from other sources (placeholder) * * @param string $sourceType Source type * @return \WP_Error */ private function updateFromOther($sourceType) { } } class BackgroundInstaller { public function installPlugin($pluginSlug) { } private function backgroundInstaller($plugin_to_install) { } public function installFromCdn($cdnUrl, $pluginSlug) { } public function installFromGithub($githubUrl, $pluginSlug, $path = 'zipball_url') { } } class PaymentAddonManager extends \FluentCart\App\Services\PluginInstaller\AddonManager { } } namespace FluentCart\App\Services { class PrintService { public static function invoice($order) { } public static function packingSlip($order) { } public static function deliverySlip($order) { } public static function shippingSlip($order) { } public static function dispatchSlip($order) { } public static function print($key, $orderId) { } } class ProductItemService { /** * Return product and variation item (custom or normal) * * @param array $data * @return object|null */ public static function getItem(array $data) { } } class RateLimiter { public static function isActive() { } /** * Checks if the action identified by $identifier is being spammed. This will only work if an external object cache is enabled. * Usage: FluentCart\App\Services\RateLimiter::isSpamming('checkout_attempt', 5, 60); // allows 5 attempts per 60 seconds * * @param $identifier string A unique identifier for the action being rate limited. For example: checkout_attempt * @param $limit Number of allowed attempts within the time window * @param $seconds integer Time window in seconds * @param $sendJson boolean Whether to send a JSON response when rate limit is exceeded * @return bool */ public static function isSpamming($identifier, $limit = 10, $seconds = 30, $sendJson = false) { } private static function getCurrentHits($identifier) { } private static function setHits($identifier, $hits, $seconds) { } } } namespace FluentCart\App\Services\Reminders { class ReminderService { const DEFAULT_SCAN_BATCH_SIZE = 100; const MIN_SCAN_BATCH_SIZE = 10; const MAX_SCAN_BATCH_SIZE = 500; protected \FluentCart\Api\StoreSettings $storeSettings; public function __construct() { } public function runHourlyScan(): array { } protected function isRemindersEnabled(): bool { } /** * Get reminder permissions for a subscription (used by detail API). */ public function getSubscriptionReminderPermissions(\FluentCart\App\Models\Subscription $subscription): array { } /** * Check if a payment reminder can be sent for an order (used by detail API). */ public function canSendPaymentReminder(array $orderData): bool { } /** * Check if at least one notification for the given event is active. */ protected function isNotificationEnabled(string $event): bool { } /** * Send a manual reminder for a specific order or subscription. * * @param string $event The reminder event hook (renewal_reminder_overdue, subscription_renewal_reminder, subscription_trial_end_reminder) * @param int $entityId The order ID or subscription ID * @return array{success: bool, message: string} */ public function sendManualReminder(string $event, int $entityId): array { } protected function sendRenewalOrderReminder(int $orderId): array { } protected function sendManualRenewalReminder(int $subscriptionId): array { } protected function sendManualTrialReminder(int $subscriptionId): array { } /* |-------------------------------------------------------------------------- | Shared Utilities |-------------------------------------------------------------------------- */ protected function getScanBatchSize(): int { } protected function isRuntimeExpired(int $startedAt, int $maxRuntime): bool { } protected function parseDayList($values, array $defaults, int $minimum, int $maximum = 365): array { } /* |-------------------------------------------------------------------------- | Reminder State Management |-------------------------------------------------------------------------- */ protected function normalizeReminderState($state): array { } protected function isStageAlreadySent(array $state, string $cycleKey, string $stage): bool { } protected function isStageQueuedRecently(array $state, string $cycleKey, string $stage): bool { } protected function markStageQueued(array $state, string $cycleKey, string $stage): array { } protected function markStageSent(array $state, string $cycleKey, string $stage): array { } protected function clearStageQueue(array $state, string $cycleKey, string $stage): array { } protected function getCycleState(array $state, string $cycleKey): array { } protected function setCycleState(array $state, string $cycleKey, array $cycleState): array { } } class RenewalReminderService extends \FluentCart\App\Services\Reminders\ReminderService { const META_KEY = 'renewal_reminder_state'; const ASYNC_HOOK = 'fluent_cart/reminders/send_renewal'; protected array $orderMetaCache = []; public function isEnabled(): bool { } public function send($orderId, $stage, $cycleKey): bool { } public function clearState(\FluentCart\App\Models\Order $order): void { } public function queueActions($startedAt, $maxRuntime): int { } /* |-------------------------------------------------------------------------- | Queueing |-------------------------------------------------------------------------- */ protected function queueForOrder(\FluentCart\App\Models\Order $order): int { } protected function queueStage(\FluentCart\App\Models\Order $order, string $stage, string $cycleKey): bool { } /* |-------------------------------------------------------------------------- | Meta Cache |-------------------------------------------------------------------------- */ protected function preloadMeta(array $orderIds): void { } protected function getCachedMeta(\FluentCart\App\Models\Order $order): array { } protected function saveMeta(\FluentCart\App\Models\Order $order, array $state): void { } /* |-------------------------------------------------------------------------- | Settings |-------------------------------------------------------------------------- */ protected function getDueDays(): int { } protected function getOverdueDays(): array { } /** * Canonical reminder-eligible payment statuses — shared by the hourly scan, * manual "send now", and the admin UI's button-visibility gate (see * ReminderService::sendManualRenewalReminder / canSendPaymentReminder). * authorized and partially_paid are excluded: both reflect payment already * in progress, so a "you owe money" reminder would be misleading. */ public static function getReminderPaymentStatuses(): array { } /* |-------------------------------------------------------------------------- | Eligibility & Helpers |-------------------------------------------------------------------------- */ protected function isEligible(\FluentCart\App\Models\Order $order): bool { } protected function getDueTimestamp(\FluentCart\App\Models\Order $order): int { } protected function getScanCutoffDate(): string { } protected function getCycleKey(\FluentCart\App\Models\Order $order, int $dueAt): string { } protected function getOutstandingAmount(\FluentCart\App\Models\Order $order): int { } protected function getOrderReference(\FluentCart\App\Models\Order $order): string { } protected function resolveEventName(string $stage): string { } } class SubscriptionReminderService extends \FluentCart\App\Services\Reminders\ReminderService { const RENEWAL_META_KEY = 'renewal_reminder_state'; const TRIAL_META_KEY = 'trial_reminder_state'; const RENEWAL_ASYNC_HOOK = 'fluent_cart/reminders/send_subscription_renewal'; const TRIAL_ASYNC_HOOK = 'fluent_cart/reminders/send_trial_end'; protected array $subscriptionMetaCache = []; protected array $trialMetaCache = []; public function isEnabled(): bool { } /* |-------------------------------------------------------------------------- | Sending |-------------------------------------------------------------------------- */ public function sendRenewal($subscriptionId, $stage, $cycleKey): bool { } public function sendTrial($subscriptionId, $stage, $cycleKey): bool { } protected function sendTrialEndReminder(\FluentCart\App\Models\Subscription $subscription, string $stage, string $cycleKey, array $state): bool { } public function clearState(\FluentCart\App\Models\Subscription $subscription): void { } /* |-------------------------------------------------------------------------- | Scanning & Queueing |-------------------------------------------------------------------------- */ public function queueActions($startedAt, $maxRuntime): array { } protected function queueForSubscription(\FluentCart\App\Models\Subscription $subscription): int { } protected function queueTrialEndReminder(\FluentCart\App\Models\Subscription $subscription): int { } protected function queueRenewalStage(\FluentCart\App\Models\Subscription $subscription, string $stage, string $cycleKey): bool { } protected function queueTrialStage(\FluentCart\App\Models\Subscription $subscription, string $stage, string $cycleKey): bool { } /* |-------------------------------------------------------------------------- | Meta Cache |-------------------------------------------------------------------------- */ protected function preloadRenewalMeta(array $subscriptionIds): void { } protected function preloadTrialMeta(array $subscriptionIds): void { } protected function getCachedRenewalMeta(\FluentCart\App\Models\Subscription $subscription): array { } protected function getCachedTrialMeta(\FluentCart\App\Models\Subscription $subscription): array { } protected function saveRenewalMeta(\FluentCart\App\Models\Subscription $subscription, array $state): void { } protected function saveTrialMeta(\FluentCart\App\Models\Subscription $subscription, array $state): void { } /* |-------------------------------------------------------------------------- | Settings |-------------------------------------------------------------------------- */ protected function getRenewalDays(\FluentCart\App\Models\Subscription $subscription): array { } protected function getBillingCycle(\FluentCart\App\Models\Subscription $subscription): string { } protected function isBillingCycleEnabled(string $cycle): bool { } protected function getYearlyRenewalDays(): array { } protected function getMonthlyRenewalDays(): array { } protected function getQuarterlyRenewalDays(): array { } protected function getHalfYearlyRenewalDays(): array { } protected function getTrialEndReminderDays(): array { } protected function isTrialEndRemindersEnabled(): bool { } protected function getReminderStatuses(): array { } /* |-------------------------------------------------------------------------- | Eligibility & Helpers |-------------------------------------------------------------------------- */ protected function isEligible(\FluentCart\App\Models\Subscription $subscription): bool { } protected function isTrialSubscription(\FluentCart\App\Models\Subscription $subscription): bool { } protected function getBillingTimestamp(\FluentCart\App\Models\Subscription $subscription): int { } protected function getCycleKey(\FluentCart\App\Models\Subscription $subscription, int $billingAt): string { } } } namespace FluentCart\App\Services\Renderer { class AddressSelectRenderer { public string $address_type = 'billing'; public string $title = ''; public array $addresses = []; public array $countries = []; public array $primary_address = []; public string $value = ''; public array $requirements_fields = []; public function __construct($addresses, $primary_address, $requirements_fields, $address_type) { } public function render() { } public function renderAddressInfo() { } public function renderAddressModal() { } public function renderAddressModalFooter() { } public function renderAddressSelector() { } public function renderAddAddressForm() { } public function renderNameFields() { } public function renderBusinessDetailsFields() { } } class AdvancedVariationRenderer { protected $product; public function __construct($product) { } /** * Whitelist a term's stored color before it lands in an inline * `style="background-color: ..."` attribute. esc_attr escapes HTML * attribute chars but NOT CSS syntax — a stored value saved through * sanitize_text_field (which never validated color format) like * "red;position:fixed;inset:0;z-index:9999" would otherwise inject * extra CSS declarations and deface the product page. Accept only * hex (#rgb/#rgba/#rrggbb/#rrggbbaa), rgb()/rgba() with numeric * content, or a bare CSS named color; anything else returns '' and * the caller drops the style attribute entirely. */ protected function safeCssColor($color): string { } /** * Emits the storefront selector markup. Returns true only when markup * was actually echoed — false on every early bail. The caller writes * this into the filter's 'rendered' flag so free core can fall through * to its simple-variation rendering when this renderer no-ops (e.g. a * product switched to advanced_variations before attributes are built). */ public function render($selectorStyle = 'auto'): bool { } protected function renderAttributeDropdown($group, $terms) { } protected function renderColorDropdown($group, $terms) { } protected function renderImageDropdown($group, $terms) { } protected function renderAttributeSwatches($group, $terms) { } } class CartDrawerRenderer { protected $cartItems; protected $storeSettings; protected $itemCount = 0; protected $cartRenderer = null; protected $defaultOpenCart = false; protected $isAdminBarEnabled = false; public function __construct($cartItems, $config = []) { } public function render() { } public function renderCartLoader() { } public function renderHeader() { } public function renderCartIconButton($skipIfLoaded = true) { } public function renderFooter() { } public function renderItemCount() { } } class CartItemRenderer { protected $item = []; protected $cart = null; protected $product = null; protected $variant = null; public function __construct($item = [], ?\FluentCart\App\Models\Cart $cart = null) { } protected function getEventInfo() { } public function render() { } public function renderTitle() { } public function renderImage() { } protected function renderCssAtts($atts) { } protected function maybeRenderPaymentTypeInfo() { } protected function maybeRenderSetupFeeInfo() { } protected function renderSetupFeeInfo() { } protected function maybeRenderPackageInfo() { } public function renderChildVariants() { } } class CartRenderer { protected $cartItems; protected $storeSettings; protected $currentCartItem = []; protected $url = []; protected $product = []; public function __construct($cartItems = []) { } public function render() { } public function renderItems() { } public function renderDummyItems() { } public function renderList($items = []) { } public function renderItem() { } public function renderImage() { } protected function getEventInfo() { } public function renderDetails() { } public function renderTitles() { } public function renderItemPrice() { } public function renderQuantity() { } public function renderSummary() { } public function renderItemTotal() { } public function renderTotal() { } public function renderRemove() { } public function renderCheckoutButton() { } public function renderViewCartButton() { } public function renderEmptyCartIcon() { } public function renderEmpty($emptyMessage = null, $continueShoppingUrl = null, $continueShoppingLabel = null, $continueShoppingAriaLabel = null) { } public function renderEmptyCart($emptyMessage = null, $continueShoppingUrl = null, $continueShoppingLabel = null, $continueShoppingAriaLabel = null) { } } class CartSummaryRender { protected $cart; public function __construct(\FluentCart\App\Models\Cart $cart) { } public function render($withWrapper = true) { } public function renderOrderSummarySectionHeading() { } public function renderItemsLists() { } public function renderItemsFooter() { } public function renderSubtotal($atts = '') { } public function renderShipping($atts = '') { } public function renderFees() { } public function renderTotal($atts = '') { } public function maybeShowCustomCartSummaries() { } public function renderDiscountDetailRow() { } public function renderShippingDetailRow() { } public function showCouponApplied() { } public function showManualDiscount($atts = '') { } public function showUpgradeDiscount($atts = '') { } public function showProrateCredit($atts = '') { } public function showCouponField() { } } class CheckoutFieldsSchema { /** * Per-request memo for getFieldsSettings(). In production every HTTP * request runs in a fresh PHP process, so this lives exactly one request. * Long-running processes that simulate multiple requests (test suites, * CLI) must clear it between simulated requests via * resetFieldsCache() — as a function-static it was * unreachable and leaked the first request's field settings into every * subsequent one. */ private static $fieldsCache = null; public static function resetFieldsCache(): void { } public static function titleMap(): array { } public static function typeMap(): array { } private static function autocompleteMap(): array { } public static function getNameEmailFieldsSchema($cart = null, $scope = 'render') { } public static function getAddressBaseFields($config, $scope = 'render') { } private static function getRequirementType($config, $key) { } public static function getCheckoutFieldsRequirements($addressType = 'billing', $productType = 'digital', $withShipping = false) { } public static function getFieldsSchemaConfig() { } public static function getFieldsSettings() { } public static function isTermsRequired(): bool { } public static function isTermsVisible(): bool { } public static function getTermsText() { } public static function isFirstNameEnabled(): bool { } public static function isLastNameEnabled(): bool { } public static function isLastNameRequired(): bool { } public static function isFullNameRequired(): bool { } public static function isVatNumberEnabled(): bool { } public static function isCompanyNameEnabled(): bool { } public static function isCompanyNameRequired(): bool { } public static function isVatNumberRequired(): bool { } public static function isLegalRegistrationIdEnabled(): bool { } public static function isLegalRegistrationIdRequired(): bool { } public static function isB2BOnlyMode(): bool { } public static function hasAnyBusinessFields(): bool { } } class CheckoutRenderer { private $cart; private $requireShipping; private $hasSubscription = false; private $config = []; private $billingAddress = []; private $shippingAddress = []; private $storeSettings; public function __construct(\FluentCart\App\Models\Cart $cart, $config = []) { } public function render($config = []) { } public function getFragment($fragmentName) { } public function wrapperStart() { } public function renderNotices() { } public function renderCheckoutForm() { } public function wrapperEnd() { } public function renderCreateAccountField($atts = []) { } public function renderNameFields() { } public function renderB2BToggle() { } public function renderBusinessDetailsSection($isVisible) { } public function validateAddressField($config, $fields) { } public function renderAddressFields() { } public function renderBillingAddressFields($section_title = '') { } public function renderShipToDifferentField($atts = []) { } public function renderShippingAddressFields($section_title = '') { } public function renderOrderNoteField($attr_title = '') { } public function renderShippingOptions() { } /** * Get available shipping methods considering cart's shipping classes. * This is used by the frontend to display profile-aware methods. */ public function getProfileAwareShippingMethods($countryCode, $stateCode) { } public function renderPaymentMethods($atts = []) { } public function renderCheckoutButton($atts = '') { } protected function renderPaymentMethod($method, $config = []) { } private function maybeRearrangeAddressFields($fields) { } public function agreeTerms($atts = []) { } private function renderSummaryFragment() { } } class CustomerDashboardButtonRenderer { public function render(array $atts = []): void { } protected function renderButton($atts = []): void { } protected function getUserIcon(): string { } protected function renderAttributes($atts = []): void { } } class FormFieldRenderer { public function renderField($fieldData = []) { } public function renderAddressSelect($fieldData = []) { } public function renderSection($sectionData = []) { } private function renderSingleLineInputField($fieldData) { } private function renderTextareaField($fieldData) { } private function renderCheckboxInputField($fieldData) { } private function renderSelectField($fieldData) { } } class MiniCartRenderer { protected $cartItems; protected $itemCount = 0; protected $countMode = 'distinct_products'; public function __construct($cartItems, $config = []) { } public function renderMiniCart($atts = []) { } public function renderCartIcon(string $cartIcon = 'cart') { } public function renderShoppingCartIcon() { } public function renderShoppingBagIcon() { } public function renderShoppingBagAltIcon() { } } class ModalCheckoutRenderer { private $cart; private $requireShipping; private $hasSubscription = false; private $config = []; private $storeSettings; private $productMeta; private $matchedVariation; private $checkoutRenderer; private $cartSummaryRenderer; private $customer; public function __construct(\FluentCart\App\Models\Cart $cart, $config = []) { } public function getFragment($fragmentName) { } public function render() { } public function renderIframe() { } public function renderForm() { } private function maybePopulateFormDataFromCustomer() { } public function renderCheckoutDetails() { } public function renderCheckoutSummary() { } public function renderPaymentTypeInfo() { } public function renderPromoCode() { } public function renderSummaryGroup() { } public function showCouponApplied() { } public function renderCheckoutReviews() { } public function renderCheckoutBilling() { } public function renderPaymentMethods() { } public function renderPaymentMethod($method, $config = []) { } public function renderPaymentMethodContent($method, $config = []) { } } class PackageDescriptionRenderer { protected $product; public function __construct(\FluentCart\App\Models\Product $product) { } /** * Build package info string from snapshotted other_info fields. * * @param array $otherInfo Order item's other_info array * @return string e.g. "Gift (Box) · 30 × 20 × 15 cm · Wt: 2 kg · Shipping: 2.5 kg" */ public static function buildPackageInfoFromOtherInfo($otherInfo) { } public function renderPackageDescription($wrapper_attributes = '', $showName = true, $showDimensions = true, $showProductWeight = true, $showTotalWeight = true, $variant = null, $defaultVariant = null) { } /** * Query-free default-variant resolution mirroring ProductRenderer's * constructor logic, so package-description rendering doesn't need to * construct the heavyweight ProductRenderer just to know which variant * should render visible initially. */ private function resolveDefaultVariant() { } private function renderPackageDescriptionForVariant(\FluentCart\App\Models\ProductVariation $variant, $wrapper_attributes, $showName, $showDimensions, $showProductWeight, $showTotalWeight) { } } class PricingTableRenderer { protected $viewData; protected $variants; protected $storeSettings; protected $sign; protected $repeatInterval = null; protected $itemPrice = null; protected $comparePrice = null; protected $paymentInfo = ''; protected $setupFeeInfo = ''; protected $featureItems = []; protected $showCartButton = 1; protected $paymentType = ''; protected $licenseEnable = 'no'; protected $productPerRow = 4; public function __construct($viewData) { } public function render() { } protected function groupVariants(string $groupBy): array { } protected function renderTabs(array $groups) { } protected function getTabLabel(string $key): string { } protected function isVariantActive($variant): bool { } public function renderVariant(?array $variants = null) { } public function renderFeatureItems() { } public function renderCartButton($variant) { } public function renderOutOfStockButton() { } public function renderDirectCheckoutButton($variant) { } private static function stringToAssocArray($string): array { } } class ProductCardRender { protected $product; protected $viewUrl = ''; protected $config = []; public function __construct(\FluentCart\App\Models\Product $product, $config = []) { } public function renderWrapperStart() { } public function renderWrapperEnd() { } public function render() { } /** * @deprecated Use PackageDescriptionRenderer::buildPackageInfoFromOtherInfo() directly. * Kept as a compatibility shim for external callers (themes, extensions). * * @param array $otherInfo Order item's other_info array * @return string e.g. "Gift (Box) · 30 × 20 × 15 cm · Wt: 2 kg · Shipping: 2.5 kg" */ public static function buildPackageInfoFromOtherInfo($otherInfo) { } /** * @deprecated Use PackageDescriptionRenderer::renderPackageDescription() directly. * Kept as a compatibility shim for external callers (themes, extensions) — * package-description rendering now lives in PackageDescriptionRenderer. */ public function renderPackageDescription($wrapper_attributes = '', $showName = true, $showDimensions = true, $showProductWeight = true, $showTotalWeight = true, $variant = null, $defaultVariant = null) { } public function renderExcerpt($atts = '') { } public function renderTitle($atts = '', $config = []) { } public function renderProductImage() { } public function renderPrices($wrapper_attributes = '') { } public function showBuyButton($atts = '') { } protected function renderAttributes($atts = []) { } private function parseAttributes($atts) { } } class ProductCategoriesListRenderer { /** * Convert string/boolean to actual boolean value * Handles shortcode string attributes like "true"/"false" */ private function toBool($value, bool $default = false): bool { } public static function getCategories(): array { } public function render(array $atts = []): void { } public function renderButton() { } public function renderDropdown(array $categories, array $atts): void { } public function renderDropdownOptions(array $categories, array $atts, int $depth = 0): void { } public function renderList(array $categories, array $atts) { } public function renderChildrenList(array $children, array $atts, int $depth = 0) { } public function renderListItems(array $categories, array $atts, int $depth = 0): void { } public function renderCategoryItem($category, $atts, $depth = 0) { } public function renderEmpty(string $wrapperAttributes = '') { } } class ProductCollectionRenderer { protected $products = []; public function __construct($products, $config = []) { } public function render() { } } class ProductFilterRender { protected $product; protected $filters = []; protected $currency = 'USD'; protected $urlFilters = []; protected bool $shouldLoadRangePlugin = false; public function __construct($config = []) { } public function render() { } public function renderSearch() { } public function renderOptions() { } public function renderCheckbox($option) { } public function renderPriceRange($filter = []) { } public function buildFilters($config) { } private function getMetaFilterOptions($key, $prefilled = [], $hideEmpty = false): array { } public static function renderResponsiveFilter() { } } class ProductListRenderer { protected $products = []; protected $listTitle = null; protected $wrapperClass = null; protected $cursor = null; protected $columns = 4; protected $hideExcerpt = false; public function __construct($products, $listTitle = null, $wrapperClass = null, $config = []) { } public function render() { } public function renderProductList() { } public function renderTitle() { } } class ProductModalRenderer { protected $product; protected $config = []; protected $storeSettings; public function __construct(\FluentCart\App\Models\Product $product, $config = []) { } public function render() { } } class ProductRenderer { protected $product; protected $variants; protected $storeSettings; protected $defaultVariant = null; protected $hasOnetime = false; protected $hasSubscription = false; protected $viewType = ''; protected $columnType = ''; protected $defaultVariationId = ''; protected $defaultGalleryImageId = 0; protected $galleryActiveSet = false; protected $paymentTypes = []; protected $variantsByPaymentTypes = []; protected $activeTab = 'onetime'; protected $images = []; protected $variantTermMap = []; protected $defaultImageUrl = null; protected $defaultImageAlt = null; public function __construct(\FluentCart\App\Models\Product $product, $config = []) { } public function buildProductGroups() { } public function render() { } public function renderProductMeta() { } public function renderBuySectionWrapperStart() { } public function renderBuySectionWrapperEnd() { } public function renderBuySection($atts = []) { } public function renderVariationDisplay($atts = []) { } public function renderGalleryThumb() { } public function renderGalleryThumbControls($maxThumbnails = null) { } public function renderGalleryThumbControl($maxThumbnails = null) { } public function renderGallerySeeMoreButton($remainingCount) { } public function renderGalleryThumbControlButton($item, $imageId, $termId = 0, $mediaId = 0) { } public function renderGallery($args = []) { } public function renderTitle() { } public function renderStockAvailability($wrapper_attributes = '') { } public function renderSku($wrapper_attributes = '', $showLabel = true, $label = '', $variant = null) { } /** * @deprecated Use PackageDescriptionRenderer::renderPackageDescription() directly. * Kept as a compatibility shim for external callers (themes, extensions) — * package-description rendering now lives in PackageDescriptionRenderer. */ public function renderPackageDescription($wrapper_attributes = '', $showName = true, $showDimensions = true, $showProductWeight = true, $showTotalWeight = true, $variant = null) { } /** * Build a JSON string of package info for a variant (used as data attribute for JS switching). */ private function getVariantPackageInfoJson(\FluentCart\App\Models\ProductVariation $variant) { } public function renderExcerpt() { } public function renderDescription() { } public function renderPrices() { } public function renderVariants($atts = []) { } public function renderItemPrice() { } public function shouldRenderPriceInPriceSection(): bool { } public function applyVariationPriceFilter($variant, $paymentType = 'onetime') { } public function renderComparePriceWrapperStart($atts = []) { } public function renderComparePriceWrapperEnd() { } public function renderVariationComparePrice($variant) { } public function renderVariantPricingWrapperStart($variant) { } public function renderVariantPricingWrapperEnd() { } public function renderVariationsBundleProduct($variant) { } public function renderQuantity() { } public function renderPurchaseButtons($atts = []) { } public function renderBuyNowButton($atts = []) { } public function renderBuyNowButtonBlock($atts = []) { } public function renderAddToCartButton($atts = []) { } public function renderAddToCartButtonBlock($atts = []) { } public static function renderNoProductFound() { } protected function renderVariationItem(\FluentCart\App\Models\ProductVariation $variant, $defaultId = '', $extraClasses = []) { } protected function renderTooltip($variant) { } public function renderVariantImage($variant) { } protected function renderSubscriptionInfo($variant = null) { } protected function renderAttributes($atts = []) { } protected function renderTab($atts = []) { } protected function renderTabNav() { } protected function renderTabPane($atts = []) { } protected function getDefaultVariantData() { } } } namespace FluentCart\App\Services\Renderer\Receipt { class ReceiptRenderer { protected $config = null; protected $is_first_time = false; protected $order_operation = null; protected $settings = null; protected $vat_tax_id = null; protected $orderTz; private $fctTaxSummaryCache = []; public function __construct($config = []) { } private function getMemoizedTaxSummary($order) { } public function wrapperStart() { } public function wrapperEnd() { } public function render($hideWrapper = false) { } public function renderHeader() { } public function renderHeaderLogo() { } public function renderStoreTaxInformation() { } public function renderHeaderOrderDate() { } public function renderHeaderInvoiceNo() { } public function renderAddresses() { } public function renderStoreAddress($title_border = false) { } public function renderBillToAddress() { } public function renderShipToAddress() { } public function renderOrderItems() { } public function renderOrderItemsTable() { } public function renderOrderItemsFooter() { } public function renderSubtotal() { } public function renderDiscount() { } public function renderProrateCredit() { } public function renderShipping() { } public function renderFees() { } public function renderRefund() { } public function renderTotal() { } public function renderAmountPaid() { } public function renderTaxNote() { } public function renderPaymentHistory() { } public function renderConfirmationError($errorData) { } private function renderTaxRatePills(array $rates, bool $isReversed = false, string $rcMode = 'fixed') { } public function renderTaxSummaryBox() { } } class TaxSummaryHelper { /** * Compute inclusive/exclusive tax split from order data. * * Returns ['shouldRender' => false] when there is nothing to show. * Otherwise returns shouldRender, isReverseCharge, inclusiveTax, exclusiveTax, * shippingTax, payableTax, totalOrderTax — all amounts in cents. */ public static function computeTaxSummary(\FluentCart\App\Models\Order $order) { } /** * Order items used to build the per-rate base map for the tax breakdown table. */ private static function getOrderItemsForBaseMap(\FluentCart\App\Models\Order $order) { } /** * For a mixed-inclusive rate (same rate used inclusively on some items and exclusively on others), * read each order item's line_meta to produce the correct inclusive/exclusive split. * Handles both item shapes: * - Current (all item types): line_meta.tax_config.rates[] + line_meta.tax_config.inclusive * - Legacy signup-fee: line_meta.rates[] + line_meta.inclusive (no tax_config wrapper) * Returns [inclusiveTax, exclusiveTax] in cents. */ private static function splitMixedRateTax(\FluentCart\App\Models\Order $order, $rateId) { } /** * Extract per-rate tax breakdown from a single order item. * * Reads `line_meta.tax_config.rates`, filters out zero-amount entries, and * returns a flat array of rate rows. Returns [] for old items without * tax_config — callers must check for empty before looping. */ public static function getItemTaxRates(array $item) { } /** * Determine whether the primary tax type for an order is inclusive. * Used for per-item pill display (fct_order_tax_rate has no order_item_id). */ public static function isPrimaryTaxInclusive(\FluentCart\App\Models\Order $order) { } /** * Determine whether the shipping tax on an order was charged inclusive of the * shipping price (vs. added on top). Reads `meta.shipping_inclusive` (written * from the store-level tax mode at order placement) from each rate row that * contributed shipping_tax. Falls back to $order->tax_behavior === 2. * * Shipping always follows the store-level tax mode — per-product `meta.inclusive` * is intentionally NOT consulted here. */ public static function isShippingTaxInclusive(\FluentCart\App\Models\Order $order) { } /** * Returns display-ready fee tax line rows, filtering out zero-amount entries * and pre-computing the translated label for each surface to render. * Each entry: ['label' => string, 'tax_amount' => int, 'inclusive' => bool, 'display_label' => string] */ public static function buildFeeTaxLineRows(array $feeTaxLines) { } /** * Aggregate the real taxable base per rate from item-level tax data. * * For inclusive lines the stored taxable_amount is gross (base + tax), so the * rate's own tax is subtracted to get the net base. Amounts can be fractional * cents when the store uses subtotal tax rounding — callers round for display. * * @param iterable $items Order items (models or arrays) or cart line arrays, * each carrying line_meta.tax_config. * @return array [rate_id => ['base' => float, 'tax' => float]] */ public static function computeRateBaseMap($items, $excludeInclusive = false) { } /** * Build a folded per-rate row array for the 3-column tax breakdown table. * * Merges order-tax rate lines with shipping-tax lines by rate_id so each rate * appears once with its combined tax and computed taxable base. * * @param array $rateLines Output of Order::getDisplayTaxLines(). * @param array $shippingLines Output of Order::getDisplayShippingTaxLines(). * @param string $taxAmountKey Key holding the order tax amount in each $rateLine ('order_tax'). * @param bool $isShippingInclusive Whether shipping tax is inclusive. * @param array $rateBaseMap Output of computeRateBaseMap() — exact per-rate bases * from item data. A rate entry is only trusted when its * item tax sum matches the rate row's tax (guards fee * items and legacy rows missing from the item data). * @return array Each row: ['label'=>string,'base'=>int,'tax'=>int,'inclusive'=>bool] */ public static function buildFoldedRateRows($rateLines, $shippingLines, $taxAmountKey, $isShippingInclusive, $rateBaseMap = []) { } /** * Rebuild the per-rate breakdown rows for a reverse-charge order. * * Under reverse charge the stored tax lines (and shipping tax lines) are zeroed * at order placement, but the original per-rate amounts survive in item-level * `line_meta.tax_config.rates`, and the pre-zeroing shipping lines survive in the * rate-meta snapshot (`vat_reverse.reverse_charge_shipping_tax_lines`). This * restores both and folds shipping into the rate rows so post-order surfaces can * render the same "Tax breakdown by rate" table as a normal order. * * Returns [] when no per-rate data is recoverable (old orders without line-level * tax data) — callers must fall back to the simplified reverse-charge box. * * @return array Same row shape as buildFoldedRateRows(). */ public static function buildReverseChargeRateRows(\FluentCart\App\Models\Order $order) { } /** * Checkout-side variant: determines whether the shipping tax is inclusive of the * shipping price. Shipping always follows the store-level tax mode, so this returns * true only when store_tax_behavior === 2 (inclusive). Per-product inclusive flags * are intentionally NOT consulted — they do not govern shipping. */ public static function isShippingTaxInclusiveFromTaxData(array $taxData) { } protected static function getTaxSettings(): array { } public static function getTaxDisplayMode(): string { } protected static function getTaxDisplayLabel(): string { } protected static function getPriceSuffixIncluded(): string { } public static function buildSimpleLine(array $summary): array { } } class ThankYouRender { protected $config = null; protected $settings = null; protected $is_first_time = false; protected $order_operation = null; private $fctTaxSummaryCache = []; public function __construct($config) { } private function getMemoizedTaxSummary($order) { } public function renderWrapperStart() { } public function renderWrapperEnd() { } public function render($hide_wrapper = false) { } public function renderHeader() { } public function renderBody() { } public function renderOrderHeader() { } public function renderStoreTaxInformation() { } public function renderOrderItems() { } public function renderOrderItemsHeader() { } public function renderOrderItemsBody() { } public function renderThankYouPageInstructions() { } public function renderOrderTotal() { } public function renderTaxNote() { } public function renderSubtotal() { } public function renderDiscount() { } public function renderProrateCredit() { } public function renderShipping() { } public function renderFees() { } public function renderRefund() { } public function renderTotal() { } public function renderPaymentMethod() { } public function renderSubscriptionItems() { } public function renderDownloads() { } public function renderDownloadsNotice($show_notice = false) { } public function renderLicenseNotice($show_notice = false) { } public function renderLicenses() { } public function renderAddress() { } public function renderBillToAddress() { } public function renderShipToAddress() { } public function renderFooter() { } public function renderViewOrderButton() { } public function renderDownloadReceiptButton() { } /** * Build a parent → bundle items relationship from flat order items * * Converts a flat order items list into: * - Parent items * - Each parent contains a ` bundle_items ` array * * @param array $orderItems * @return array */ protected function buildBundleItemsTree($orderItems) { } public function renderBundleProducts($item) { } public function renderTaxSummaryBox() { } private function renderTaxBreakdownCardInner($summary) { } public function renderItemTaxPill($item, $order) { } public function renderItemSetupFeeTaxPills($item, $order) { } private function renderTaxRatePills(array $rates, bool $isReversed = false, string $rcMode = 'fixed') { } } } namespace FluentCart\App\Services\Renderer { class RenderHelper { public static function renderAtts($atts = []) { } public static function renderPriceSuffix($product, $variant, $scope) { } public static function getBlockWrapperAttributes(array $attributes = []) { } } class SearchBarRenderer { protected $config; public function __construct(array $config = []) { } public function render() { } public function renderCategory() { } public function renderInput() { } public function renderSearchResult() { } public function renderResultItems($products = []) { } } class ShippingMethodsRender { protected $shippingMethods = []; protected $selectedId = null; public function __construct($shippingMethods = [], $selectedId = null) { } public function render() { } public function renderBody() { } public function renderEmptyState() { } public function renderMethods() { } public function renderEmpty($message) { } public function renderLoader() { } /** * Get inline SVG icon for a package type. */ public static function getPackageTypeIcon($type) { } } class ShopAppRenderer { protected $viewMode = 'grid'; protected $isFilterEnabled = false; protected $per_page = 10; protected $order_type = 'DESC'; protected $order_by = 'id'; protected $liveFilter = true; protected $priceFormat = 'starts_from'; protected $paginator = 'scroll'; protected $defaultFilters = []; protected $productBoxGridSize = 4; protected $config = []; protected $filters = []; protected $products = []; protected $customFilters = []; protected $total = 0; protected $isWildcardFilterEnabled = false; protected $enableSortBy = true; public function __construct($products = [], $config = []) { } public function render() { } public function renderViewSwitcher() { } public function renderViewSwitcherButton() { } public function renderSortByFilter() { } public function renderFilter($renderer) { } public function renderProduct() { } public function renderTitle($product = null) { } public function renderImage($product = null) { } public function renderPrice($product = null) { } public function renderButton($product = null) { } private function getInitialProducts() { } public function renderPaginator() { } public function renderPaginatorResultWrapper($atts = '') { } public function renderPerPageSelector() { } } class StoreLogoRenderer { protected $storeSettings; public function __construct() { } public function getStoreLogo(): string { } public function getStoreName(): string { } public function render(array $atts = []): void { } protected function renderWithLink(array $atts): void { } protected function renderWithoutLink(array $atts): void { } protected function renderLogoContent(array $atts): void { } protected function renderImage(array $atts): void { } protected function renderTextFallback(string $storeName): void { } } class TaxRenderer { protected $module; public function __construct(\FluentCart\App\Modules\Tax\TaxModule $module) { } public function renderTaxRow($cart, $atts = ''): void { } public function renderShippingTaxRow($cart, $atts = ''): string { } public function renderTaxSummaryBox($cart): void { } public function renderCheckoutLineItemTaxLabel($data): void { } public function renderCheckoutSetupFeeTaxLabel($data): void { } private function renderTaxBadges(array $normalizedRates, $isReversed = false, $rcMode = 'fixed'): void { } private function getSetupFeeTaxData($item): ?array { } public function renderCheckoutSetupFeeTaxTooltip($data): void { } public function renderCheckoutSetupFeeTaxInfo($data): void { } public function renderCheckoutLineItemTaxTooltip($data): void { } public function renderCheckoutLineItemTaxInfo($data): void { } public function renderUnitPriceRoundingTooltip($data): void { } protected function getCheckoutTaxBreakdownDisplayMode(): string { } protected function getTaxDisplayLabel(): string { } protected function normalizeCheckoutLineTaxRates($item): array { } protected function getCheckoutLineTaxShortLabel($label): string { } private function shouldRateStrikethrough($isReversed, $rateIsInclusive, $rcMode): bool { } } class VatFieldRenderer { protected $taxApplicableCountry = ''; public function __construct($taxApplicableCountry = '') { } public function render($cart) { } /** * Renders only the inner content of the tax wrapper — used for fragment replacement * so the fragment does not create a nested [data-fluent-cart-checkout-page-tax-wrapper]. * Accepts $checkoutData directly so the caller can pass the freshly-updated data * instead of relying on the model's in-memory property. */ public function renderInner($checkoutData) { } public function renderValidNote($checkoutData) { } } } namespace FluentCart\App\Services\Report\Concerns { trait CanParseAddressField { /** * Parse Address value from given data * * @param mixed $item * @param string $groupKey The name of the group * @return string */ protected function parseAddressField($item, string $groupKey): string { } } trait HasRange { protected string $rangeKey = 'created_at'; protected ?\DateTimeZone $originalTimeZone = null; public function getRangeKey(): string { } /** * @param string $rangeKey * @return \FluentCart\App\Services\Report\ReportService */ public function setRangeKey(string $rangeKey) { } public function getRange(): array { } /** * @param $startDate * @param $endDate */ public function setRange($startDate, $endDate, bool $handleDayClosingTime = true) { } /** * @param $year */ public function setYearlyRange($selectedYear) { } protected ?\FluentCart\App\Services\DateTime\DateTime $startDate = null; /** * @return mixed */ public function getStartDate(): ?\FluentCart\App\Services\DateTime\DateTime { } /** * @param mixed $startDate */ public function setStartDate($startDate) { } protected ?\FluentCart\App\Services\DateTime\DateTime $endDate = null; /** * @return mixed */ public function getEndDate(): ?\FluentCart\App\Services\DateTime\DateTime { } /** * @param null $endDate */ public function setEndDate($endDate) { } protected function validate($time) { } protected function getFilters(): array { } public function getRangeDiffInMonth(): int { } public function getRangeDiffInYear(): int { } public function test() { } } } namespace FluentCart\App\Services\Report\Concerns\Subscription { trait CanCalculateChurnRateTrend { /** * Retrieves the Subscriber Churn Rate trend over a specified period, * aggregated by the given interval (daily, monthly, yearly). * * Churn Rate = (Number of Churned Subscribers / Number of Subscribers at Beginning of Period) * 100% * * @param string|null $period_start_date_str Optional. The start date of the period in 'Y-m-d H:i:s' format. * If null, uses the earliest available date from the database. * @param string|null $period_end_date_str Optional. The end date of the period in 'Y-m-d H:i:s' format. * If null, uses the latest available date from the database. * @param string $interval_type The aggregation interval: 'daily', 'monthly', or 'yearly'. * @return array An array of associative arrays, each containing 'trend_date' and 'value' (churn rate percentage). */ public function get_churn_rate_trend($period_start_date_str = null, $period_end_date_str = null, $interval_type = 'monthly', $currency = null) { } public function get_daily_churn_rate_trend($period_start_date_str = null, $period_end_date_str = null) { } public function get_monthly_churn_rate_trend($period_start_date_str = null, $period_end_date_str = null, $currency = null) { } public function get_yearly_churn_rate_trend($period_start_date_str = null, $period_end_date_str = null) { } /** * Fetches all relevant subscriptions that could potentially be active or churned * within the overall date range for churn rate calculation. * Assumes $this->wpdb and $this->table_subscriptions are available. * * @param string $overall_min_date The earliest date in the entire reporting range. * @param string $overall_max_date The latest date in the entire reporting range. * @return array An array of subscription records. */ protected function get_all_relevant_subscriptions_for_churn_rate(string $overall_min_date, string $overall_max_date, $offsetMinutes = 0, $currency = null): array { } } trait CanCalculateChurnRevenue { /** * Retrieves the Churn Revenue trend over a specified period, * aggregated by the given interval (daily, monthly, yearly). * * @param string|null $period_start_date_str Optional. The start date of the period in 'Y-m-d H:i:s' format. * If null, uses the earliest available date from the database. * @param string|null $period_end_date_str Optional. The end date of the period in 'Y-m-d H:i:s' format. * If null, uses the latest available date from the database. * @param string $interval_type The aggregation interval: 'daily', 'monthly', or 'yearly'. * @return array An array of associative arrays, each containing 'trend_date' (formatted based on interval) * and 'value' (total Churn Revenue for that interval). */ public function get_churn_revenue_trend($period_start_date_str = null, $period_end_date_str = null, $interval_type = 'monthly', $currency = null) { } public function get_daily_churn_revenue_trend($period_start_date_str = null, $period_end_date_str = null, $currency = null) { } public function get_monthly_churn_revenue_trend($period_start_date_str = null, $period_end_date_str = null, $currency = null) { } public function get_yearly_churn_revenue_trend($period_start_date_str = null, $period_end_date_str = null, $currency = null) { } /** * Fetches churn revenue events within a given date range efficiently. * Assumes $this->wpdb and $this->table_subscriptions are available in the class using this trait. * * @param string $range_start_gmt The overall start date of the range (GMT). * @param string $range_end_gmt The overall end date of the range (GMT). * @return array An array of associative arrays, each containing 'churn_date' and 'normalized_mrr'. */ protected function get_churn_revenue_events_in_range(string $range_start_gmt, string $range_end_gmt, $currency = null): array { } protected function get_total_churn_revenue(string $churn_date, $currency = null): float { } } trait CanCalculateMrr { // /** // * Retrieves the Monthly Recurring Revenue (MRR) trend over a specified period, // * aggregated by the given interval (daily, monthly, yearly). // * // * @param string|null $period_start_date_str Optional. The start date of the period in 'Y-m-d H:i:s' format. // * If null, uses the earliest available date from the database. // * @param string|null $period_end_date_str Optional. The end date of the period in 'Y-m-d H:i:s' format. // * If null, uses the latest available date from the database. // * @param string $interval_type The aggregation interval: 'daily', 'monthly', or 'yearly'. // * @return array An array of associative arrays, each containing 'trend_date' (formatted based on interval) // * and 'value' (total MRR for that interval). // */ // public function get_mrr_trend($period_start_date_str = null, $period_end_date_str = null, $interval_type = 'monthly', $currency = null) // { // $start_date_obj = DateTime::anyTimeToGmt($period_start_date_str ?: (defined('static::db_min_date') ? static::$db_min_date : '2000-01-01 00:00:00')); // $end_date_obj = DateTime::anyTimeToGmt($period_end_date_str ?: (defined('static::db_max_date') ? static::$db_max_date : gmdate('Y-m-d H:i:s'))); // $data = []; // $snapshot_dates_to_fetch = []; // $temp_date_iterator = clone $start_date_obj; // $date_format = 'Y-m-d'; // switch ($interval_type) { // case 'daily': // $temp_date_iterator->startOfDay(); // $end_date_obj->endOfDay(); // $date_format = 'Y-m-d'; // break; // case 'monthly': // $temp_date_iterator->startOfMonth(); // $end_date_obj->endOfMonth(); // $date_format = 'Y-m'; // break; // case 'yearly': // $temp_date_iterator->startOfYear(); // $end_date_obj->endOfYear(); // $date_format = 'Y'; // break; // default: // $temp_date_iterator->startOfMonth(); // $end_date_obj->endOfMonth(); // $date_format = 'Y-m'; // $interval_type = 'monthly'; // break; // } // while ($temp_date_iterator <= $end_date_obj) { // $snapshot_date = clone $temp_date_iterator; // switch ($interval_type) { // case 'daily': // $snapshot_date->endOfDay(); // break; // case 'monthly': // $snapshot_date->endOfMonth(); // break; // case 'yearly': // $snapshot_date->endOfYear(); // break; // } // $snapshot_dates_to_fetch[$temp_date_iterator->format($date_format)] = $snapshot_date->format('Y-m-d H:i:s'); // switch ($interval_type) { // case 'daily': // $temp_date_iterator->addDays(1); // break; // case 'monthly': // $temp_date_iterator->addMonth(); // break; // case 'yearly': // $temp_date_iterator->addYear(); // break; // } // } // $mrr_values_by_snapshot_date = $this->get_total_mrr_for_multiple_dates(array_values($snapshot_dates_to_fetch), $currency); // $current_date_iterator = clone $start_date_obj; // switch ($interval_type) { // case 'daily': // $current_date_iterator->startOfDay(); // break; // case 'monthly': // $current_date_iterator->startOfMonth(); // break; // case 'yearly': // $current_date_iterator->startOfYear(); // break; // } // while ($current_date_iterator <= $end_date_obj) { // $trend_date_key = $current_date_iterator->format($date_format); // $snapshot_date_string = $snapshot_dates_to_fetch[$trend_date_key]; // $mrr_value = isset($mrr_values_by_snapshot_date[$snapshot_date_string]) // ? (float) $mrr_values_by_snapshot_date[$snapshot_date_string] // : 0.00; // $data[] = [ // 'trend_date' => $trend_date_key, // 'value' => $mrr_value // ]; // switch ($interval_type) { // case 'daily': // $current_date_iterator->addDays(1); // break; // case 'monthly': // $current_date_iterator->addMonth(); // break; // case 'yearly': // $current_date_iterator->addYear(); // break; // } // } // return $data; // } // public function get_daily_total_mrr_trend($period_start_date_str = null, $period_end_date_str = null, $currency = null) // { // return $this->get_mrr_trend($period_start_date_str, $period_end_date_str, 'daily', $currency); // } // public function get_monthly_total_mrr_trend($period_start_date_str = null, $period_end_date_str = null, $currency = null) // { // return $this->get_mrr_trend($period_start_date_str, $period_end_date_str, 'monthly', $currency); // } // public function get_yearly_total_mrr_trend($period_start_date_str = null, $period_end_date_str = null, $currency = null) // { // return $this->get_mrr_trend($period_start_date_str, $period_end_date_str, 'yearly', $currency); // } // /** // * Fetches MRR for multiple snapshot dates efficiently. // * Assumes $this->wpdb and $this->table_subscriptions are available in the class using this trait. // * // * @param array $snapshot_dates An array of snapshot dates in 'Y-m-d H:i:s' GMT format. // * @return array An associative array where keys are snapshot dates ('Y-m-d H:i:s') and values are the total MRR. // */ // protected function get_total_mrr_for_multiple_dates(array $snapshot_dates, $currency = null): array // { // if (empty($snapshot_dates)) { // return []; // } // global $wpdb; // $table_subscriptions = $wpdb->prefix . 'fct_subscriptions'; // $table_orders = $wpdb->prefix . 'fct_orders'; // $unique_snapshot_gmt_strings = array_unique($snapshot_dates); // $mrr_data = array_fill_keys($unique_snapshot_gmt_strings, 0.00); // $min_snapshot_date_gmt = min($unique_snapshot_gmt_strings); // $max_snapshot_date_gmt = max($unique_snapshot_gmt_strings); // // Fetch subscriptions using accurate column names from SubscriptionsMigrator.php // // Columns: recurring_amount, billing_interval, created_at, expire_at, canceled_at, status // $currency_filter = ''; // if (!empty($currency)) { // $currency_filter = $wpdb->prepare(" AND o.currency = %s", esc_sql($currency)); // } // // phpcs:ignore WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.DirectDatabaseQuery.NoCaching // $subscriptions = $wpdb->get_results( // $wpdb->prepare( // "SELECT // s.id, // s.recurring_amount, // s.billing_interval, // s.created_at, -- Subscription start date // s.expire_at, -- End of fixed term/trial // s.canceled_at, -- Explicit cancellation date // s.status // FROM {$table_subscriptions} s // INNER JOIN {$table_orders} o ON s.parent_order_id = o.id // WHERE s.status IN (%s, %s, %s) -- Consider 'active', 'trialling', 'pending' for potential MRR // AND ( // s.created_at <= %s -- Subscription started on or before the latest snapshot // AND ( // s.expire_at IS NULL OR s.expire_at >= %s -- Hasn't expired before the earliest snapshot // ) // AND ( // s.canceled_at IS NULL OR s.canceled_at > %s -- Not cancelled before or on the earliest snapshot // ) // ) // {$currency_filter}", // 'active', 'trialling', 'pending', // Adjust statuses that contribute to MRR // $max_snapshot_date_gmt, // $min_snapshot_date_gmt, // $min_snapshot_date_gmt // ), // ARRAY_A // ); // foreach ($unique_snapshot_gmt_strings as $snapshot_gmt_str) { // $snapshot_date_obj = DateTime::anyTimeToGmt($snapshot_gmt_str); // $current_mrr_for_snapshot = 0.00; // foreach ($subscriptions as $subscription) { // // Use recurring_amount for MRR // if (empty($subscription['recurring_amount']) || empty($subscription['billing_interval'])) { // continue; // } // $sub_created_at_obj = DateTime::anyTimeToGmt($subscription['created_at']); // $sub_expire_at_obj = null; // if (!empty($subscription['expire_at'])) { // $sub_expire_at_obj = DateTime::anyTimeToGmt($subscription['expire_at']); // } // $sub_canceled_at_obj = null; // if (!empty($subscription['canceled_at'])) { // $sub_canceled_at_obj = DateTime::anyTimeToGmt($subscription['canceled_at']); // } // $is_active_at_snapshot = false; // // Check active statuses // if (!in_array($subscription['status'], ['active', 'trialling', 'pending'])) { // continue; // } // // Check if created_at is on or before snapshot_date // if ($sub_created_at_obj <= $snapshot_date_obj) { // // Check if not expired before snapshot_date // $not_expired = ($sub_expire_at_obj === null || $sub_expire_at_obj >= $snapshot_date_obj); // // Check if not cancelled before or on snapshot_date // $not_cancelled = ($sub_canceled_at_obj === null || $sub_canceled_at_obj > $snapshot_date_obj); // if ($not_expired && $not_cancelled) { // $is_active_at_snapshot = true; // } // } // if ($is_active_at_snapshot) { // $monthly_recurring_amount = (float) $subscription['recurring_amount']; // // Normalize to monthly recurring revenue // switch ($subscription['billing_interval']) { // case 'yearly': // $monthly_recurring_amount /= 12; // break; // case 'weekly': // $monthly_recurring_amount = ($monthly_recurring_amount * 52) / 12; // break; // case 'daily': // $monthly_recurring_amount = ($monthly_recurring_amount * 365) / 12; // break; // case 'monthly': // break; // } // $current_mrr_for_snapshot += $monthly_recurring_amount; // } // } // $mrr_data[$snapshot_gmt_str] = $current_mrr_for_snapshot; // } // return $mrr_data; // } // protected function get_total_mrr(string $snapshot_date, $currency = null): float // { // $results = $this->get_total_mrr_for_multiple_dates([$snapshot_date], $currency); // return isset($results[$snapshot_date]) ? (float) $results[$snapshot_date] : 0.00; // } } trait CanCalculateSubscriptionCountTrend { /** * Retrieves the active subscription count trend over a specified period, * aggregated by the given interval (daily, monthly, yearly). * * @param string|null $period_start_date_str Optional. The start date of the period in 'Y-m-d H:i:s' format. * If null, uses the earliest available date from the database. * @param string|null $period_end_date_str Optional. The end date of the period in 'Y-m-d H:i:s' format. * If null, uses the latest available date from the database. * @param string $interval_type The aggregation interval: 'daily', 'monthly', or 'yearly'. * @return array An array of associative arrays, each containing 'trend_date' (formatted based on interval) * and 'value' (total active subscription count for that interval). */ public function get_subscription_count_trend($period_start_date_str = null, $period_end_date_str = null, $interval_type = 'monthly', $currency = null) { } public function get_daily_subscription_count_trend($period_start_date_str = null, $period_end_date_str = null, $currency = null) { } public function get_monthly_subscription_count_trend($period_start_date_str = null, $period_end_date_str = null, $currency = null) { } public function get_yearly_subscription_count_trend($period_start_date_str = null, $period_end_date_str = null, $currency = null) { } /** * Fetches total active subscription counts for multiple snapshot dates efficiently. * Assumes $this->wpdb and $this->table_subscriptions are available in the class using this trait. * * @param array $snapshot_dates An array of snapshot dates in 'Y-m-d H:i:s' GMT format. * @return array An associative array where keys are snapshot dates ('Y-m-d H:i:s') and values are the total count. */ protected function get_total_subscription_counts_for_multiple_dates(array $snapshot_dates, $offsetMinutes = 0, $currency = null): array { } protected function get_total_subscription_count(string $snapshot_date, $currency = null): int { } } trait FutureRenewals { public function getFutureRenewals(array $params) { } /** * Get all active subscriptions with billing info */ private function getActiveSubscriptions() { } /** * Calculate how many renewals will occur for a subscription in the given period */ private function calculateRenewalsInPeriod($subscription, $startDate, $endDate) { } /** * Convert billing interval to days */ private function getIntervalDays($interval) { } /** * Get actual renewal dates for a subscription within the period */ private function getRenewalDatesInPeriod($subscription, $startDate, $endDate) { } } } namespace FluentCart\App\Services\Report { abstract class ReportService { protected $data = null; protected $selects = '*'; protected array $filters = []; protected bool $loaded = false; protected array $amountColumns = []; public function __construct(array $filters = []) { } public function getModel(): string { } protected function prepareReportData(): void { } public function setAmountColumns(array $columns) { } public function mergeAmountColumns(array $columns) { } public function getAmountColumns(): array { } public static function make(array $filters = []) { } public function setSelects($selects) { } protected function getFilters(): array { } protected function buildQuery(): \FluentCart\Framework\Database\Orm\Builder { } protected function modifyQuery(\FluentCart\Framework\Database\Orm\Builder $query): \FluentCart\Framework\Database\Orm\Builder { } protected function transformAmountColumns() { } public function getOriginalData() { } public function generate() { } /** * Begin a fluent query against a database table. * @return \FluentCart\Framework\Database\Query\Builder */ public function addFiltersToQuery($query, $filters, $table = null): \FluentCart\Framework\Database\Query\Builder { } public function applyFilters(\FluentCart\Framework\Database\Query\Builder $query, array $filters): \FluentCart\Framework\Database\Query\Builder { } protected function getPeriodRange($startDate, $endDate, $groupKey, $keys = []) { } public function getFutureInstallments($params = []) { } } class CustomerReportService extends \FluentCart\App\Services\Report\ReportService { public function getCustomerReportData($params = []) { } public function calculateFluctuations($currentMetrics, $previousMetrics) { } } class DashBoardReportService extends \FluentCart\App\Services\Report\ReportService { use \FluentCart\App\Services\Report\Concerns\HasRange, \FluentCart\App\Services\Report\Concerns\CanParseAddressField; protected $salesGrowthChart = []; protected $dashBoardStats = []; protected $totalOrders = 0; protected $totalPaidOrders = 0; protected $totalOrderItems = 0; protected $totalOrderValue = 0; protected function modifyQuery(\FluentCart\Framework\Database\Orm\Builder $query): \FluentCart\Framework\Database\Orm\Builder { } public function getModel(): string { } /** * Prepares report data by calculating total orders, total paid orders, total order items, and total order value. * * This method performs the following calculations: * - Counts the total number of orders. * - Counts the total number of paid orders. * - Calculates the total number of items across all orders. * - Calculates the total number of items in paid orders. * - Calculates the total value of paid orders. * * @return void */ protected function prepareReportData(): void { } /** * Get dashboard statistics for the given date range. * * @param string $previousStartDate The start date of the previous period. * @param string $previousEndDate The end date of the previous period. * @return array An array containing the dashboard statistics. */ public function getDashBoardStats($startDate, $endDate, $previousStartDate, $previousEndDate) { } public function getSalesGrowthChart(array $params) { } public function getCountryHeatMap() { } public static function getRecentOrders() { } public static function getRecentActivities($groupKey) { } public static function getSummary() { } } class DefaultReportService extends \FluentCart\App\Services\Report\ReportService { public function fetchTopSoldProducts(array $params) { } public function fetchTopSoldVariants(array $params): array { } public function calculateFluctuations($currentMetrics, $previousMetrics) { } private function calculateFluctuation($currentValue, $previousValue) { } private function getProductNames(array $productIds): array { } private function getProductImages(array $productIds): array { } private function getVariantMeta(array $variationIds): array { } private function getVariationImages(array $variationIds): array { } public function getAllGraphMetricsSeparate($params = []) { } private function combineMetricsResults($orderMetrics): array { } } class LicenseReportService extends \FluentCart\App\Services\Report\ReportService { use \FluentCart\App\Services\Report\Concerns\HasRange, \FluentCart\App\Services\Report\Concerns\CanParseAddressField; protected $summary = []; protected $forcedGroupKey = []; protected function modifyQuery(\FluentCart\Framework\Database\Orm\Builder $query): \FluentCart\Framework\Database\Orm\Builder { } public function getModel(): string { } protected function prepareReportData(): void { } public function getLicenseLineChart($groupKey, $startDate, $endDate) { } public function getLicensePieChart($startDate, $endDate): array { } public function getSummary($startDate, $endDate): array { } } class OrderReportService extends \FluentCart\App\Services\Report\ReportService { public function groupBy($params = []) { } public function getOrderValueDistribution(array $params) { } public function getOrderLineChart($params = []) { } public function getNewVsReturningCustomer($params = []) { } public function getReportByDayAndHour(array $params): array { } public function getItemCountDistribution(array $params): array { } public function calculateFluctuations($currentData, $previousData) { } public function getOrderCompletionTime(array $params): array { } } class ProductReportService extends \FluentCart\App\Services\Report\ReportService { public function getProductTopChart(array $params) { } public function getProductReportData($params = []) { } public function calculateFluctuations($currentMetrics, $previousMetrics) { } } class RefundReportService extends \FluentCart\App\Services\Report\ReportService { public function getRefundDataGroupedBy($params = []): array { } public function getRefundData($params = []): array { } public function calculateFluctuations($currentMetrics, $previousMetrics) { } public function weeksBetweenRefund($params = []): array { } } class ReportHelper { /** * Define the group key based on the data density between the start and end dates. * * @param \DateTime $startDate The start date as a DateTime object. * @param \DateTime $endDate The end date as a DateTime object. * @return string The group key, which can be 'daily', 'monthly', or 'yearly'. */ public static function defineGroupKey($startDate, $endDate) { } public static function processGroup($startDate, $endDate, $groupKey = null) { } public static function processFilters($params = []) { } public static function processRequest($params = []): array { } public static function processParams($params = [], $additional = []): array { } /** * Whitelist a groupKey value used to build raw SQL (SELECT/GROUP BY clauses) * so an unrecognized or missing value never reaches the query builder. * * @param mixed $value * @return string */ public static function sanitizeGroupKey($value) { } protected static function sanitizeParams($params) { } /** * @param string $type * @param array $compareRange * @param array $currentRange * @return array|\DateTime[]|false * @throws \Exception */ public static function getCompareRange($type, $currentRange, $compareDate = null) { } } class RetentionSnapshotService { /** * Statuses to exclude from analysis (never really started) */ protected array $excludedStatuses = [\FluentCart\App\Helpers\Status::SUBSCRIPTION_PENDING, \FluentCart\App\Helpers\Status::SUBSCRIPTION_INTENDED, 'incomplete_expired']; /** * Active statuses */ protected array $activeStatuses = [\FluentCart\App\Helpers\Status::SUBSCRIPTION_ACTIVE, \FluentCart\App\Helpers\Status::SUBSCRIPTION_TRIALING]; /** * Generate retention snapshots * * @param int|null $productIdFilter Optional product ID to filter by * @param callable|null $progressCallback Optional callback for progress updates: fn(string $message, string $level = 'info') * @return array Result with 'success', 'message', and 'stats' */ public function generate(?int $productIdFilter = null, ?callable $progressCallback = null): array { } /** * Log a message */ protected function log(string $message, string $level = 'info', ?callable $callback = null): void { } /** * Ensure the retention snapshots table exists */ protected function ensureTableExists(): void { } /** * Truncate the snapshots table */ protected function truncateTable(): void { } /** * Get all unique customer-product pairs */ protected function getCustomerProductPairs(?int $productIdFilter = null): array { } /** * Get the date range for analysis */ protected function getDateRange(?int $productIdFilter = null): array { } /** * Build customer timelines - for each customer-product pair, determine their state in each month */ protected function buildCustomerTimelines(array $pairs, array $dateRange, ?callable $progressCallback = null): array { } /** * Build timelines and aggregate - optimized to fetch all data once but insert in batches */ protected function buildTimelinesAndAggregate(array $pairs, array $dateRange, ?callable $progressCallback): int { } /** * Build timelines and aggregate in batches to minimize memory usage * * Instead of building ALL timelines in memory, we: * 1. Fetch subscriptions for a batch of customer-product pairs * 2. Build timelines for that batch * 3. Aggregate and insert to DB * 4. Clear memory and repeat */ protected function buildAndAggregateInBatches(array $pairs, array $dateRange, ?callable $progressCallback, ?int $productIdFilter): int { } /** * Accumulate timelines into global aggregates array * This merges data from multiple batches without creating duplicates */ protected function accumulateAggregates(array &$globalAggregates, array $timelines, array $dateRange): void { } /** * Insert aggregates into database in batches */ protected function insertAggregates(string $table, array $aggregates, ?callable $progressCallback): int { } /** * Determine customer's state for a given month */ protected function getCustomerStateForMonth($subscriptions, string $month): array { } /** * Check if a subscription was active during a given month * * A subscription is considered active in a month if: * - It was created on or before the end of that month, AND * - It had not ended before the start of that month * * For ended subscriptions, we use the END date (expire_at, or canceled_at + billing period) * For active subscriptions, we check if they existed during that month */ protected function wasSubscriptionActiveInMonth($sub, \DateTime $monthStart, \DateTime $monthEnd): bool { } /** * Get the effective end date of a subscription * Returns null if subscription is still ongoing * * We use last_payment + billing_interval as the effective end date. * This represents when the subscription actually stopped providing revenue. */ protected function getSubscriptionEndDate($sub): ?\DateTime { } /** * Get billing interval in months */ protected function getBillingIntervalMonths(string $interval): int { } /** * Normalize recurring amount to monthly MRR */ protected function normalizeToMonthlyMrr($sub): int { } /** * Aggregate timelines into cohort snapshots * Returns the number of snapshots inserted (not the snapshots themselves to save memory) */ protected function aggregateSnapshots(array $timelines, array $dateRange, ?callable $progressCallback = null): int { } /** * Add data to aggregate array */ protected function addToAggregate(array &$aggregates, string $cohort, string $period, $productId, int $periodOffset, int $cohortMrr, array $periodState): void { } /** * Insert a batch of records */ protected function insertBatch(string $table, array $batch): int { } /** * Get statistics from the generated snapshots */ public function getStats(): array { } } class RevenueReportService extends \FluentCart\App\Services\Report\ReportService { public function revenueByGroup(array $params = []): array { } public function getRevenueData($params = []): array { } public function getFluctuations($currentMetrics, $previousMetrics) { } } class SourceReportService extends \FluentCart\App\Services\Report\ReportService { public function getSourceReportData($params = []) { } public function calculateFluctuations($currentData, $comparisonData) { } protected function calculatePercentageChange($oldValue, $newValue) { } } class SubscriptionReportService extends \FluentCart\App\Services\Report\ReportService { use \FluentCart\App\Services\Report\Concerns\Subscription\FutureRenewals; public function getRetentionChart($params = []) { } public function getDailySignups($params = []) { } public function getChartData(array $params) { } public function getRetentionData($params) { } /** * Get cohort retention data from pre-calculated snapshots table * * Supports both monthly and yearly g * - Monthly: Uses period_offset 1, 2, 3... (each month) * - Yearly: Aggregates cohorts by year and uses period_offset 12, 24, 36... (each year) * * @param array $params * @return array */ public function getCohortData($params = []) { } /** * Get cohort data grouped by month * * @param string $startCohort * @param string $endCohort * @param array $productIds Array of product IDs to filter by (empty = all products combined) * @param string $metric * @param int $maxPeriods * @return array */ protected function getCohortDataByMonth($startCohort, $endCohort, $productIds, $metric, $maxPeriods) { } /** * Get cohort data grouped by year * * For yearly view, we use period_offset = 12 as the baseline (end of year 1, before first renewal) * and show period_offset 24, 36, 48... as Year 1, Year 2, Year 3 (after 1st, 2nd, 3rd renewal) * * This is because at period_offset = 12, yearly subscribers haven't had a renewal opportunity yet, * so they show ~100% retention. The actual churn happens after the first renewal at offset 12+. * * @param string $startCohort * @param string $endCohort * @param array $productIds Array of product IDs to filter by (empty = all products combined) * @param string $metric * @param int $maxPeriods * @return array */ protected function getCohortDataByYear($startCohort, $endCohort, $productIds, $metric, $maxPeriods) { } /** * Build cohort response from raw snapshots */ protected function buildCohortResponse($snapshots, $groupBy, $metric, $maxPeriods) { } /** * Build cohort response from grouped data */ protected function buildCohortResponseFromGroups($cohortGroups, $groupBy, $metric, $maxPeriods) { } /** * Calculate weighted averages from accumulated data */ protected function calculateWeightedAverages($weightedData) { } /** * Return empty response structure */ protected function emptyResponse($groupBy, $metric, $maxPeriods) { } } } namespace FluentCart\App\Services\ShortCodeParser\Contracts { interface ParserContract { public function parse($accessor = null, $template = null): ?string; } } namespace FluentCart\App\Services\ShortCodeParser { trait ValueTransformer { public array $callableFunctions = ['trim', 'ucfirst', 'strtolower', 'strtoupper', 'ucwords']; public function transform($value, $code, $data) { } public function evaluateCondition($smartCode): array { } } } namespace FluentCart\App\Services\ShortCodeParser\Parsers { abstract class BaseParser implements \FluentCart\App\Services\ShortCodeParser\Contracts\ParserContract { use \FluentCart\App\Services\ShortCodeParser\ValueTransformer; protected $data = null; /** * @var array $instances * * This static property is used to cache the results of method and attribute lookups. * * The `BaseParser` class uses this array to store the values retrieved by the `get` method. * When a value is requested for a specific code, the `get` method first checks if the value * is already cached in this array. If it is, the cached value is returned, avoiding redundant * lookups or method calls. * * This caching mechanism improves performance by reducing the number of times the same * data needs to be retrieved or computed. */ protected static array $instances = []; /** * @var array $methodMap * * This property maps codes to their corresponding methods. * * The `BaseParser` class uses this array to determine which method to call * when a specific code is requested. The keys in this array are the codes, * and the values are the names of the methods to be called. * * For example, if the `methodMap` contains an entry `'affiliate_url' => 'getAffiliateUrl'`, * calling `get('affiliate_url')` will invoke the `getAffiliateUrl` method. */ protected array $methodMap = []; /** * @var array $attributeMap * * This property maps codes to their corresponding attributes in the data array. * * The `BaseParser` class uses this array to determine which attribute to retrieve * when a specific code is requested. The keys in this array are the codes, and the values * are the keys in the data array where the corresponding values can be found. * * For example, if the `attributeMap` contains an entry `'affiliate_name' => 'user_details.full_name'`, * calling `get('affiliate_name')` will retrieve the value stored in `$data['user_details']['full_name']`. */ protected array $attributeMap = []; public function __construct($data) { } /** * Abstract method to parse the given code. * * This method must be implemented by any subclass to define * how the parsing of the given code should be handled. * * @param null|string $accessor * @param null|string $template * @return string The parsed result. */ abstract public function parse($accessor = null, $template = null): ?string; /** * Retrieves the value for the given code. * * This method first checks if the value for the given code is already cached in the `static::$instances` array. * If it is, the cached value is returned. If not, it checks if the code corresponds to a method or an attribute. * If the code corresponds to a method, the `getByMethod` method is called to retrieve the value. * If the code corresponds to an attribute, the `getAttribute` method is called to retrieve the value. * If the code does not correspond to any method or attribute, a placeholder string with the code is returned. * * @param string|null $accessor The code representing the method or attribute to be retrieved. * @param string|null $template The code representing the method or attribute to be retrieved. * @return string The value associated with the given code, or a placeholder string if the code is not found. */ public function get(?string $accessor, ?string $template = null): ?string { } /** * Retrieves the value for the given code from the data array. * * This method uses the `attributeMap` array to find the corresponding key in the data array * and retrieves its value. The result is then stored in the `static::$instances` array * to avoid redundant lookups in the future. * * @param string $code The code representing the attribute to be retrieved. * @return string The value of the attribute associated with the given code. */ protected function getAttribute(string $code): string { } /** * Retrieves the value for the given code by invoking the corresponding method. * * This method checks the `methodMap` array for the provided code and calls the * associated method. The result is then stored in the `static::$instances` array * to avoid redundant method calls in the future. * * @param string $accessor The code representing the method to be called. * @param ?string $template The full shortcode. * @return string The result of the method call associated with the given code. */ protected function getByMethod(string $accessor, ?string $template, $conditions = []): ?string { } } class DownloadParser extends \FluentCart\App\Services\ShortCodeParser\Parsers\BaseParser { private $download; public function __construct($data) { } public function parse($accessor = null, $code = null, $transformer = null): ?string { } } class ItemParser extends \FluentCart\App\Services\ShortCodeParser\Parsers\BaseParser { private $item; private $order; public function __construct($data) { } public function parse($accessor = null, $code = null, $transformer = null): ?string { } /** * Get the item's other_info array. */ private function getOtherInfo() { } /** * Get a value from other_info. */ private function getFromOtherInfo($key, $default = '') { } /** * Get translated package type from other_info. */ private function getPackageType() { } /** * Get formatted dimensions from other_info. */ private function getFormattedDimensions() { } /** * Get formatted product weight from other_info. */ private function getFormattedProductWeight() { } /** * Get formatted shipping weight (product + package) from other_info. */ private function getFormattedShippingWeight() { } /** * Get the store's weight unit, cached per request. */ private function getStoreWeightUnit() { } } class LicenseParser extends \FluentCart\App\Services\ShortCodeParser\Parsers\BaseParser { private $license; public function __construct($data) { } public function parse($accessor = null, $code = null, $transformer = null): ?string { } } class OrderParser extends \FluentCart\App\Services\ShortCodeParser\Parsers\BaseParser { private \FluentCart\Api\StoreSettings $storeSettings; private $order; private $orderTz; private $licenses; private bool $licenseLoaded = false; private $subscriptions; private bool $subscriptionLoaded = false; public function __construct($data) { } // protected array $methodMap = [ // 'customer_dashboard_link' => 'getCustomerDashboardLink', // 'payment_summary' => 'getPaymentSummary', // 'payment_receipt' => 'getPaymentReceipt', // ]; protected array $methodMap = ['item_count' => 'getItemCount', 'is_digital' => 'getIsDigital', 'store_vat_display' => 'getStoreVatDisplay', 'store_company_name' => 'getStoreCompanyName', 'store_company_display' => 'getStoreCompanyDisplay', 'store_legal_registration_id' => 'getStoreLegalRegistrationId', 'store_legal_registration_display' => 'getStoreLegalRegistrationDisplay', 'store_seller_vat_id' => 'getStoreSellerVatId', 'store_seller_vat_display' => 'getStoreSellerVatDisplay', 'store_seller_tax_id' => 'getStoreSellerTaxId', 'store_tax_display' => 'getStoreTaxDisplay', 'buyer_vat_display' => 'getBuyerVatDisplay', 'buyer_company_name' => 'getBuyerCompanyName', 'buyer_legal_registration_id' => 'getBuyerLegalRegistrationId', 'buyer_reverse_charge_declaration' => 'getBuyerReverseChargeDeclaration', 'tax_breakdown' => 'getTaxBreakdown', 'fee_lines' => 'getFeeLines']; protected array $attributeMap = ['id' => 'order.id', 'status' => 'order.status', 'created_at' => 'order.created_at', 'updated_at' => 'order.updated_at']; protected array $centColumns = ['total_amount', 'subtotal', 'discount_tax', 'manual_discount_total', 'coupon_discount_total', 'shipping_tax', 'shipping_total', 'fee_total', 'tax_total', 'total_paid', 'total_refund']; public function parse($accessor = '', $code = '', $transformer = null): ?string { } public function shouldParseAddress($accessor): bool { } public function parseAddressFields($accessor) { } public function resolveAddressFieldKeys($accessor): array { } public function getAddressData($addressAccessor, $accessor = null) { } public function getPaymentSummary() { } public function getPaymentReceipt() { } public function getDiscountTotal(): string { } public function getDiscountTotalFormatted(): string { } private function getDiscountTotalInCents(): int { } public function getOrderRef(): string { } public function getCustomerDashboardAnchorLink($accessor, $code = null, $conditions = []) { } public function getCustomerDashboardLink($accessor, $code = null) { } public function getPaymentLink($accessor = null, $code = null) { } public function getAdminOrderLink($accessor, $code = null) { } public function getAdminOrderAnchorLink($accessor, $code = null, $conditions = []) { } public function getCustomerOrderLink($accessor, $code = null) { } public function getTotalAmount() { } public function getDownloads() { } public function getLicenses() { } public function getLicenseCount(): string { } public function getIsDigital(): string { } public function getItemCount(): string { } public function getPaymentMethodTitle(): string { } public function getFeeLines(): string { } public function getTaxBreakdown(): string { } /** * Wrap the accumulated tax-breakdown rows in their own grey rounded box, * right-aligned to a fixed 400px column. * * The tax breakdown is the only thing that lives inside the grey box; the * surrounding Subtotal/Discount/Shipping/Fees rows (above) and Refund/Total/ * Payment rows (below) are rendered as plain rows by the summary table and * stay outside this wrapper. A table-based 400px right-aligned wrapper is used * (not a div) so PDF renderers (mPDF/Dompdf) and email clients honour the * width/alignment, matching the boxed treatment on the thank-you/customer * surfaces. Consumed by the PDF receipt templates via {{order.tax_breakdown}}. * * @param string $rows Inner rows for the tax breakdown. * @return string A single cell carrying the grey box. */ private function wrapTaxBreakdownBox(string $rows): string { } private function resolveTaxRateLabel($orderTaxRate): string { } public function getSubscriptions() { } /** * Returns formatted store VAT display string, e.g. "VAT: NL123456789B01". * Returns empty string if no store VAT is configured for this order. */ public function getStoreVatDisplay(): string { } /** * Returns formatted buyer VAT display string, e.g. "VAT/Tax ID: XX123456". * Checks business_info first, then falls back to legacy VAT storage. */ public function getBuyerVatDisplay(): string { } /** * Returns buyer company name from billing address meta or VAT reverse charge data. */ public function getBuyerCompanyName(): string { } public function getBuyerLegalRegistrationId(): string { } public function getBuyerReverseChargeDeclaration(): string { } // ------------------------------------------------------------------------- // Store business info — reads from snapshotted fct_order_meta[store_business_info] // with live StoreSettings fallback for orders placed before this feature. // ------------------------------------------------------------------------- private function getStoreBusinessField(string $field): string { } public function getStoreCompanyName(): string { } public function getStoreCompanyDisplay(): string { } public function getStoreLegalRegistrationId(): string { } public function getStoreLegalRegistrationDisplay(): string { } public function getStoreSellerVatId(): string { } public function getStoreSellerVatDisplay(): string { } public function getStoreSellerTaxId(): string { } public function getStoreTaxDisplay(): string { } } class SettingsParser extends \FluentCart\App\Services\ShortCodeParser\Parsers\BaseParser { private \FluentCart\Api\StoreSettings $storeSettings; public function __construct($data) { } protected array $methodMap = ['store_logo' => 'getStoreLogo', 'store_brand' => 'getStoreBrandHtml', 'store_name' => 'getStoreName', 'store_address' => 'getStoreAddress', 'store_address2' => 'getStoreAddressLine2', 'store_country' => 'getStoreCountry', 'store_state' => 'getStoreState', 'store_city' => 'getStoreCity', 'store_postcode' => 'getStorePostcode', 'company_name' => 'getCompanyName', 'legal_registration_id' => 'getLegalRegistrationId', 'seller_vat_id' => 'getSellerVatId', 'seller_tax_id' => 'getSellerTaxId']; public function parse($accessor = null, $code = null): ?string { } public function getStoreLogoLink(): ?string { } public function getStoreLogo(): ?string { } public function getStoreName(): ?string { } public function getStoreBrandHtml(): ?string { } public function getStoreAddress() { } public function getStoreAddressLine2() { } public function getStoreCountry() { } public function getStoreState() { } public function getStoreCity() { } public function getStorePostcode() { } public function getCompanyName(): ?string { } public function getLegalRegistrationId(): ?string { } public function getSellerVatId(): ?string { } public function getSellerTaxId(): ?string { } } class SubscriptionParser extends \FluentCart\App\Services\ShortCodeParser\Parsers\BaseParser { private $subscription; public function __construct($data) { } public function parse($accessor = null, $code = null, $transformer = null): ?string { } } class TransactionParser extends \FluentCart\App\Services\ShortCodeParser\Parsers\BaseParser { private $transaction; public function __construct($data) { } protected array $centColumns = ['total']; public function parse($accessor = '', $code = '', $transformer = null): ?string { } public function getRefundAmount(): string { } public function getRefundAmountFormatted(): string { } } class UserParser extends \FluentCart\App\Services\ShortCodeParser\Parsers\BaseParser { private $user; private $userId; public function __construct($data) { } protected array $methodMap = ['admin_email' => 'getAdminEmail', 'site_url' => 'getSiteUrl', 'site_name' => 'getSiteName']; protected function setUser() { } public function parse($accessor = null, $code = null): ?string { } public function getID() { } public function getFirstName() { } public function getLastName() { } public function getDisplayName() { } public function getEmail() { } public function getUserEmail() { } private function getDataFromUser(string $key) { } } class WPParser extends \FluentCart\App\Services\ShortCodeParser\Parsers\BaseParser { protected array $methodMap = [ // 'admin_email' => 'getAdminEmail', 'site_url' => 'getSiteUrl', 'url' => 'getSiteUrl', ]; public function parse($accessor = null, $code = null): ?string { } public function getAdminEmail(): ?string { } public function getSiteUrl(): ?string { } public function getSiteName(): ?string { } } } namespace FluentCart\App\Services\ShortCodeParser { class ShortcodeParser { /* * * @param $content string|array * @param $order object with customer FluentCart\Api\Orders; getOrderWithCustomer; * @return string|array */ public static function parse($content, $parsable) { } public static function arrayIterator($contentArray, $order) { } public static function parseUserFields($userShortCodes, $user = null): array { } public static function parseCustomerFields($customerShortCodes, $customer): array { } public static function parseOthers($otherShortCodes, $order): array { } public static function parseTransaction($transactionShortCodes, $transaction): array { } public static function getSummary($order) { } public static function getReceipt($order) { } public static function replaceValue($parsedItems, $shortcodeValues) { } public static function parseInputFields($placeholders, $order): array { } public static function parseShortcode($parsableItems): array { } public static function nestedArrayItems($parsableItems): array { } public static function parseAddressFields($parsable, $data): array { } public static function splitName($data, $key = 'first_name') { } public static function parseWPFields($placeHolders, $order): array { } } class ShortcodeTemplateBuilder { protected ?\FluentCart\App\Services\ShortCodeParser\SmartCodeParser $parser; /** * TemplateBuilder constructor. */ public function __construct() { } /** * Factory method to create an instance of TemplateBuilder and parse the template. * * @param string $template * @param array $data * @return string * @throws \FluentCart\Framework\Container\Contracts\BindingResolutionException */ public static function make(string $template, array $data = []): string { } /** * Factory method to create an instance of TemplateBuilder and parse the template array. * * @param array $templates * @param array $data * @return array * @throws \FluentCart\Framework\Container\Contracts\BindingResolutionException */ public static function makeFromTemplatesArray(array $templates, array $data): array { } /** * Factory method to create an instance of TemplateBuilder and parse the template. * * @param array $templates * @param array $data * @return string * @throws \FluentCart\Framework\Container\Contracts\BindingResolutionException */ public static function makeFromTemplates(array $templates, array $data): string { } } class SmartCodeParser { use \FluentCart\App\Services\ShortCodeParser\ValueTransformer; /** * The application instance. * * @var \FluentCart\Framework\Foundation\Application */ protected \FluentCart\Framework\Foundation\Application $app; /** * Configuration instance. * * @var ?\FluentCart\Framework\Support\Collection */ protected ?\FluentCart\Framework\Support\Collection $config; /** * Hook Prefix. * * @var String */ protected string $hookPrefix; /** * SmartCodeParser constructor. */ public function __construct() { } /** * Parses the given code using the appropriate parser class. * * @param string $code * @param array $data * @return string * @throws \FluentCart\Framework\Container\Contracts\BindingResolutionException */ public function parse(string $code, array $data): ?string { } /** * Parses the given code using the appropriate parser class. * * @param string $code * @param mixed $data * @return string * @throws \FluentCart\Framework\Container\Contracts\BindingResolutionException */ public function parseCode(string $code, $data): ?string { } /** * Retrieves the appropriate parser class for the given code. * * @param string $code * @return ?string */ public function getParserClass(string $code): ?string { } /** * Retrieves the parse handler reference for the given template. * * @param string $template * @return array */ public function getParseHandlerReference(string $template): array { } /** * Retrieves the reference for the given template. * * @param string $template * @return string */ public function getReference(string $template): string { } /** * Parses the template with the given data. * * @param string $template * @param array $data * @return string * @throws \FluentCart\Framework\Container\Contracts\BindingResolutionException */ public function parseTemplate(string $template, array $data): string { } /** * Configures the parser with new settings. * @return SmartCodeParser */ public static function make(): \FluentCart\App\Services\ShortCodeParser\SmartCodeParser { } /** * Retrieves the template wrapper parts. * * @return array */ public function getTemplateWrapper(): array { } /** * Wraps the given code with the template wrapper. * * @param string $code * @return string */ public function wrapSmartCode(string $code): string { } } } namespace FluentCart\App\Services\Tax { /** * AdminOrderTaxService * * Calculates tax for admin-created or admin-edited orders. * Accepts plain items + address arrays instead of a live cart session. * Mirrors the config-building logic in TaxModule::calculateCartTax(). * * @since 1.3.11 */ class AdminOrderTaxService { /** * Calculate tax for a set of admin order items and a billing/shipping address. * * @param array $items Each item: ['post_id', 'object_id', 'qty', 'subtotal', 'discount_total'] * @param array $address ['country', 'state', 'city', 'postcode'] * * @return array{tax_total: int, shipping_tax: int, tax_lines: array, tax_behavior: int, tax_country: string}|null * Returns null when tax is disabled or country is missing. */ /** * Pick the correct tax address based on the store's tax_calculation_basis setting. * Falls back: shipping → billing when no shipping country; store → store config. * * @param string $basis 'billing' | 'shipping' | 'store' * @param array|null $billingAddress ['country', 'state', 'city', 'postcode'] * @param array|null $shippingAddress ['country', 'state', 'city', 'postcode'] * @return array */ public static function resolveAddressForBasis($basis, $billingAddress, $shippingAddress = null) { } public static function calculate($items, $address, $taxSettings = null) { } } class TaxManager { /** * @var TaxManager|null */ private static $instance = null; /** * @var array */ private $rates = []; /** * @var array */ private $config = []; /** * @var array */ private array $descriptionMap = []; /** * @var array */ private array $countryEnabledCache = []; /** ISO country codes whose rates are stored under a parent country with state=. */ private array $parentCountryMap = []; /** * Private constructor to prevent direct instantiation */ private function __construct() { } /** * Get the singleton instance * * @return TaxManager */ public static function getInstance(): \FluentCart\App\Services\Tax\TaxManager { } /** * Get all tax rates * * @return array */ public function getRates(): array { } /** * Generate human-readable label from a tax key * * @param string $key * @return string */ private function formatLabel(string $key): string { } /** * Iterate all countries and collect all unique tax labels * * @return array */ public function generateAllTaxLabels($only = []): array { } public function generateTaxClasses($only = []) { } public function getEuTaxRatesFromPhp(string $country = '', $taxClassSlug = ''): array { } public function getTaxRatesFromTaxPhp(): array { } public function getTaxRates(): array { } /** * Map territory country codes (e.g. GP) to their parent country + state * so tax rate lookups hit the correct DB rows (e.g. country=FR, state=GP). */ public function resolveTaxCountryAndState(string $country, ?string $state): array { } public function normalizeTaxStatusCountryCode(string $countryCode): string { } public function getCountryTaxEnabledMetaKey(string $countryCode): string { } public function getCountryTaxEnabledMap(array $countryCodes): array { } public function isTaxEnabledForCountry(string $countryCode): bool { } public function setTaxEnabledForCountry(string $countryCode, bool $enabled): void { } private function parseCountryTaxEnabledValue($metaValue): bool { } public function groupTaxRatesByGroup($taxRates): array { } public function getCountryConfiguration(string $countryCode) { } private function buildDefaultRateLabel(string $countryCode): string { } public function resetEuRates($classSlug = 'standard'): void { } public static function getProductOverrideById($overrideId) { } public static function clearShippingOverrideById($taxRateId) { } // EU VAT registration helpers — stored in fct_meta, keyed by country code. public function getEuVatRegistrations() { } public function getEuVatRegistration($country) { } public function saveEuVatRegistration($country, $data) { } public function deleteEuVatRegistration($country) { } } } namespace FluentCart\App\Services { class TemplateService { public static function getTemplateByPathName($name, $viewData) { } public static function getInvoicePackingTemplateByPathName($name) { } public static function getCurrentFcPageType() { } public static function isFcPageType($type) { } public static function getCustomerProfileUrl($extension = '') { } public static function getAdminUrl($extension = '') { } public static function getCelebration($type = 'order') { } } } namespace FluentCart\App\Services\Theme { class AdminTheme { const DARK_CLASS = 'fluent_theme_dark'; public static function applyTheme() { } } class ColorPaletteGenerator { private function hexToRgb($hex) { } private function rgbToHex($r, $g, $b) { } private function rgbToHsl($r, $g, $b) { } private function hslToRgb($h, $s, $l) { } private function contrastColor($color): array { } public function generateColorPalette($hex) { } } class FrontendTheme { public static function applyTheme() { } protected function apply() { } protected function get(): array { } protected function prepareInlineStyle(array $data): string { } } } namespace FluentCart\App\Services\Translations { class TransStrings { public static function getStrings(): array { } public static function blockStrings(): array { } public static function getShopAppBlockEditorString(): array { } public static function getCustomerProfileString(): array { } public static function singleProductPageString(): array { } public static function checkoutPageString() { } public static function paymentsString() { } public static function elStrings(): array { } public static function dateTimeStrings(): array { } } } namespace FluentCart\App\Services { class URL { /** * Append query parameters to a URI, ensuring proper formatting * * @param string $uri Base URI to append parameters to * @param array $params Query parameters to append * @return string URI with appended query parameters */ public static function appendQueryParams(string $uri, $params = []): string { } public static function getFrontEndUrl($page = '', $params = []): string { } public static function getApiUrl($path = '', $params = null): string { } public static function getDashboardUrl(string $path, $params = null): string { } public static function getCustomerDashboardUrl($path): string { } public static function getCustomerOrderUrl($uuid): string { } } } namespace FluentCart\App\Services\Widgets { abstract class BaseWidget { abstract public function widgetName(): string; abstract public function widgetData(): array; public static function widgets(): array { } } class DashboardWidget extends \FluentCart\App\Services\Widgets\BaseWidget { public function widgetName(): string { } public function widgetData(): array { } } } namespace FluentCart\App\Services { /** * Entry MetaDat * @since 1.0.0 */ class WpMetaHelper { protected $entry; protected $userId; protected $queryVars = null; protected $user; public function __construct($entry) { } public function getWPValues($key) { } public function getuserMeta($key) { } public function getOtherData($key) { } protected function getUser() { } public function getStoreLogo(): string { } } } namespace FluentCart\App { class Vite { private array $moduleScripts = []; private bool $isScriptFilterAdded = false; private string $viteHostProtocol = 'http://'; private string $viteHost = 'localhost'; private string $vitePort = '8880'; private string $resourceDirectory = 'resources/'; protected static ?\FluentCart\App\Vite $instance = null; public ?string $lastJsHandel = null; private ?array $manifestData = null; public function __construct() { } private static function getInstance(): \FluentCart\App\Vite { } /** * @throws \Exception */ private function loadViteManifest() { } public static function enqueueScript($handle, $src, $dependency = [], $version = null, $inFooter = false): \FluentCart\App\Vite { } private function enqueue_script($handle, $src, $dependency = [], $version = null, $inFooter = false): \FluentCart\App\Vite { } private function getFileFromManifest($src) { } private function getProductionFilePath($file): string { } private function ensureChunkCssIsLoaded($file) { } public function with($params) { } public static function enqueueStyle($handle, $src, $dependency = [], $version = null, $media = 'all') { } private function enqueue_style($handle, $src, $dependency = [], $version = null, $media = 'all') { } public static function enqueueStaticScript($handle, $src, $dependency = [], $version = null, $inFooter = false): \FluentCart\App\Vite { } private function enqueue_static_script($handle, $src, $dependency = [], $version = null, $inFooter = false): \FluentCart\App\Vite { } private function getStaticEnqueuePath($path): string { } public static function enqueueStaticStyle($handle, $src, $dependency = [], $version = null, $media = 'all') { } private function enqueue_static_style($handle, $src, $dependency = [], $version = null, $media = 'all') { } public static function underDevelopment(): bool { } public function usingDevMode(): bool { } public function getVitePath(): string { } public static function getEnqueuePath($path = ''): string { } public static function getAssetUrl($path = ''): string { } private function get_asset_url($path = ''): string { } static function getAssetPath(): string { } private function addModuleToScript($tag, $handle, $src) { } public static function enqueueAllScripts(array $scripts, string $handlePrefix, $localizeableData = []) { } public static function enqueueAllStyles(array $styles, string $handlePrefix) { } public static function printAllScripts(array $scripts, string $handlePrefix, $localizeableData = []) { } public static function printAllStyles(array $styles, string $handlePrefix) { } } } namespace FluentCart\Framework\Cache { class Cache { protected static $cacheDir = null; /** * Initialize the cache directory. */ public static function init($cacheDir = null) { } /** * Resolve cache directory. * * @param string|null $cacheDir * @return string */ public static function getDir($cacheDir = null) { } /** * Store data in the cache using transients. * * @param string $key * @param mixed $value * @param int $ttl Time to live (in seconds) * @return bool */ public static function put($key, $value, $ttl = HOUR_IN_SECONDS) { } /** * Store data in the cache using transients. * * @param string $key * @param mixed $value * @param int $ttl Time to live (in seconds) * @return bool */ public static function set($key, $value, $ttl = HOUR_IN_SECONDS) { } /** * Retrieve data from the cache. * * @param string $key * @return mixed */ public static function get($key) { } /** * Remove data from the cache. * * @param string $key * @return bool */ public static function forget($key) { } /** * The group key for the cache. * * @return string */ public static function cacheGroup() { } /** * Store data in the cache "forever" using 5 years of expiry time. * * @param string $key * @param mixed $value * @return bool */ public static function forever($key, $value) { } /** * Get an item from the cache, or store the default value if not present. * * @param string $key * @param \Closure $callback * @param int $ttl Time to live (in seconds) * @return mixed */ public static function remember($key, \Closure $callback, $ttl = HOUR_IN_SECONDS) { } /** * Increment the value of an item in the cache. * * @param string $key * @param integer $count * @return bool */ public static function increment($key, $count = 1) { } /** * Decrement the value of an item in the cache. * * @param string $key * @param integer $count * @return bool */ public static function decrement($key, $count = 1) { } /** * Delete all cached items for the plugin. * * @return void */ public static function flush() { } /** * Check if a key exists in the cache. * * @param string $key * @return bool */ public static function has($key) { } /** * Make unique key with config.app.slug * * @param string $key * @return string */ protected static function key($key) { } /** * Check if persistent cache is available. * * @return bool */ protected static function isPersistent() { } /** * Store data in a file if no persistent cache is available. * * @param string $key * @param mixed $data * @param int $expiration */ protected static function filePut($key, $data, $expiration) { } /** * Store the data in a file if no persistent cache is available. * * @param string $key * @param mixed $payload * @return bool */ protected static function store($key, $payload) { } /** * Retrieve data from the file cache. * * @param string $key * @return mixed|null */ protected static function fileGet($key) { } /** * Remove an item from the file cache. * * @param string $key * @return bool */ protected static function fileForget($key) { } /** * Flush all file cache entries. * * @return bool */ protected static function fileFlush() { } } } namespace FluentCart\Framework\Container { class BoundMethod { /** * Call the given Closure / class@method and inject its dependencies. * * @param \FluentCart\Framework\Container\Container $container * @param callable|string $callback * @param array $parameters * @param string|null $defaultMethod * @return mixed * * @throws \ReflectionException * @throws \InvalidArgumentException */ public static function call($container, $callback, array $parameters = [], $defaultMethod = null) { } /** * Call a string reference to a class using Class@method syntax. * * @param \FluentCart\Framework\Container\Container $container * @param string $target * @param array $parameters * @param string|null $defaultMethod * @return mixed * * @throws \InvalidArgumentException */ protected static function callClass($container, $target, array $parameters = [], $defaultMethod = null) { } /** * Call a method that has been bound to the container. * * @param \FluentCart\Framework\Container\Container $container * @param callable $callback * @param mixed $default * @return mixed */ protected static function callBoundMethod($container, $callback, $default) { } /** * Normalize the given callback into a Class@method string. * * @param callable $callback * @return string */ protected static function normalizeMethod($callback) { } /** * Get all dependencies for a given method. * * @param \FluentCart\Framework\Container\Container $container * @param callable|string $callback * @param array $parameters * @return array * * @throws \ReflectionException */ protected static function getMethodDependencies($container, $callback, array $parameters = []) { } /** * Get the proper reflection instance for the given callback. * * @param callable|string $callback * @return \ReflectionFunctionAbstract * * @throws \ReflectionException */ protected static function getCallReflector($callback) { } /** * Get the dependency for the given call parameter. * * @param \FluentCart\Framework\Container\Container $container * @param \ReflectionParameter $parameter * @param array $parameters * @param array $dependencies * @return void * * @throws \FluentCart\Framework\Container\Contracts\BindingResolutionException */ protected static function addDependencyForCallParameter($container, $parameter, array &$parameters, &$dependencies) { } /** * Determine if the given string is in Class@method syntax. * * @param mixed $callback * @return bool */ protected static function isCallableWithAtSign($callback) { } } } namespace FluentCart\Framework\Container\Contracts\Psr { /** * Describes the interface of a container that exposes methods to read its entries. */ interface ContainerInterface { /** * Finds an entry of the container by its identifier and returns it. * * @param string $id Identifier of the entry to look for. * * @throws NotFoundExceptionInterface No entry was found for **this** identifier. * @throws ContainerExceptionInterface Error while retrieving the entry. * * @return mixed Entry. */ public function get(string $id); /** * Returns true if the container can return an entry for the given identifier. * Returns false otherwise. * * `has($id)` returning true does not mean that `get($id)` will not throw an exception. * It does however mean that `get($id)` will not throw a `NotFoundExceptionInterface`. * * @param string $id Identifier of the entry to look for. * * @return bool */ public function has(string $id); } } namespace FluentCart\Framework\Container\Contracts { interface Container extends \FluentCart\Framework\Container\Contracts\Psr\ContainerInterface { /** * Determine if the given abstract type has been bound. * * @param string $abstract * @return bool */ public function bound($abstract); /** * Alias a type to a different name. * * @param string $abstract * @param string $alias * @return void * * @throws \LogicException */ public function alias($abstract, $alias); /** * Assign a set of tags to a given binding. * * @param array|string $abstracts * @param array|mixed ...$tags * @return void */ public function tag($abstracts, $tags); /** * Resolve all of the bindings for a given tag. * * @param string $tag * @return iterable */ public function tagged($tag); /** * Register a binding with the container. * * @param string $abstract * @param \Closure|string|null $concrete * @param bool $shared * @return void */ public function bind($abstract, $concrete = null, $shared = false); /** * Register a binding if it hasn't already been registered. * * @param string $abstract * @param \Closure|string|null $concrete * @param bool $shared * @return void */ public function bindIf($abstract, $concrete = null, $shared = false); /** * Register a shared binding in the container. * * @param string $abstract * @param \Closure|string|null $concrete * @return void */ public function singleton($abstract, $concrete = null); /** * Register a shared binding if it hasn't already been registered. * * @param string $abstract * @param \Closure|string|null $concrete * @return void */ public function singletonIf($abstract, $concrete = null); /** * "Extend" an abstract type in the container. * * @param string $abstract * @param \Closure $closure * @return void * * @throws \InvalidArgumentException */ public function extend($abstract, \Closure $closure); /** * Register an existing instance as shared in the container. * * @param string $abstract * @param mixed $instance * @return mixed */ public function instance($abstract, $instance); /** * Add a contextual binding to the container. * * @param string $concrete * @param string $abstract * @param \Closure|string $implementation * @return void */ public function addContextualBinding($concrete, $abstract, $implementation); /** * Define a contextual binding. * * @param string|array $concrete * @return \FluentCart\Framework\Container\Contracts\ContextualBindingBuilder */ public function when($concrete); /** * Get a closure to resolve the given type from the container. * * @param string $abstract * @return \Closure */ public function factory($abstract); /** * Flush the container of all bindings and resolved instances. * * @return void */ public function flush(); /** * Resolve the given type from the container. * * @param string $abstract * @param array $parameters * @return mixed * * @throws \FluentCart\Framework\Container\Contracts\BindingResolutionException */ public function make($abstract, array $parameters = []); /** * Call the given Closure / class@method and inject its dependencies. * * @param callable|string $callback * @param array $parameters * @param string|null $defaultMethod * @return mixed */ public function call($callback, array $parameters = [], $defaultMethod = null); /** * Determine if the given abstract type has been resolved. * * @param string $abstract * @return bool */ public function resolved($abstract); /** * Register a new resolving callback. * * @param \Closure|string $abstract * @param \Closure|null $callback * @return void */ public function resolving($abstract, ?\Closure $callback = null); /** * Register a new after resolving callback. * * @param \Closure|string $abstract * @param \Closure|null $callback * @return void */ public function afterResolving($abstract, ?\Closure $callback = null); } } namespace FluentCart\Framework\Container { class Container implements \ArrayAccess, \FluentCart\Framework\Container\Contracts\Container { /** * The current globally available container (if any). * * @var static */ protected static $instance; /** * An array of the types that have been resolved. * * @var bool[] */ protected $resolved = []; /** * The container's bindings. * * @var array[] */ protected $bindings = []; /** * The container's method bindings. * * @var \Closure[] */ protected $methodBindings = []; /** * The container's shared instances. * * @var object[] */ protected $instances = []; /** * The container's scoped instances. * * @var array */ protected $scopedInstances = []; /** * The registered type aliases. * * @var string[] */ protected $aliases = []; /** * The registered aliases keyed by the abstract name. * * @var array[] */ protected $abstractAliases = []; /** * The extension closures for services. * * @var array[] */ protected $extenders = []; /** * All of the registered tags. * * @var array[] */ protected $tags = []; /** * The stack of concretions currently being built. * * @var array[] */ protected $buildStack = []; /** * The parameter override stack. * * @var array[] */ protected $with = []; /** * The contextual binding map. * * @var array[] */ public $contextual = []; /** * All of the registered rebound callbacks. * * @var array[] */ protected $reboundCallbacks = []; /** * All of the global before resolving callbacks. * * @var \Closure[] */ protected $globalBeforeResolvingCallbacks = []; /** * All of the global resolving callbacks. * * @var \Closure[] */ protected $globalResolvingCallbacks = []; /** * All of the global after resolving callbacks. * * @var \Closure[] */ protected $globalAfterResolvingCallbacks = []; /** * All of the before resolving callbacks by class type. * * @var array[] */ protected $beforeResolvingCallbacks = []; /** * All of the resolving callbacks by class type. * * @var array[] */ protected $resolvingCallbacks = []; /** * All of the after resolving callbacks by class type. * * @var array[] */ protected $afterResolvingCallbacks = []; /** * Define a contextual binding. * * @param array|string $concrete * @return \FluentCart\Framework\Container\Contracts\ContextualBindingBuilder */ public function when($concrete) { } /** * Determine if the given abstract type has been bound. * * @param string $abstract * @return bool */ public function bound($abstract) { } /** * {@inheritdoc} * * @return bool */ public function has($id) { } /** * Determine if the given abstract type has been resolved. * * @param string $abstract * @return bool */ public function resolved($abstract) { } /** * Determine if a given type is shared. * * @param string $abstract * @return bool */ public function isShared($abstract) { } /** * Determine if a given string is an alias. * * @param string $name * @return bool */ public function isAlias($name) { } /** * Register a binding with the container. * * @param string $abstract * @param \Closure|string|null $concrete * @param bool $shared * @return void * * @throws \TypeError */ public function bind($abstract, $concrete = null, $shared = false) { } /** * Get the Closure to be used when building a type. * * @param string $abstract * @param string $concrete * @return \Closure */ protected function getClosure($abstract, $concrete) { } /** * Determine if the container has a method binding. * * @param string $method * @return bool */ public function hasMethodBinding($method) { } /** * Bind a callback to resolve with Container::call. * * @param array|string $method * @param \Closure $callback * @return void */ public function bindMethod($method, $callback) { } /** * Get the method to be bound in class@method format. * * @param array|string $method * @return string */ protected function parseBindMethod($method) { } /** * Get the method binding for the given method. * * @param string $method * @param mixed $instance * @return mixed */ public function callMethodBinding($method, $instance) { } /** * Add a contextual binding to the container. * * @param string $concrete * @param string $abstract * @param \Closure|string $implementation * @return void */ public function addContextualBinding($concrete, $abstract, $implementation) { } /** * Register a binding if it hasn't already been registered. * * @param string $abstract * @param \Closure|string|null $concrete * @param bool $shared * @return void */ public function bindIf($abstract, $concrete = null, $shared = false) { } /** * Register a shared binding in the container. * * @param string $abstract * @param \Closure|string|null $concrete * @return void */ public function singleton($abstract, $concrete = null) { } /** * Register a shared binding if it hasn't already been registered. * * @param string $abstract * @param \Closure|string|null $concrete * @return void */ public function singletonIf($abstract, $concrete = null) { } /** * Register a scoped binding in the container. * * @param string $abstract * @param \Closure|string|null $concrete * @return void */ public function scoped($abstract, $concrete = null) { } /** * Register a scoped binding if it hasn't already been registered. * * @param string $abstract * @param \Closure|string|null $concrete * @return void */ public function scopedIf($abstract, $concrete = null) { } /** * "Extend" an abstract type in the container. * * @param string $abstract * @param \Closure $closure * @return void * * @throws \InvalidArgumentException */ public function extend($abstract, \Closure $closure) { } /** * Register an existing instance as shared in the container. * * @param string $abstract * @param mixed $instance * @return mixed */ public function instance($abstract, $instance) { } /** * Remove an alias from the contextual binding alias cache. * * @param string $searched * @return void */ protected function removeAbstractAlias($searched) { } /** * Assign a set of tags to a given binding. * * @param array|string $abstracts * @param array|mixed ...$tags * @return void */ public function tag($abstracts, $tags) { } /** * Resolve all of the bindings for a given tag. * * @param string $tag * @return iterable */ public function tagged($tag) { } /** * Alias a type to a different name. * * @param string $abstract * @param string $alias * @return void * * @throws \LogicException */ public function alias($abstract, $alias) { } /** * Bind a new callback to an abstract's rebind event. * * @param string $abstract * @param \Closure $callback * @return mixed */ public function rebinding($abstract, \Closure $callback) { } /** * Refresh an instance on the given target and method. * * @param string $abstract * @param mixed $target * @param string $method * @return mixed */ public function refresh($abstract, $target, $method) { } /** * Fire the "rebound" callbacks for the given abstract type. * * @param string $abstract * @return void */ protected function rebound($abstract) { } /** * Get the rebound callbacks for a given type. * * @param string $abstract * @return array */ protected function getReboundCallbacks($abstract) { } /** * Wrap the given closure such that its dependencies will be injected when executed. * * @param \Closure $callback * @param array $parameters * @return \Closure */ public function wrap(\Closure $callback, array $parameters = []) { } /** * Call the given Closure / class@method and inject its dependencies. * * @param callable|string $callback * @param array $parameters * @param string|null $defaultMethod * @return mixed * * @throws \InvalidArgumentException */ public function call($callback, array $parameters = [], $defaultMethod = null) { } /** * Get a closure to resolve the given type from the container. * * @param string $abstract * @return \Closure */ public function factory($abstract) { } /** * An alias function name for make(). * * @param string|callable $abstract * @param array $parameters * @return mixed * * @throws \FluentCart\Framework\Container\Contracts\BindingResolutionException */ public function makeWith($abstract, array $parameters = []) { } /** * Resolve the given type from the container. * * @param string|callable $abstract * @param array $parameters * @return mixed * * @throws \FluentCart\Framework\Container\Contracts\BindingResolutionException */ public function make($abstract, array $parameters = []) { } /** * Try to resolve the given service from the Framework context. * * @param string|null $module [description] * @return string */ protected function retry($module) { } /** * {@inheritdoc} * * @return mixed */ public function get($id) { } /** * Resolve the given type from the container. * * @param string|callable $abstract * @param array $parameters * @param bool $raiseEvents * @return mixed * * @throws \FluentCart\Framework\Container\Contracts\BindingResolutionException * @throws \FluentCart\Framework\Container\Contracts\CircularDependencyException */ protected function resolve($abstract, $parameters = [], $raiseEvents = true) { } /** * Get the concrete type for a given abstract. * * @param string|callable $abstract * @return mixed */ protected function getConcrete($abstract) { } /** * Get the contextual concrete binding for the given abstract. * * @param string|callable $abstract * @return \Closure|string|array|null */ protected function getContextualConcrete($abstract) { } /** * Find the concrete binding for the given abstract * in the contextual binding array. * * @param string|callable $abstract * @return \Closure|string|null */ protected function findInContextualBindings($abstract) { } /** * Determine if the given concrete is buildable. * * @param mixed $concrete * @param string $abstract * @return bool */ protected function isBuildable($concrete, $abstract) { } /** * Instantiate a concrete instance of the given type. * * @param \Closure|string $concrete * @return mixed * * @throws \FluentCart\Framework\Container\Contracts\BindingResolutionException * @throws \FluentCart\Framework\Container\Contracts\CircularDependencyException */ public function build($concrete) { } /** * Resolve all of the dependencies from the ReflectionParameters. * * @param \ReflectionParameter[] $dependencies * @return array * * @throws \FluentCart\Framework\Container\Contracts\BindingResolutionException */ protected function resolveDependencies(array $dependencies) { } /** * Determine if the given dependency has a parameter override. * * @param \ReflectionParameter $dependency * @return bool */ protected function hasParameterOverride($dependency) { } /** * Get a parameter override for a dependency. * * @param \ReflectionParameter $dependency * @return mixed */ protected function getParameterOverride($dependency) { } /** * Get the last parameter override. * * @return array */ protected function getLastParameterOverride() { } /** * Resolve a non-class hinted primitive dependency. * * @param \ReflectionParameter $parameter * @return mixed * * @throws \FluentCart\Framework\Container\Contracts\BindingResolutionException */ protected function resolvePrimitive(\ReflectionParameter $parameter) { } /** * Resolve a class based dependency from the container. * * @param \ReflectionParameter $parameter * @return mixed * * @throws \FluentCart\Framework\Container\Contracts\BindingResolutionException */ protected function resolveClass(\ReflectionParameter $parameter) { } /** * Resolve a class based variadic dependency from the container. * * @param \ReflectionParameter $parameter * @return mixed */ protected function resolveVariadicClass(\ReflectionParameter $parameter) { } /** * Throw an exception that the concrete is not instantiable. * * @param string $concrete * @return never * * @throws \FluentCart\Framework\Container\Contracts\BindingResolutionException */ protected function notInstantiable($concrete) { } /** * Throw an exception for an unresolvable primitive. * * @param \ReflectionParameter $parameter * @return void * * @throws \FluentCart\Framework\Container\Contracts\BindingResolutionException */ protected function unresolvablePrimitive(\ReflectionParameter $parameter) { } /** * Register a new before resolving callback for all types. * * @param \Closure|string $abstract * @param \Closure|null $callback * @return void */ public function beforeResolving($abstract, ?\Closure $callback = null) { } /** * Register a new resolving callback. * * @param \Closure|string $abstract * @param \Closure|null $callback * @return void */ public function resolving($abstract, ?\Closure $callback = null) { } /** * Register a new after resolving callback for all types. * * @param \Closure|string $abstract * @param \Closure|null $callback * @return void */ public function afterResolving($abstract, ?\Closure $callback = null) { } /** * Fire all of the before resolving callbacks. * * @param string $abstract * @param array $parameters * @return void */ protected function fireBeforeResolvingCallbacks($abstract, $parameters = []) { } /** * Fire an array of callbacks with an object. * * @param string $abstract * @param array $parameters * @param array $callbacks * @return void */ protected function fireBeforeCallbackArray($abstract, $parameters, array $callbacks) { } /** * Fire all of the resolving callbacks. * * @param string $abstract * @param mixed $object * @return void */ protected function fireResolvingCallbacks($abstract, $object) { } /** * Fire all of the after resolving callbacks. * * @param string $abstract * @param mixed $object * @return void */ protected function fireAfterResolvingCallbacks($abstract, $object) { } /** * Get all callbacks for a given type. * * @param string $abstract * @param object $object * @param array $callbacksPerType * @return array */ protected function getCallbacksForType($abstract, $object, array $callbacksPerType) { } /** * Fire an array of callbacks with an object. * * @param mixed $object * @param array $callbacks * @return void */ protected function fireCallbackArray($object, array $callbacks) { } /** * Get the container's bindings. * * @return array */ public function getBindings() { } /** * Get the alias for an abstract if available. * * @param string $abstract * @return string */ public function getAlias($abstract) { } /** * Get the extender callbacks for a given type. * * @param string $abstract * @return array */ protected function getExtenders($abstract) { } /** * Remove all of the extender callbacks for a given type. * * @param string $abstract * @return void */ public function forgetExtenders($abstract) { } /** * Drop all of the stale instances and aliases. * * @param string $abstract * @return void */ protected function dropStaleInstances($abstract) { } /** * Remove a resolved instance from the instance cache. * * @param string $abstract * @return void */ public function forgetInstance($abstract) { } /** * Clear all of the instances from the container. * * @return void */ public function forgetInstances() { } /** * Clear all of the scoped instances from the container. * * @return void */ public function forgetScopedInstances() { } /** * Flush the container of all bindings and resolved instances. * * @return void */ public function flush() { } /** * Get the globally available instance of the container. * * @return static */ public static function getInstance() { } /** * Set the shared instance of the container. * * @param \FluentCart\Framework\Container\Contracts\Container|null $container * @return \FluentCart\Framework\Container\Contracts\Container|static */ public static function setInstance(?\FluentCart\Framework\Container\Contracts\Container $container = null) { } /** * Determine if a given offset exists. * * @param string $key * @return bool */ #[\ReturnTypeWillChange] public function offsetExists($key) { } /** * Get the value at a given offset. * * @param string $key * @return mixed */ #[\ReturnTypeWillChange] public function offsetGet($key) { } /** * Set the value at a given offset. * * @param string $key * @param mixed $value * @return void */ #[\ReturnTypeWillChange] public function offsetSet($key, $value) { } /** * Unset the value at a given offset. * * @param string $key * @return void */ #[\ReturnTypeWillChange] public function offsetUnset($key) { } /** * Dynamically access container services. * * @param string $key * @return mixed */ public function __get($key) { } /** * Dynamically set container services. * * @param string $key * @param mixed $value * @return void */ public function __set($key, $value) { } } } namespace FluentCart\Framework\Container\Contracts { interface ContextualBindingBuilder { /** * Define the abstract target that depends on the context. * * @param string $abstract * @return $this */ public function needs($abstract); /** * Define the implementation for the contextual binding. * * @param \Closure|string|array $implementation * @return void */ public function give($implementation); /** * Define tagged services to be used as the implementation for the contextual binding. * * @param string $tag * @return void */ public function giveTagged($tag); } } namespace FluentCart\Framework\Container { class ContextualBindingBuilder implements \FluentCart\Framework\Container\Contracts\ContextualBindingBuilder { /** * The underlying container instance. * * @var \FluentCart\Framework\Container\Contracts\Container */ protected $container; /** * The concrete instance. * * @var string|array */ protected $concrete; /** * The abstract target. * * @var string */ protected $needs; /** * Create a new contextual binding builder. * * @param \FluentCart\Framework\Container\Contracts\Container $container * @param string|array $concrete * @return void */ public function __construct(\FluentCart\Framework\Container\Contracts\Container $container, $concrete) { } /** * Define the abstract target that depends on the context. * * @param string $abstract * @return $this */ public function needs($abstract) { } /** * Define the implementation for the contextual binding. * * @param \Closure|string|array $implementation * @return void */ public function give($implementation) { } /** * Define tagged services to be used as the implementation for the contextual binding. * * @param string $tag * @return void */ public function giveTagged($tag) { } /** * Specify the configuration item to bind as a primitive. * * @param string $key * @param ?string $default * @return void */ public function giveConfig($key, $default = null) { } } } namespace FluentCart\Framework\Container\Contracts\Psr { /** * Base interface representing a generic exception in a container. */ interface ContainerExceptionInterface extends \Throwable { } } namespace FluentCart\Framework\Container\Contracts { class BindingResolutionException extends \Exception implements \FluentCart\Framework\Container\Contracts\Psr\ContainerExceptionInterface { // } class CircularDependencyException extends \Exception implements \FluentCart\Framework\Container\Contracts\Psr\ContainerExceptionInterface { // } } namespace FluentCart\Framework\Container\Contracts\Psr { /** * No entry was found in the container. */ interface NotFoundExceptionInterface extends \FluentCart\Framework\Container\Contracts\Psr\ContainerExceptionInterface { } } namespace FluentCart\Framework\Container { class EntryNotFoundException extends \Exception implements \FluentCart\Framework\Container\Contracts\Psr\NotFoundExceptionInterface { // } class RewindableGenerator implements \Countable, \IteratorAggregate { /** * The generator callback. * * @var callable */ protected $generator; /** * The number of tagged services. * * @var callable|int */ protected $count; /** * Create a new generator instance. * * @param callable $generator * @param callable|int $count * @return void */ public function __construct(callable $generator, $count) { } /** * Get an iterator from the generator. * * @return mixed */ #[\ReturnTypeWillChange] public function getIterator() { } /** * Get the total number of tagged services. * * @return int */ #[\ReturnTypeWillChange] public function count() { } } /** * @internal */ class Util { /** * If the given value is not an array and not null, wrap it in one. * * From Arr::wrap() in FluentCart\Framework\Support. * * @param mixed $value * @return array */ public static function arrayWrap($value) { } /** * Return the default value of the given value. * * From global value() helper in FluentCart\Framework\Support. * * @param mixed $value * @return mixed */ public static function unwrapIfClosure($value) { } /** * Get the class name of the given parameter's type, if possible. * * From Reflector::getParameterClassName() in FluentCart\Framework\Support. * * @param \ReflectionParameter $parameter * @return string|null */ public static function getParameterClassName($parameter) { } } } namespace FluentCart\Framework\Database { abstract class BaseGrammar { use \FluentCart\Framework\Support\MacroableTrait; /** * Cache of aliased table names. * * @var array */ protected $alias = []; /** * The connection used for escaping values. * * @var \FluentCart\Framework\Database\ConnectionInterface */ protected $connection; /** * The base prefix frpm $wpdb. * * @var string */ protected $basePrefix = ''; /** * The grammar table prefix. * * @var string */ protected $tablePrefix = ''; /** * Check if the given table is a built-in table. * * @param string $table * @return boolean */ public function isAliasedTable($table) { } /** * Wrap an array of values. * * @param array $values * @return array */ public function wrapArray(array $values) { } /** * Wrap a value in keyword identifiers. * * @param \FluentCart\Framework\Database\Query\Expression|string $value * @return string */ public function wrap($value) { } /** * Wrap a table in keyword identifiers. * * @param \FluentCart\Framework\Database\Query\Expression|string $table * @return string */ public function wrapTable($table) { } /** * Resolve the table prefix based on the table name. * * @param string $table * @return string */ protected function resolveTablePrefix($table) { } /** * Wrap a value that has an alias. * * @param string $value * @return string */ protected function wrapAliasedValue($value) { } /** * Wrap a table that has an alias. * * @param string $value * @return string */ protected function wrapAliasedTable($value) { } /** * Wrap the given value segments. * * @param array $segments * @return string */ protected function wrapSegments($segments) { } /** * Wrap a single string in keyword identifiers. * * @param string $value * @return string */ protected function wrapValue($value) { } /** * Wrap the given JSON selector. * * @param string $value * @return string * * @throws \RuntimeException */ protected function wrapJsonSelector($value) { } /** * Determine if the given string is a JSON selector. * * @param string $value * @return bool */ protected function isJsonSelector($value) { } /** * Convert an array of column names into a delimited string. * * @param array $columns * @return string */ public function columnize(array $columns) { } /** * Create query parameter place-holders for an array. * * @param array $values * @return string */ public function parameterize(array $values) { } /** * Get the appropriate query parameter place-holder for a value. * * @param mixed $value * @return string */ public function parameter($value) { } /** * Quote the given string literal. * * @param string|array $value * @return string */ public function quoteString($value) { } /** * Escapes a value for safe SQL embedding. * * @param string|float|int|bool|null $value * @param bool $binary * @return string */ public function escape($value, $binary = false) { } /** * Determine if the given value is a raw expression. * * @param mixed $value * @return bool */ public function isExpression($value) { } /** * Transforms expressions to their scalar types. * * @param \FluentCart\Framework\Database\Query\Expression|string|int|float $expression * @return string|int|float */ public function getValue($expression) { } /** * Get the format for database stored dates. * * @return string */ public function getDateFormat() { } /** * Get the grammar's table prefix. * * @return string */ public function getTablePrefix() { } /** * Set the grammar's table prefix. * * @param object $wpdb WordPress database object * @return $this */ public function setTablePrefix($wpdb) { } /** * Set the grammar's database connection. * * @param \FluentCart\Framework\Database\ConnectionInterface $connection * @return $this */ public function setConnection($connection) { } /** * Track table aliases. * * @param void */ public function addAlias($alias) { } } class ClassMorphViolationException extends \RuntimeException { /** * The name of the affected Orm model. * * @var string */ public $model; /** * Create a new exception instance. * * @param object $model */ public function __construct($model) { } } } namespace FluentCart\Framework\Support { trait Conditionable { /** * Apply the callback if the given "value" is (or resolves to) truthy. * * @template TWhenParameter * @template TWhenReturnType * * @param (\Closure($this): TWhenParameter)|TWhenParameter|null $value * @param (callable($this, TWhenParameter): TWhenReturnType)|null $callback * @param (callable($this, TWhenParameter): TWhenReturnType)|null $default * @return $this|TWhenReturnType */ public function when($value = null, ?callable $callback = null, ?callable $default = null) { } /** * Apply the callback if the given "value" is (or resolves to) falsy. * * @template TUnlessParameter * @template TUnlessReturnType * * @param (\Closure($this): TUnlessParameter)|TUnlessParameter|null $value * @param (callable($this, TUnlessParameter): TUnlessReturnType)|null $callback * @param (callable($this, TUnlessParameter): TUnlessReturnType)|null $default * @return $this|TUnlessReturnType */ public function unless($value = null, ?callable $callback = null, ?callable $default = null) { } } } namespace FluentCart\Framework\Database\Concerns { /** * @template TValue * * @mixin \FluentCart\Framework\Database\Orm\Builder * @mixin \FluentCart\Framework\Database\Query\Builder */ trait BuildsQueries { use \FluentCart\Framework\Support\Conditionable; /** * Chunk the results of the query. * * @param int $count * @param callable(\FluentCart\Framework\Support\Collection, int): mixed $callback * @return bool */ public function chunk($count, callable $callback) { } /** * Run a map over each item while chunking. * * @template TReturn * * @param callable(TValue): TReturn $callback * @param int $count * @return \FluentCart\Framework\Support\Collection */ public function chunkMap(callable $callback, $count = 1000) { } /** * Execute a callback over each item while chunking. * * @param callable(TValue, int): mixed $callback * @param int $count * @return bool * * @throws \RuntimeException */ public function each(callable $callback, $count = 1000) { } /** * Chunk the results of a query by comparing IDs. * * @param int $count * @param callable(\FluentCart\Framework\Support\Collection, int): mixed $callback * @param string|null $column * @param string|null $alias * @return bool */ public function chunkById($count, callable $callback, $column = null, $alias = null) { } /** * Chunk the results of a query by comparing IDs in descending order. * * @param int $count * @param callable(\FluentCart\Framework\Support\Collection, int): mixed $callback * @param string|null $column * @param string|null $alias * @return bool */ public function chunkByIdDesc($count, callable $callback, $column = null, $alias = null) { } /** * Chunk the results of a query by comparing IDs in a given order. * * @param int $count * @param callable(\FluentCart\Framework\Support\Collection, int): mixed $callback * @param string|null $column * @param string|null $alias * @param bool $descending * @return bool * * @throws \RuntimeException */ public function orderedChunkById($count, callable $callback, $column = null, $alias = null, $descending = false) { } /** * Execute a callback over each item while chunking by ID. * * @param callable(TValue, int): mixed $callback * @param int $count * @param string|null $column * @param string|null $alias * @return bool */ public function eachById(callable $callback, $count = 1000, $column = null, $alias = null) { } /** * Query lazily, by chunks of the given size. * * @param int $chunkSize * @return \FluentCart\Framework\Support\LazyCollection * * @throws \InvalidArgumentException */ public function lazy($chunkSize = 1000) { } /** * Query lazily, by chunking the results of a query by comparing IDs. * * @param int $chunkSize * @param string|null $column * @param string|null $alias * @return \FluentCart\Framework\Support\LazyCollection * * @throws \InvalidArgumentException */ public function lazyById($chunkSize = 1000, $column = null, $alias = null) { } /** * Query lazily, by chunking the results of a query by comparing IDs in descending order. * * @param int $chunkSize * @param string|null $column * @param string|null $alias * @return \FluentCart\Framework\Support\LazyCollection * * @throws \InvalidArgumentException */ public function lazyByIdDesc($chunkSize = 1000, $column = null, $alias = null) { } /** * Query lazily, by chunking the results of a query by comparing IDs in a given order. * * @param int $chunkSize * @param string|null $column * @param string|null $alias * @param bool $descending * @return \FluentCart\Framework\Support\LazyCollection * * @throws \InvalidArgumentException */ protected function orderedLazyById($chunkSize = 1000, $column = null, $alias = null, $descending = false) { } /** * Execute the query and get the first result. * * @param array|string $columns * @return TValue|null */ public function first($columns = ['*']) { } /** * Execute the query and get the first result if it's the sole matching record. * * @param array|string $columns * @return TValue * * @throws \FluentCart\Framework\Database\RecordsNotFoundException * @throws \FluentCart\Framework\Database\MultipleRecordsFoundException */ public function sole($columns = ['*']) { } /** * Paginate the given query using a cursor paginator. * * @param int $perPage * @param array|string $columns * @param string $cursorName * @param \FluentCart\Framework\Pagination\Cursor|string|null $cursor * @return \FluentCart\Framework\Pagination\CursorPaginator */ protected function paginateUsingCursor($perPage, $columns = ['*'], $cursorName = 'cursor', $cursor = null) { } /** * Get the original column name of the given column, without any aliasing. * * @param \FluentCart\Framework\Database\Query\Builder|\FluentCart\Framework\Database\Orm\Builder<*> $builder * @param string $parameter * @return string */ protected function getOriginalColumnNameForCursorPagination($builder, string $parameter) { } /** * Create a new length-aware paginator instance. * * @param \FluentCart\Framework\Support\Collection $items * @param int $total * @param int $perPage * @param int $currentPage * @param array $options * @return \FluentCart\Framework\Pagination\LengthAwarePaginator */ protected function paginator($items, $total, $perPage, $currentPage, $options) { } /** * Create a new simple paginator instance. * * @param \FluentCart\Framework\Support\Collection $items * @param int $perPage * @param int $currentPage * @param array $options * @return \FluentCart\Framework\Pagination\Paginator */ protected function simplePaginator($items, $perPage, $currentPage, $options) { } /** * Create a new cursor paginator instance. * * @param \FluentCart\Framework\Support\Collection $items * @param int $perPage * @param \FluentCart\Framework\Pagination\Cursor $cursor * @param array $options * @return \FluentCart\Framework\Pagination\CursorPaginator */ protected function cursorPaginator($items, $perPage, $cursor, $options) { } /** * Pass the query to a given callback. * * @param callable($this): mixed $callback * @return $this */ public function tap($callback) { } } trait BuildsWhereDateClauses { /** * Add a where clause to determine if a "date" column is in the past to the query. * * @param array|string $columns * @return $this */ public function wherePast($columns) { } /** * Add a where clause to determine if a "date" column is in the past or now to the query. * * @param array|string $columns * @return $this */ public function whereNowOrPast($columns) { } /** * Add an "or where" clause to determine if a "date" column is in the past to the query. * * @param array|string $columns * @return $this */ public function orWherePast($columns) { } /** * Add a where clause to determine if a "date" column is in the past or now to the query. * * @param array|string $columns * @return $this */ public function orWhereNowOrPast($columns) { } /** * Add a where clause to determine if a "date" column is in the future to the query. * * @param array|string $columns * @return $this */ public function whereFuture($columns) { } /** * Add a where clause to determine if a "date" column is in the future or now to the query. * * @param array|string $columns * @return $this */ public function whereNowOrFuture($columns) { } /** * Add an "or where" clause to determine if a "date" column is in the future to the query. * * @param array|string $columns * @return $this */ public function orWhereFuture($columns) { } /** * Add an "or where" clause to determine if a "date" column is in the future or now to the query. * * @param array|string $columns * @return $this */ public function orWhereNowOrFuture($columns) { } /** * Add an "where" clause to determine if a "date" column is in the past or future. * * @param array|string $columns * @return $this */ protected function wherePastOrFuture($columns, $operator, $boolean) { } /** * Add a "where date" clause to determine if a "date" column is today to the query. * * @param array|string $columns * @param string $boolean * @return $this */ public function whereToday($columns, $boolean = 'and') { } /** * Add a "where date" clause to determine if a "date" column is before today. * * @param array|string $columns * @return $this */ public function whereBeforeToday($columns) { } /** * Add a "where date" clause to determine if a "date" column is today or before to the query. * * @param array|string $columns * @return $this */ public function whereTodayOrBefore($columns) { } /** * Add a "where date" clause to determine if a "date" column is after today. * * @param array|string $columns * @return $this */ public function whereAfterToday($columns) { } /** * Add a "where date" clause to determine if a "date" column is today or after to the query. * * @param array|string $columns * @return $this */ public function whereTodayOrAfter($columns) { } /** * Add an "or where date" clause to determine if a "date" column is today to the query. * * @param array|string $columns * @return $this */ public function orWhereToday($columns) { } /** * Add an "or where date" clause to determine if a "date" column is before today. * * @param array|string $columns * @return $this */ public function orWhereBeforeToday($columns) { } /** * Add an "or where date" clause to determine if a "date" column is today or before to the query. * * @param array|string $columns * @return $this */ public function orWhereTodayOrBefore($columns) { } /** * Add an "or where date" clause to determine if a "date" column is after today. * * @param array|string $columns * @return $this */ public function orWhereAfterToday($columns) { } /** * Add an "or where date" clause to determine if a "date" column is today or after to the query. * * @param array|string $columns * @return $this */ public function orWhereTodayOrAfter($columns) { } /** * Add a "where date" clause to determine if a "date" column is today or after to the query. * * @param array|string $columns * @param string $operator * @param string $boolean * @return $this */ protected function whereTodayBeforeOrAfter($columns, $operator, $boolean) { } } trait CompilesJsonPaths { /** * Split the given JSON selector into the field and the optional path and wrap them separately. * * @param string $column * @return array */ protected function wrapJsonFieldAndPath($column) { } /** * Wrap the given JSON path. * * @param string $value * @param string $delimiter * @return string */ protected function wrapJsonPath($value, $delimiter = '->') { } /** * Wrap the given JSON path segment. * * @param string $segment * @return string */ protected function wrapJsonPathSegment($segment) { } } trait ExplainsQueries { /** * Explains the query. * * @return \FluentCart\Framework\Support\Collection */ public function explain() { } } trait MaintainsDatabase { /** * Check the table. * * @param string $table * @return \stdClass */ public static function check($table) { } /** * Analyze the table. * * @param string $table * @return \stdClass */ public static function analyze($table) { } /** * Repair or rebuild the table based on the storage engine. * * @param string $table * @return \stdClass */ public static function repair($table) { } /** * Repair the InnoDB table. * * @param string $table * @return \stdClass */ public static function repairInnoDB($table) { } /** * Repair the MYISAM table. * * @param string $table * @return \stdClass */ public static function repairMyISAM($table) { } /** * Optimize the table. * * @param string $table * @return \stdClass */ public static function optimize($table) { } } trait ManagesTransactions { /** * Execute a Closure within a transaction. * * @template TReturn * @param \Closure(static): TReturn $callback * @param int $attempts * @return TReturn * * @throws \Throwable */ public function transaction(\Closure $callback, $attempts = 1) { } /** * Begin transaction or create savepoint. */ public function beginTransaction() { } /** * Create root transaction. */ protected function createTransaction() { } /** * Create savepoint. */ protected function createSavepoint() { } /** * Commit transaction or release savepoint. */ public function commit() { } /** * Rollback transaction. */ public function rollBack($toLevel = null) { } /** * Perform rollback. */ protected function performRollBack($toLevel) { } /** * Handle transaction exception. */ protected function handleTransactionException(\Throwable $e, $currentAttempt, $maxAttempts) { } /** * Handle commit exception. */ protected function handleCommitTransactionException(\Throwable $e, $currentAttempt, $maxAttempts) { } /** * Handle begin exception. */ protected function handleBeginTransactionException(\Throwable $e) { } /** * Handle rollback exception. */ protected function handleRollBackException(\Throwable $e) { } /** * Get savepoint name. */ protected function getSavepointName($level) { } /** * Transaction nesting level. */ public function transactionLevel() { } /** * After commit callback. */ public function afterCommit($callback) { } /** * In transaction? */ public function inTransaction() { } /** * Set transaction manager. */ public function setTransactionManager($manager) { } /** * Unset transaction manager. */ public function unsetTransactionManager() { } } } namespace FluentCart\Framework\Database { interface ConnectionInterface { /** * Begin a fluent query against a database table. * * @param \Closure|\FluentCart\Framework\Database\Query\Builder|string $table * @param string|null $as * @return \FluentCart\Framework\Database\Query\Builder */ public function table($table, $as = null); /** * Get a new raw query expression. * * @param mixed $value * @return \FluentCart\Framework\Database\Query\Expression */ public function raw($value); /** * Run a select statement and return a single result. * * @param string $query * @param array $bindings * @return mixed */ public function selectOne($query, $bindings = []); /** * Run a select statement and return the first column of the first row. * * @param string $query * @param array $bindings * @return mixed * * @throws \FluentCart\Framework\Database\MultipleColumnsSelectedException */ public function scalar($query, $bindings = []); /** * Run a select statement against the database. * * @param string $query * @param array $bindings * @return array */ public function select($query, $bindings = []); /** * Run a select statement against the database and returns a generator. * * @param string $query * @param array $bindings * @return \Generator */ public function cursor($query, $bindings = []); /** * Run an insert statement against the database. * * @param string $query * @param array $bindings * @return bool */ public function insert($query, $bindings = []); /** * Run an update statement against the database. * * @param string $query * @param array $bindings * @return int */ public function update($query, $bindings = []); /** * Run a delete statement against the database. * * @param string $query * @param array $bindings * @return int */ public function delete($query, $bindings = []); /** * Execute an SQL statement and return the boolean result. * * @param string $query * @param array $bindings * @return bool */ public function statement($query, $bindings = []); /** * Run an SQL statement and get the number of rows affected. * * @param string $query * @param array $bindings * @return int */ public function affectingStatement($query, $bindings = []); /** * Run a raw, unprepared query against the PDO connection. * * @param string $query * @return bool */ public function unprepared($query); /** * Prepare the query bindings for execution. * * @param array $bindings * @return array */ public function prepareBindings(array $bindings); /** * Execute a Closure within a transaction. * * @param \Closure $callback * @param int $attempts * @return mixed * * @throws \Throwable */ public function transaction(\Closure $callback, $attempts = 1); /** * Start a new database transaction. * * @return void */ public function beginTransaction(); /** * Commit the active database transaction. * * @return void */ public function commit(); /** * Rollback the active database transaction. * * @return void */ public function rollBack(); /** * Get the number of active transactions. * * @return int */ public function transactionLevel(); /** * Execute the given callback in "dry run" mode. * * @param \Closure $callback * @return array */ public function pretend(\Closure $callback); /** * Get the name of the connected database. * * @return string */ public function getDatabaseName(); } interface ConnectionResolverInterface { /** * Get a database connection instance. * * @param string|null $name * @return \FluentCart\Framework\Database\ConnectionInterface */ public function connection($name = null); /** * Get the default connection name. * * @return string */ public function getDefaultConnection(); /** * Set the default connection name. * * @param string $name * @return void */ public function setDefaultConnection($name); } class ConnectionResolver implements \FluentCart\Framework\Database\ConnectionResolverInterface { /** * All of the registered connections. * * @var array */ protected $connections = []; /** * The default connection name. * * @var string */ protected $default; /** * Create a new connection resolver instance. * * @param array $connections * @return void */ public function __construct(array $connections = []) { } /** * Get a database connection instance. * * @param string|null $name * @return \FluentCart\Framework\Database\ConnectionInterface */ public function connection($name = null) { } /** * Add a connection to the resolver. * * @param string $name * @param \FluentCart\Framework\Database\ConnectionInterface $connection * @return void */ public function addConnection($name, \FluentCart\Framework\Database\ConnectionInterface $connection) { } /** * Check if a connection has been registered. * * @param string $name * @return bool */ public function hasConnection($name) { } /** * Get the default connection name. * * @return string */ public function getDefaultConnection() { } /** * Set the default connection name. * * @param string $name * @return void */ public function setDefaultConnection($name) { } } class DatabaseManager { protected $resolver; public function __construct(\FluentCart\Framework\Database\ConnectionResolver $resolver) { } public function connection($name = null) { } protected function suggestMethod($connection, $method) { } protected function throwBadMethodCallException($connection, $method) { } public function __call($method, $args) { } } class DatabaseTransactionRecord { /** * The name of the database connection. * * @var string */ public $connection; /** * The transaction level. * * @var int */ public $level; /** * The parent instance of this transaction. * * @var \FluentCart\Framework\Database\DatabaseTransactionRecord */ public $parent; /** * The callbacks that should be executed after committing. * * @var array */ protected $callbacks = []; /** * The callbacks that should be executed after rollback. * * @var array */ protected $callbacksForRollback = []; /** * Create a new database transaction record instance. * * @param string $connection * @param int $level * @param \FluentCart\Framework\Database\DatabaseTransactionRecord|null $parent */ public function __construct($connection, $level, ?\FluentCart\Framework\Database\DatabaseTransactionRecord $parent = null) { } /** * Register a callback to be executed after committing. * * @param callable $callback * @return void */ public function addCallback($callback) { } /** * Register a callback to be executed after rollback. * * @param callable $callback * @return void */ public function addCallbackForRollback($callback) { } /** * Execute all of the callbacks. * * @return void */ public function executeCallbacks() { } /** * Execute all of the callbacks for rollback. * * @return void */ public function executeCallbacksForRollback() { } /** * Get all of the callbacks. * * @return array */ public function getCallbacks() { } /** * Get all of the callbacks for rollback. * * @return array */ public function getCallbacksForRollback() { } } class DatabaseTransactionsManager { /** * All of the committed transactions. * * @var \FluentCart\Framework\Support\Collection */ protected $committedTransactions; /** * All of the pending transactions. * * @var \FluentCart\Framework\Support\Collection */ protected $pendingTransactions; /** * The current transaction. * * @var array */ protected $currentTransaction = []; /** * Create a new database transactions manager instance. */ public function __construct() { } /** * Start a new database transaction. * * @param string $connection * @param int $level * @return void */ public function begin($connection, $level) { } /** * Commit the root database transaction and execute callbacks. * * @param string $connection * @param int $levelBeingCommitted * @param int $newTransactionLevel * @return array */ public function commit($connection, $levelBeingCommitted, $newTransactionLevel) { } /** * Move relevant pending transactions to a committed state. * * @param string $connection * @param int $levelBeingCommitted * @return void */ public function stageTransactions($connection, $levelBeingCommitted) { } /** * Rollback the active database transaction. * * @param string $connection * @param int $newTransactionLevel * @return void */ public function rollback($connection, $newTransactionLevel) { } /** * Remove all pending, completed, and current transactions * for the given connection name. * * @param string $connection * @return void */ protected function removeAllTransactionsForConnection($connection) { } /** * Remove all transactions that are children of the given transaction. * * @param \FluentCart\Framework\Database\DatabaseTransactionRecord $transaction * @return void */ protected function removeCommittedTransactionsThatAreChildrenOf(\FluentCart\Framework\Database\DatabaseTransactionRecord $transaction) { } /** * Register a transaction callback. * * @param callable $callback * @return void */ public function addCallback($callback) { } /** * Register a callback for transaction rollback. * * @param callable $callback * @return void */ public function addCallbackForRollback($callback) { } /** * Get the transactions that are applicable to callbacks. * * @return \FluentCart\Framework\Support\Collection */ public function callbackApplicableTransactions() { } /** * Determine if after commit callbacks should be executed * for the given transaction level. * * @param int $level * @return bool */ public function afterCommitCallbacksShouldBeExecuted($level) { } /** * Get all of the pending transactions. * * @return \FluentCart\Framework\Support\Collection */ public function getPendingTransactions() { } /** * Get all of the committed transactions. * * @return \FluentCart\Framework\Support\Collection */ public function getCommittedTransactions() { } } class DeadlockException extends \PDOException { //... } trait DetectsLostConnections { /** * Determine if the given exception was caused by a lost connection. * * @param \Throwable $e * @return bool */ protected function causedByLostConnection(\Throwable $e) { } } } namespace FluentCart\Framework\Database\Events { abstract class ConnectionEvent { /** * The name of the connection. * * @var string */ public $connectionName; /** * The database connection instance. * * @var \FluentCart\Framework\Database\Query\WPDBConnection $connection */ public $connection; /** * Create a new event instance. * * @var \FluentCart\Framework\Database\Query\WPDBConnection $connection * @return void */ public function __construct($connection) { } } class QueryExecuted { /** * The SQL query that was executed. * * @var string */ public $sql; /** * The array of query bindings. * * @var array */ public $bindings; /** * The number of milliseconds it took to execute the query. * * @var float */ public $time; /** * The database connection instance. * * @var \FluentCart\Framework\Database\Query\WPDBConnection */ public $connection; /** * The database connection name. * * @var string */ public $connectionName; /** * Create a new event instance. * * @param string $sql * @param array $bindings * @param float|null $time * @param \FluentCart\Framework\Database\Query\WPDBConnection $connection * @return void */ public function __construct($sql, $bindings, $time, $connection) { } } class TransactionBeginning extends \FluentCart\Framework\Database\Events\ConnectionEvent { //... } class TransactionCommitted extends \FluentCart\Framework\Database\Events\ConnectionEvent { //... } class TransactionCommitting extends \FluentCart\Framework\Database\Events\ConnectionEvent { //... } class TransactionRolledBack extends \FluentCart\Framework\Database\Events\ConnectionEvent { //... } } namespace FluentCart\Framework\Database { class LazyLoadingViolationException extends \RuntimeException { /** * The name of the affected Orm model. * * @var string */ public $model; /** * The name of the relation. * * @var string */ public $relation; /** * Create a new exception instance. * * @param object $model * @param string $relation * @return static */ public function __construct($model, $relation) { } } } namespace FluentCart\Framework\Database\Migration { class Blueprint { protected $table; protected $mode; /** * @var ColumnDefinition[] */ protected $columns = []; /** * Index definitions for CREATE mode. * Each: ['type' => 'KEY|UNIQUE KEY', 'columns' => [...], 'name' => '...'] */ protected $indexes = []; /** * Alter operations (executed in order). * Each: ['type' => string, 'data' => mixed] */ protected $operations = []; public function __construct($table, $mode = 'create') { } // ══════════════════════════════════════════════════════════ // CREATE MODE — Column Definitions // ══════════════════════════════════════════════════════════ public function id($name = 'id') { } public function string($name, $length = 255) { } public function char($name, $length = 1) { } public function text($name) { } public function mediumText($name) { } public function longText($name) { } public function integer($name) { } public function bigInteger($name) { } public function tinyInteger($name) { } public function smallInteger($name) { } public function mediumInteger($name) { } public function decimal($name, $precision = 8, $scale = 2) { } public function float($name) { } public function double($name) { } public function boolean($name) { } public function json($name) { } public function binary($name, $length = 255) { } public function blob($name) { } public function mediumBlob($name) { } public function longBlob($name) { } public function enum($name, array $values) { } public function set($name, array $values) { } public function timestamp($name) { } public function date($name) { } public function datetime($name) { } public function time($name) { } public function year($name) { } // ── Compound Shortcuts ─────────────────────────────────── public function timestamps() { } public function softDeletes() { } public function morphs($name) { } public function nullableMorphs($name) { } // ── Index Definitions ──────────────────────────────────── /** * Add a regular index. */ public function index($columns, $name = null) { } /** * Add a unique index. */ public function unique($columns, $name = null) { } // ══════════════════════════════════════════════════════════ // ALTER MODE — Guarded Operations // ══════════════════════════════════════════════════════════ /** * Add a column (only if it doesn't exist). */ public function addColumn($name) { } /** * Drop a column (only if it exists). */ public function dropColumn($name) { } /** * Modify a column type/size (only if it exists). */ public function modifyColumn($name) { } /** * Rename a column (only if old exists and new doesn't). */ public function renameColumn($from, $to) { } /** * Drop an index (only if it exists). */ public function dropIndex($name) { } // ══════════════════════════════════════════════════════════ // EXECUTION // ══════════════════════════════════════════════════════════ /** * Execute CREATE TABLE via dbDelta (idempotent). */ public function executeCreate() { } /** * Execute ALTER operations with guards. */ public function executeAlter() { } // ══════════════════════════════════════════════════════════ // INTERNAL HELPERS // ══════════════════════════════════════════════════════════ /** * Build the column+index SQL block for CREATE TABLE. * Uses KEY (not INDEX) for dbDelta compatibility. */ protected function buildCreateSql() { } /** * Check if an index exists on this table. */ protected function hasIndex($indexName) { } /** * Get the current column definition for CHANGE COLUMN. */ protected function getCurrentColumnDef($column) { } public function getTable() { } } class ColumnDefinition { protected $name; protected $type = ''; protected $isNullable = false; protected $defaultValue = null; protected $hasDefault = false; protected $isUnsigned = false; protected $afterColumn = null; protected $isPrimary = false; protected $isAutoIncrement = false; protected $isUnique = false; protected $isIndex = false; protected $comment = null; protected $charset = null; protected $collation = null; public function __construct($name) { } // ── Type Methods ───────────────────────────────────────── /** * Auto-increment primary key (bigint unsigned). */ public function id() { } public function string($length = 255) { } public function char($length = 1) { } public function text() { } public function mediumText() { } public function longText() { } public function integer() { } public function bigInteger() { } public function tinyInteger() { } public function smallInteger() { } public function mediumInteger() { } public function decimal($precision = 8, $scale = 2) { } public function float() { } public function double() { } public function boolean() { } public function json() { } public function binary($length = 255) { } public function blob() { } public function mediumBlob() { } public function longBlob() { } public function enum(array $values) { } public function set(array $values) { } public function timestamp() { } public function date() { } public function datetime() { } public function time() { } public function year() { } // ── Modifier Methods ───────────────────────────────────── public function nullable() { } public function default($value) { } public function unsigned() { } public function after($column) { } public function primary() { } public function autoIncrement() { } public function unique() { } public function index() { } public function comment($comment) { } public function charset($charset) { } public function collation($collation) { } // ── SQL Generation ─────────────────────────────────────── public function getName() { } public function isUnique() { } public function isIndex() { } /** * Column definition for CREATE TABLE (used by dbDelta). * e.g. "status varchar(20) NOT NULL DEFAULT 'pending'" */ public function toSql() { } /** * For ALTER TABLE ADD COLUMN. */ public function toAlterAddSql() { } /** * For ALTER TABLE MODIFY COLUMN. */ public function toAlterModifySql() { } protected function formatDefault($value) { } } } namespace FluentCart\Framework\Database { class MultipleColumnsSelectedException extends \RuntimeException { //... } class MultipleRecordsFoundException extends \RuntimeException { /** * The number of records found. * * @var int */ public $count; /** * Create a new exception instance. * * @param int $count * @param int $code * @param \Throwable|null $previous * @return void */ public function __construct($count, $code = 0, $previous = null) { } /** * Get the number of records found. * * @return int */ public function getCount() { } } } namespace FluentCart\Framework\Database\Orm\Concerns { trait QueriesRelationships { /** * Add a relationship count / exists condition to the query. * * @param \FluentCart\Framework\Database\Orm\Relations\Relation|string $relation * @param string $operator * @param int $count * @param string $boolean * @param \Closure|null $callback * @return \FluentCart\Framework\Database\Orm\Builder|static * * @throws \RuntimeException */ public function has($relation, $operator = '>=', $count = 1, $boolean = 'and', ?\Closure $callback = null) { } /** * Add nested relationship count / exists conditions to the query. * * Sets up recursive call to whereHas until we finish the nested relation. * * @param string $relations * @param string $operator * @param int $count * @param string $boolean * @param \Closure|null $callback * @return \FluentCart\Framework\Database\Orm\Builder|static */ protected function hasNested($relations, $operator = '>=', $count = 1, $boolean = 'and', $callback = null) { } /** * Add a relationship count / exists condition to the query with an "or". * * @param string $relation * @param string $operator * @param int $count * @return \FluentCart\Framework\Database\Orm\Builder|static */ public function orHas($relation, $operator = '>=', $count = 1) { } /** * Add a relationship count / exists condition to the query. * * @param string $relation * @param string $boolean * @param \Closure|null $callback * @return \FluentCart\Framework\Database\Orm\Builder|static */ public function doesntHave($relation, $boolean = 'and', ?\Closure $callback = null) { } /** * Add a relationship count / exists condition to the query with an "or". * * @param string $relation * @return \FluentCart\Framework\Database\Orm\Builder|static */ public function orDoesntHave($relation) { } /** * Add a relationship count / exists condition to the query with where clauses. * * @param string $relation * @param \Closure|null $callback * @param string $operator * @param int $count * @return \FluentCart\Framework\Database\Orm\Builder|static */ public function whereHas($relation, ?\Closure $callback = null, $operator = '>=', $count = 1) { } /** * Add a relationship count / exists condition to the query with where clauses. * * Also load the relationship with same condition. * * @param string $relation * @param \Closure|null $cb (callback) * @param string $operator * @param int $count * @return \FluentCart\Framework\Database\Orm\Builder|static */ public function withWhereHas($relation, ?\Closure $cb = null, $operator = '>=', $count = 1) { } /** * Add a relationship count / exists condition to the query with where clauses and an "or". * * @param string $relation * @param \Closure|null $callback * @param string $operator * @param int $count * @return \FluentCart\Framework\Database\Orm\Builder|static */ public function orWhereHas($relation, ?\Closure $callback = null, $operator = '>=', $count = 1) { } /** * Add a relationship count / exists condition to the query with where clauses. * * @param string $relation * @param \Closure|null $callback * @return \FluentCart\Framework\Database\Orm\Builder|static */ public function whereDoesntHave($relation, ?\Closure $callback = null) { } /** * Add a relationship count / exists condition to the query with where clauses and an "or". * * @param string $relation * @param \Closure|null $callback * @return \FluentCart\Framework\Database\Orm\Builder|static */ public function orWhereDoesntHave($relation, ?\Closure $callback = null) { } /** * Add a polymorphic relationship count / exists condition to the query. * * @param \FluentCart\Framework\Database\Orm\Relations\MorphTo|string $relation * @param string|array $types * @param string $operator * @param int $count * @param string $boolean * @param \Closure|null $callback * @return \FluentCart\Framework\Database\Orm\Builder|static */ public function hasMorph($relation, $types, $operator = '>=', $count = 1, $boolean = 'and', ?\Closure $callback = null) { } /** * Get the BelongsTo relationship for a single polymorphic type. * * @param \FluentCart\Framework\Database\Orm\Relations\MorphTo $relation * @param string $type * @return \FluentCart\Framework\Database\Orm\Relations\BelongsTo */ protected function getBelongsToRelation(\FluentCart\Framework\Database\Orm\Relations\MorphTo $relation, $type) { } /** * Add a polymorphic relationship count / exists condition to the query with an "or". * * @param \FluentCart\Framework\Database\Orm\Relations\MorphTo|string $relation * @param string|array $types * @param string $operator * @param int $count * @return \FluentCart\Framework\Database\Orm\Builder|static */ public function orHasMorph($relation, $types, $operator = '>=', $count = 1) { } /** * Add a polymorphic relationship count / exists condition to the query. * * @param \FluentCart\Framework\Database\Orm\Relations\MorphTo|string $relation * @param string|array $types * @param string $boolean * @param \Closure|null $callback * @return \FluentCart\Framework\Database\Orm\Builder|static */ public function doesntHaveMorph($relation, $types, $boolean = 'and', ?\Closure $callback = null) { } /** * Add a polymorphic relationship count / exists condition to the query with an "or". * * @param \FluentCart\Framework\Database\Orm\Relations\MorphTo|string $relation * @param string|array $types * @return \FluentCart\Framework\Database\Orm\Builder|static */ public function orDoesntHaveMorph($relation, $types) { } /** * Add a polymorphic relationship count / exists condition to the query with where clauses. * * @param \FluentCart\Framework\Database\Orm\Relations\MorphTo|string $relation * @param string|array $types * @param \Closure|null $callback * @param string $operator * @param int $count * @return \FluentCart\Framework\Database\Orm\Builder|static */ public function whereHasMorph($relation, $types, ?\Closure $callback = null, $operator = '>=', $count = 1) { } /** * Add a polymorphic relationship count / exists condition to the query with where clauses and an "or". * * @param \FluentCart\Framework\Database\Orm\Relations\MorphTo|string $relation * @param string|array $types * @param \Closure|null $callback * @param string $operator * @param int $count * @return \FluentCart\Framework\Database\Orm\Builder|static */ public function orWhereHasMorph($relation, $types, ?\Closure $callback = null, $operator = '>=', $count = 1) { } /** * Add a polymorphic relationship count / exists condition to the query with where clauses. * * @param \FluentCart\Framework\Database\Orm\Relations\MorphTo|string $relation * @param string|array $types * @param \Closure|null $callback * @return \FluentCart\Framework\Database\Orm\Builder|static */ public function whereDoesntHaveMorph($relation, $types, ?\Closure $callback = null) { } /** * Add a polymorphic relationship count / exists condition to the query with where clauses and an "or". * * @param \FluentCart\Framework\Database\Orm\Relations\MorphTo|string $relation * @param string|array $types * @param \Closure|null $callback * @return \FluentCart\Framework\Database\Orm\Builder|static */ public function orWhereDoesntHaveMorph($relation, $types, ?\Closure $callback = null) { } /** * Add a basic where clause to a relationship query. * * @param string $relation * @param \Closure|string|array|\FluentCart\Framework\Database\Query\Expression $column * @param mixed $operator * @param mixed $value * @return \FluentCart\Framework\Database\Orm\Builder|static */ public function whereRelation($relation, $column, $operator = null, $value = null) { } /** * Add an "or where" clause to a relationship query. * * @param string $relation * @param \Closure|string|array|\FluentCart\Framework\Database\Query\Expression $column * @param mixed $operator * @param mixed $value * @return \FluentCart\Framework\Database\Orm\Builder|static */ public function orWhereRelation($relation, $column, $operator = null, $value = null) { } /** * Add a polymorphic relationship condition to the query with a where clause. * * @param \FluentCart\Framework\Database\Orm\Relations\MorphTo|string $relation * @param string|array $types * @param \Closure|string|array|\FluentCart\Framework\Database\Query\Expression $column * @param mixed $operator * @param mixed $value * @return \FluentCart\Framework\Database\Orm\Builder|static */ public function whereMorphRelation($relation, $types, $column, $operator = null, $value = null) { } /** * Add a polymorphic relationship condition to the query with an "or where" clause. * * @param \FluentCart\Framework\Database\Orm\Relations\MorphTo|string $relation * @param string|array $types * @param \Closure|string|array|\FluentCart\Framework\Database\Query\Expression $column * @param mixed $operator * @param mixed $value * @return \FluentCart\Framework\Database\Orm\Builder|static */ public function orWhereMorphRelation($relation, $types, $column, $operator = null, $value = null) { } /** * Add a morph-to relationship condition to the query. * * @param \FluentCart\Framework\Database\Orm\Relations\MorphTo|string $relation * @param \FluentCart\Framework\Database\Orm\Model|string $model * @return \FluentCart\Framework\Database\Orm\Builder|static */ public function whereMorphedTo($relation, $model, $boolean = 'and') { } /** * Add a not morph-to relationship condition to the query. * * @param \FluentCart\Framework\Database\Orm\Relations\MorphTo<*, *>|string $relation * @param \FluentCart\Framework\Database\Orm\Model|string $model * @return $this */ public function whereNotMorphedTo($relation, $model, $boolean = 'and') { } /** * Add a morph-to relationship condition to the query with an "or where" clause. * * @param \FluentCart\Framework\Database\Orm\Relations\MorphTo|string $relation * @param \FluentCart\Framework\Database\Orm\Model|string $model * @return \FluentCart\Framework\Database\Orm\Builder|static */ public function orWhereMorphedTo($relation, $model) { } /** * Add a not morph-to relationship condition to the query with an "or where" clause. * * @param \FluentCart\Framework\Database\Orm\Relations\MorphTo<*, *>|string $relation * @param \FluentCart\Framework\Database\Orm\Model|string $model * @return $this */ public function orWhereNotMorphedTo($relation, $model) { } /** * Add a "belongs to" relationship where clause to the query. * * @param \FluentCart\Framework\Database\Orm\Model $related * @param string $relationshipName * @param string $boolean * @return $this * * @throws \RuntimeException */ public function whereBelongsTo($related, $relationshipName = null, $boolean = 'and') { } /** * Add an "BelongsTo" relationship with an "or where" clause to the query. * * @param \FluentCart\Framework\Database\Orm\Model $related * @param string $relationshipName * @return $this * * @throws \RuntimeException */ public function orWhereBelongsTo($related, $relationshipName = null) { } /** * Add subselect queries to include an aggregate value for a relationship. * * @param mixed $relations * @param string $column * @param string $function * @return $this */ public function withAggregate($relations, $column, $function = null) { } /** * Get the relation hashed column name for the given column and relation. * * @param string $column * @param \FluentCart\Framework\Database\Orm\Relations\Relation<*, *, *> $relation * @return string */ protected function getRelationHashedColumn($column, $relation) { } /** * Add subselect queries to count the relations. * * @param mixed $relations * @return $this */ public function withCount($relations) { } /** * Add subselect queries to include the max of the relation's column. * * @param string|array $relation * @param string $column * @return $this */ public function withMax($relation, $column) { } /** * Add subselect queries to include the min of the relation's column. * * @param string|array $relation * @param string $column * @return $this */ public function withMin($relation, $column) { } /** * Add subselect queries to include the sum of the relation's column. * * @param string|array $relation * @param string $column * @return $this */ public function withSum($relation, $column) { } /** * Add subselect queries to include the average of the relation's column. * * @param string|array $relation * @param string $column * @return $this */ public function withAvg($relation, $column) { } /** * Add subselect queries to include the existence of related models. * * @param string|array $relation * @return $this */ public function withExists($relation) { } /** * Add the "has" condition where clause to the query. * * @param \FluentCart\Framework\Database\Orm\Builder $hasQuery * @param \FluentCart\Framework\Database\Orm\Relations\Relation $relation * @param string $operator * @param int $count * @param string $boolean * @return \FluentCart\Framework\Database\Orm\Builder|static */ protected function addHasWhere(\FluentCart\Framework\Database\Orm\Builder $hasQuery, \FluentCart\Framework\Database\Orm\Relations\Relation $relation, $operator, $count, $boolean) { } /** * Merge the where constraints from another query to the current query. * * @param \FluentCart\Framework\Database\Orm\Builder $from * @return \FluentCart\Framework\Database\Orm\Builder|static */ public function mergeConstraintsFrom(\FluentCart\Framework\Database\Orm\Builder $from) { } /** * Updates the table name for any columns with a new qualified name. * * @param array $wheres * @param string $from * @param string $to * @return array */ protected function requalifyWhereTables(array $wheres, string $from, string $to) { } /** * Add a sub-query count clause to this query. * * @param \FluentCart\Framework\Database\Query\Builder $query * @param string $operator * @param int $count * @param string $boolean * @return $this */ protected function addWhereCountQuery(\FluentCart\Framework\Database\Query\Builder $query, $operator = '>=', $count = 1, $boolean = 'and') { } /** * Get the "has relation" base query instance. * * @param string $relation * @return \FluentCart\Framework\Database\Orm\Relations\Relation */ protected function getRelationWithoutConstraints($relation) { } /** * Check if we can run an "exists" query to optimize performance. * * @param string $operator * @param int $count * @return bool */ protected function canUseExistsForExistenceCheck($operator, $count) { } } } namespace FluentCart\Framework\Database\Orm { /** * @property-read HigherOrderBuilderProxy $orWhere * * @mixin \FluentCart\Framework\Database\Query\Builder * * @template TModel of \FluentCart\Framework\Database\Orm\Model */ class Builder { use \FluentCart\Framework\Support\HelperFunctionsTrait; use \FluentCart\Framework\Database\Concerns\BuildsQueries, \FluentCart\Framework\Support\ForwardsCalls, \FluentCart\Framework\Database\Orm\Concerns\QueriesRelationships { \FluentCart\Framework\Database\Concerns\BuildsQueries::sole as baseSole; } /** * The base query builder instance. * * @var \FluentCart\Framework\Database\Query\Builder */ protected $query; /** * The model being queried. * * @var \FluentCart\Framework\Database\Orm\Model */ protected $model; /** * The relationships that should be eager loaded. * * @var array */ protected $eagerLoad = []; /** * All of the globally registered builder macros. * * @var array */ protected static $macros = []; /** * All of the locally registered builder macros. * * @var array */ protected $localMacros = []; /** * A replacement for the typical delete function. * * @var \Closure */ protected $onDelete; /** * The properties that should be returned from query builder. * * @var string[] */ protected $propertyPassthru = ['from']; /** * The methods that should be returned from query builder. * * @var string[] */ protected $passthru = ['aggregate', 'average', 'avg', 'count', 'dd', 'ddrawsql', 'doesntexist', 'doesntexistor', 'dump', 'dumprawsql', 'exists', 'existsor', 'explain', 'getbindings', 'getconnection', 'getgrammar', 'getrawbindings', 'implode', 'insert', 'insertgetid', 'insertorignore', 'insertusing', 'insertorignoreusing', 'max', 'min', 'raw', 'rawvalue', 'sum', 'tosql', 'torawsql']; /** * Applied global scopes. * * @var array */ protected $scopes = []; /** * Applied model appends. * * @var array */ protected $appends = []; /** * Applied model hidden. * * @var array */ protected $hidden = []; /** * Removed global scopes. * * @var array */ protected $removedScopes = []; /** * The callbacks that should be invoked after retrieving data from the database. * * @var array */ protected $afterQueryCallbacks = []; /** * Create a new Orm query builder instance. * * @param \FluentCart\Framework\Database\Query\Builder $query * @return void */ public function __construct(\FluentCart\Framework\Database\Query\Builder $query) { } /** * Create and return an un-saved model instance. * * @param array $attributes * @return \FluentCart\Framework\Database\Orm\Model|static */ public function make(array $attributes = []) { } /** * Register a new global scope. * * @param string $identifier * @param \FluentCart\Framework\Database\Orm\Scope|\Closure $scope * @return $this */ public function withGlobalScope($identifier, $scope) { } /** * Remove a registered global scope. * * @param \FluentCart\Framework\Database\Orm\Scope|string $scope * @return $this */ public function withoutGlobalScope($scope) { } /** * Remove all or passed registered global scopes. * * @param array|null $scopes * @return $this */ public function withoutGlobalScopes(?array $scopes = null) { } /** * Register model appends. * @param array $appends * @return $this */ public function addAppends(array $appends) { } /** * Register model hidden. * @param array $hidden * @return $this */ public function addHidden(array $hidden) { } /** * Get an array of global scopes that were removed from the query. * * @return array */ public function removedScopes() { } /** * Add a where clause on the primary key to the query. * * @param mixed $id * @return $this */ public function whereKey($id) { } /** * Add a where clause on the primary key to the query. * * @param mixed $id * @return $this */ public function whereKeyNot($id) { } /** * Add a basic where clause to the query. * * @param \Closure|string|array|\FluentCart\Framework\Database\Query\Expression $column * @param mixed $operator * @param mixed $value * @param string $boolean * @return $this */ public function where($column, $operator = null, $value = null, $boolean = 'and') { } /** * Add a basic where clause to the query, and return the first result. * * @param \Closure|string|array|\FluentCart\Framework\Database\Query\Expression $column * @param mixed $operator * @param mixed $value * @param string $boolean * @return \FluentCart\Framework\Database\Orm\Model|static|null */ public function firstWhere($column, $operator = null, $value = null, $boolean = 'and') { } /** * Add an "or where" clause to the query. * * @param \Closure|array|string|\FluentCart\Framework\Database\Query\Expression $column * @param mixed $operator * @param mixed $value * @return $this */ public function orWhere($column, $operator = null, $value = null) { } /** * Add a basic "where not" clause to the query. * * @param (\Closure(static): mixed)|string|array|\FluentCart\Framework\Database\Query\Expression $column * @param mixed $operator * @param mixed $value * @param string $boolean * @return $this */ public function whereNot($column, $operator = null, $value = null, $boolean = 'and') { } /** * Add an "or where not" clause to the query. * * @param (\Closure(static): mixed)|array|string|\FluentCart\Framework\Database\Query\Expression $column * @param mixed $operator * @param mixed $value * @return $this */ public function orWhereNot($column, $operator = null, $value = null) { } /** * Add an "order by" clause for a timestamp to the query. * * @param string|\FluentCart\Framework\Database\Query\Expression $column * @return $this */ public function latest($column = null) { } /** * Add an "order by" clause for a timestamp to the query. * * @param string|\FluentCart\Framework\Database\Query\Expression $column * @return $this */ public function oldest($column = null) { } /** * Create a collection of models from plain arrays. * * @param array $items * @return \FluentCart\Framework\Database\Orm\Collection */ public function hydrate(array $items, $args = []) { } /** * Create a collection of models from a raw query. * * @param string $query * @param array $bindings * @return \FluentCart\Framework\Database\Orm\Collection */ public function fromQuery($query, $bindings = []) { } /** * Find a model by its primary key. * * @param mixed $id * @param array $columns * @return \FluentCart\Framework\Database\Orm\Model|\FluentCart\Framework\Database\Orm\Collection|static[]|static|null */ public function find($id, $columns = ['*']) { } /** * Find multiple models by their primary keys. * * @param \FluentCart\Framework\Support\ArrayableInterface|array $ids * @param array $columns * @return \FluentCart\Framework\Database\Orm\Collection */ public function findMany($ids, $columns = ['*']) { } /** * Find a model by its primary key or throw an exception. * * @param mixed $id * @param array $columns * @return \FluentCart\Framework\Database\Orm\Model|\FluentCart\Framework\Database\Orm\Collection|static|static[] * * @throws \FluentCart\Framework\Database\Orm\ModelNotFoundException */ public function findOrFail($id, $columns = ['*']) { } /** * Find a model by its primary key or return fresh model instance. * * @param mixed $id * @param array $columns * @return \FluentCart\Framework\Database\Orm\Model|static */ public function findOrNew($id, $columns = ['*']) { } /** * Find a model by its primary key or call a callback. * * @template TValue * * @param mixed $id * @param (\Closure(): TValue)|list|string $columns * @param (\Closure(): TValue)|null $callback * @return TModel|TValue|\FluentCart\Framework\Database\Orm\Collection */ public function findOr($id, $columns = ['*'], ?\Closure $callback = null) { } /** * Get the first record matching the attributes or instantiate it. * * @param array $attributes * @param array $values * @return \FluentCart\Framework\Database\Orm\Model|static */ public function firstOrNew(array $attributes = [], array $values = []) { } /** * Get the first record matching the attributes or create it. * * @param array $attributes * @param array $values * @return \FluentCart\Framework\Database\Orm\Model|static */ public function firstOrCreate(array $attributes = [], array $values = []) { } /** * Attempt to create the record. If a unique constraint violation occurs, attempt to find the matching record. * * @param array $attributes * @param array $values * @return TModel */ public function createOrFirst(array $attributes = [], array $values = []) { } /** * Create or update a record matching the attributes, and fill it with values. * * @param array $attributes * @param array $values * @return \FluentCart\Framework\Database\Orm\Model|static */ public function updateOrCreate(array $attributes, array $values = []) { } /** * Execute the query and get the first result or throw an exception. * * @param array $columns * @return \FluentCart\Framework\Database\Orm\Model|static * * @throws \FluentCart\Framework\Database\Orm\ModelNotFoundException */ public function firstOrFail($columns = ['*']) { } /** * Execute the query and get the first result or call a callback. * * @param \Closure|array $columns * @param \Closure|null $callback * @return \FluentCart\Framework\Database\Orm\Model|static|mixed */ public function firstOr($columns = ['*'], ?\Closure $callback = null) { } /** * Execute the query and get the first result if it's the sole matching record. * * @param array|string $columns * @return \FluentCart\Framework\Database\Orm\Model * * @throws \FluentCart\Framework\Database\Orm\ModelNotFoundException * @throws \FluentCart\Framework\Database\MultipleRecordsFoundException */ public function sole($columns = ['*']) { } /** * Get a single column's value from the first result of a query. * * @param string|\FluentCart\Framework\Database\Query\Expression $column * @return mixed */ public function value($column) { } /** * Get a single column's value from the first result of a query if it's the sole matching record. * * @param string|\FluentCart\Framework\Database\Query\Expression $column * @return mixed * * @throws \FluentCart\Framework\Database\Orm\ModelNotFoundException * @throws \FluentCart\Framework\Database\MultipleRecordsFoundException */ public function soleValue($column) { } /** * Get a single column's value from the first result of the query or throw an exception. * * @param string|\FluentCart\Framework\Database\Query\Expression $column * @return mixed * * @throws \FluentCart\Framework\Database\Orm\ModelNotFoundException */ public function valueOrFail($column) { } /** * Execute the query as a "select" statement. * * @param array|string $columns * @return \FluentCart\Framework\Database\Orm\Collection|static[] */ public function get($columns = ['*']) { } /** * Get the hydrated models without eager loading. * * @param array|string $columns * @return \FluentCart\Framework\Database\Orm\Model[]|static[] */ public function getModels($columns = ['*']) { } /** * Eager load the relationships for the models. * * @param array $models * @return array */ public function eagerLoadRelations(array $models) { } /** * Eagerly load the relationship on a set of models. * * @param array $models * @param string $name * @param \Closure $constraints * @return array */ protected function eagerLoadRelation(array $models, $name, \Closure $constraints) { } /** * Get the relation instance for the given relation name. * * @param string $name * @return \FluentCart\Framework\Database\Orm\Relations\Relation */ public function getRelation($name) { } /** * Get the deeply nested relations for a given top-level relation. * * @param string $relation * @return array */ protected function relationsNestedUnder($relation) { } /** * Determine if the relationship is nested. * * @param string $relation * @param string $name * @return bool */ protected function isNestedUnder($relation, $name) { } /** * Register a closure to be invoked after the query is executed. * * @param \Closure $callback * @return $this */ public function afterQuery(\Closure $callback) { } /** * Invoke the "after query" modification callbacks. * * @param mixed $result * @return mixed */ public function applyAfterQueryCallbacks($result) { } /** * Get a lazy collection for the given query. * * @return \FluentCart\Framework\Support\LazyCollection */ public function cursor() { } /** * Get a lazy collection for the given query using raw query. * * @return \FluentCart\Framework\Support\LazyCollection */ public function rawCursor() { } /** * Add a generic "order by" clause if the query doesn't already have one. * * @return void */ protected function enforceOrderBy() { } /** * Get an array with the values of a given column. * * @param string|\FluentCart\Framework\Database\Query\Expression $column * @param string|null $key * @return \FluentCart\Framework\Support\Collection */ public function pluck($column, $key = null) { } /** * Paginate the given query. * * @param int|null|\Closure $perPage * @param array|string $columns * @param string $pageName * @param int|null $page * @param \Closure|int|null $total * @return \FluentCart\Framework\Pagination\LengthAwarePaginator * * @throws \InvalidArgumentException */ public function paginate($perPage = null, $columns = ['*'], $pageName = 'page', $page = null, $total = null) { } /** * Paginate the given query into a simple paginator. * * @param int|null $perPage * @param array $columns * @param string $pageName * @param int|null $page * @return \FluentCart\Framework\Pagination\PaginatorInterface */ public function simplePaginate($perPage = null, $columns = ['*'], $pageName = 'page', $page = null) { } /** * Paginate the given query into a cursor paginator. * * @param int|null $perPage * @param array $columns * @param string $cursorName * @param \FluentCart\Framework\Pagination\Cursor|string|null $cursor * @return \FluentCart\Framework\Pagination\CursorPaginator */ public function cursorPaginate($perPage = null, $columns = ['*'], $cursorName = 'cursor', $cursor = null) { } /** * Ensure the proper order by required for cursor pagination. * * @param bool $shouldReverse * @return \FluentCart\Framework\Support\Collection */ protected function ensureOrderForCursorPagination($shouldReverse = false) { } /** * Save a new model and return the instance. * * @param array $attributes * @return \FluentCart\Framework\Database\Orm\Model|$this */ public function create(array $attributes = []) { } /** * Save a new model and return the instance. Allow mass-assignment. * * @param array $attributes * @return \FluentCart\Framework\Database\Orm\Model|$this */ public function forceCreate(array $attributes) { } /** * Save a new model instance with mass assignment without raising model events. * * @param array $attributes * @return TModel */ public function forceCreateQuietly(array $attributes = []) { } /** * Update records in the database. * * @param array $values * @return int */ public function update(array $values) { } /** * Insert new records or update the existing ones. * * @param array $values * @param array|string $uniqueBy * @param array|null $update * @return int */ public function upsert(array $values, $uniqueBy, $update = null) { } /** * Update the column's update timestamp. * * @param string|null $column * @return int|false */ public function touch($column = null) { } /** * Increment a column's value by a given amount. * * @param string|\FluentCart\Framework\Database\Query\Expression $column * @param float|int $amount * @param array $extra * @return int */ public function increment($column, $amount = 1, array $extra = []) { } /** * Decrement a column's value by a given amount. * * @param string|\FluentCart\Framework\Database\Query\Expression $column * @param float|int $amount * @param array $extra * @return int */ public function decrement($column, $amount = 1, array $extra = []) { } /** * Add the "updated at" column to an array of values. * * @param array $values * @return array */ protected function addUpdatedAtColumn(array $values) { } /** * Add unique IDs to the inserted values. * * @param array $values * @return array */ protected function addUniqueIdsToUpsertValues(array $values) { } /** * Add timestamps to the inserted values. * * @param array $values * @return array */ protected function addTimestampsToUpsertValues(array $values) { } /** * Add the "updated at" column to the updated columns. * * @param array $update * @return array */ protected function addUpdatedAtToUpsertColumns(array $update) { } /** * Delete records from the database. * * @return mixed */ public function delete() { } /** * Run the default delete function on the builder. * * Since we do not apply scopes here, the row will actually be deleted. * * @return mixed */ public function forceDelete() { } /** * Register a replacement for the default delete function. * * @param \Closure $callback * @return void */ public function onDelete(\Closure $callback) { } /** * Determine if the given model has a scope. * * @param string $scope * @return bool */ public function hasNamedScope($scope) { } /** * Call the given local model scopes. * * @param array|string $scopes * @return static|mixed */ public function scopes($scopes) { } /** * Apply the scopes to the Orm builder instance and return it. * * @return static */ public function applyScopes() { } /** * Apply the given scope on the current builder instance. * * @param callable $scope * @param array $parameters * @return mixed */ protected function callScope(callable $scope, array $parameters = []) { } /** * Apply the given named scope on the current builder instance. * * @param string $scope * @param array $parameters * @return mixed */ protected function callNamedScope($scope, array $parameters = []) { } /** * Nest where conditions by slicing them at the given where count. * * @param \FluentCart\Framework\Database\Query\Builder $query * @param int $originalWhereCount * @return void */ protected function addNewWheresWithinGroup(\FluentCart\Framework\Database\Query\Builder $query, $originalWhereCount) { } /** * Slice where conditions at the given offset and add them to the query as a nested condition. * * @param \FluentCart\Framework\Database\Query\Builder $query * @param array $whereSlice * @return void */ protected function groupWhereSliceForScope(\FluentCart\Framework\Database\Query\Builder $query, $whereSlice) { } /** * Create a where array with nested where conditions. * * @param array $whereSlice * @param string $boolean * @return array */ protected function createNestedWhere($whereSlice, $boolean = 'and') { } /** * Set the relationships that should be eager loaded. * * @param string|array $relations * @param string|\Closure|null $callback * @return $this */ public function with($relations, $callback = null) { } /** * Prevent the specified relations from being eager loaded. * * @param mixed $relations * @return $this */ public function without($relations) { } /** * Set the relationships that should be eager loaded while removing any previously added eager loading specifications. * * @param mixed $relations * @return $this */ public function withOnly($relations) { } /** * Create a new instance of the model being queried. * * @param array $attributes * @return \FluentCart\Framework\Database\Orm\Model|static */ public function newModelInstance($attributes = []) { } /** * Parse a list of relations into individuals. * * @param array $relations * @return array */ protected function parseWithRelations(array $relations) { } protected function prepareNestedWithRelationships($relations, $prefix = '') { } /** * Combine an array of constraints into a single constraint. * * @param array $constraints * @return \Closure */ protected function combineConstraints(array $constraints) { } /** * Parse the attribute select constraints from the name. * * @param string $name * @return array */ protected function parseNameAndAttributeSelectionConstraint($name) { } /** * Create a constraint to select the given columns for the relation. * * @param string $name * @return array */ protected function createSelectWithConstraint($name) { } /** * Parse the nested relationships in a relation. * * @param string $name * @param array $results * @return array */ protected function addNestedWiths($name, $results) { } /** * Apply query-time casts to the model instance. * * @param array $casts * @return $this */ public function withCasts($casts) { } /** * Execute the given Closure within a transaction savepoint if needed. * * @template TModelValue * * @param \Closure(): TModelValue $scope * @return TModelValue */ public function withSavepointIfNeeded(\Closure $scope) { } /** * Get the Eloquent builder instances that are used in the union of the query. * * @return \FluentCart\Framework\Support\Collection */ protected function getUnionBuilders() { } /** * Get the underlying query builder instance. * * @return \FluentCart\Framework\Database\Query\Builder */ public function getQuery() { } /** * Set the underlying query builder instance. * * @param \FluentCart\Framework\Database\Query\Builder $query * @return $this */ public function setQuery($query) { } /** * Get a base query builder instance. * * @return \FluentCart\Framework\Database\Query\Builder */ public function toBase() { } /** * Get the relationships being eagerly loaded. * * @return array */ public function getEagerLoads() { } /** * Set the relationships being eagerly loaded. * * @param array $eagerLoad * @return $this */ public function setEagerLoads(array $eagerLoad) { } /** * Indicate that the given relationships should not be eagerly loaded. * * @param array $relations * @return $this */ public function withoutEagerLoad(array $relations) { } /** * Flush the relationships being eagerly loaded. * * @return $this */ public function withoutEagerLoads() { } /** * Get the default key name of the table. * * @return string */ protected function defaultKeyName() { } /** * Get the model instance being queried. * * @return \FluentCart\Framework\Database\Orm\Model|static */ public function getModel() { } /** * Set a model instance for the model being queried. * * @param \FluentCart\Framework\Database\Orm\Model $model * @return $this */ public function setModel(\FluentCart\Framework\Database\Orm\Model $model) { } /** * Qualify the given column name by the model's table. * * @param string|\FluentCart\Framework\Database\Query\Expression $column * @return string */ public function qualifyColumn($column) { } /** * Qualify the given columns with the model's table. * * @param array|\FluentCart\Framework\Database\Query\Expression $columns * @return array */ public function qualifyColumns($columns) { } /** * Get the given macro by name. * * @param string $name * @return \Closure */ public function getMacro($name) { } /** * Checks if a macro is registered. * * @param string $name * @return bool */ public function hasMacro($name) { } /** * Get the given global macro by name. * * @param string $name * @return \Closure */ public static function getGlobalMacro($name) { } /** * Checks if a global macro is registered. * * @param string $name * @return bool */ public static function hasGlobalMacro($name) { } /** * Dynamically access builder proxies. * * @param string $key * @return mixed * * @throws \Exception */ public function __get($key) { } /** * Dynamically handle calls into the query instance. * * @param string $method * @param array $parameters * @return mixed */ public function __call($method, $parameters) { } /** * Dynamically handle calls into the query instance. * * @param string $method * @param array $parameters * @return mixed * * @throws \BadMethodCallException */ public static function __callStatic($method, $parameters) { } /** * Register the given mixin with the builder. * * @param string $mixin * @param bool $replace * @return void */ protected static function registerMixin($mixin, $replace) { } /** * Clone the Orm query builder. * * @return static */ public function clone() { } /** * Force a clone of the underlying query builder when cloning. * * @return void */ public function __clone() { } } interface Castable { /** * Get the name of the caster class to use when casting from / to this cast target. * * @param array $arguments * @return string * @return string|\FluentCart\Framework\Database\Orm\CastsAttributes|\FluentCart\Framework\Database\Orm\CastsInboundAttributes */ public static function castUsing(array $arguments); } } namespace FluentCart\Framework\Database\Orm\Casts { class ArrayObject extends \ArrayObject implements \FluentCart\Framework\Support\ArrayableInterface, \JsonSerializable { /** * Get a collection containing the underlying array. * * @return \FluentCart\Framework\Support\Collection */ public function collect() { } /** * Get the instance as an array. * * @return array */ public function toArray() { } /** * Get the array that should be JSON serialized. * * @return array */ #[\ReturnTypeWillChange] public function jsonSerialize() { } } class AsArrayObject implements \FluentCart\Framework\Database\Orm\Castable { /** * Get the caster class to use when casting from / to this cast target. * * @param array $arguments * @return object|string */ public static function castUsing(array $arguments) { } } class AsCollection implements \FluentCart\Framework\Database\Orm\Castable { /** * Get the caster class to use when casting from / to this cast target. * * @param array $arguments * @return \FluentCart\Framework\Database\Orm\CastsAttributes */ public static function castUsing(array $arguments) { } /** * Specify the collection for the cast. * * @param class-string $class * @return string */ public static function using($class) { } } class AsEncryptedArrayObject implements \FluentCart\Framework\Database\Orm\Castable { /** * Get the caster class to use when casting from / to this cast target. * * @param array $arguments * @return object|string */ public static function castUsing(array $arguments) { } } class AsEncryptedCollection implements \FluentCart\Framework\Database\Orm\Castable { /** * Get the caster class to use when casting from / to this cast target. * * @param array $arguments * @return object|string */ public static function castUsing(array $arguments) { } /** * Specify the collection for the cast. * * @param class-string $class * @return string */ public static function using($class) { } } class AsStringable implements \FluentCart\Framework\Database\Orm\Castable { /** * Get the caster class to use when casting from / to this cast target. * * @param array $arguments * @return object|string */ public static function castUsing(array $arguments) { } } class Attribute { /** * The attribute accessor. * * @var callable */ public $get; /** * The attribute mutator. * * @var callable */ public $set; /** * Indicates if caching is enabled for this attribute. * * @var bool */ public $withCaching = false; /** * Indicates if caching of objects is enabled for this attribute. * * @var bool */ public $withObjectCaching = true; /** * Create a new attribute accessor / mutator. * * @param callable|null $get * @param callable|null $set * @return void */ public function __construct(callable $get = null, callable $set = null) { } /** * Create a new attribute accessor / mutator. * * @param callable|null $get * @param callable|null $set * @return static */ public static function make(callable $get = null, callable $set = null) { } /** * Create a new attribute accessor. * * @param callable $get * @return static */ public static function get(callable $get) { } /** * Create a new attribute mutator. * * @param callable $set * @return static */ public static function set(callable $set) { } /** * Disable object caching for the attribute. * * @return static */ public function withoutObjectCaching() { } /** * Enable caching for the attribute. * * @return static */ public function shouldCache() { } } class Json { /** * The custom JSON encoder. * * @var callable|null */ protected static $encoder; /** * The custom JSON decode. * * @var callable|null */ protected static $decoder; /** * Encode the given value. */ public static function encode($value) { } /** * Decode the given value. */ public static function decode($value, $associative = true) { } /** * Encode all values using the given callable. */ public static function encodeUsing(callable $encoder) { } /** * Decode all values using the given callable. */ public static function decodeUsing(callable $decoder) { } } } namespace FluentCart\Framework\Database\Orm { interface CastsAttributes { /** * Transform the attribute from the underlying model values. * * @param \FluentCart\Framework\Database\Orm\Model $model * @param string $key * @param mixed $value * @param array $attributes * @return mixed */ public function get($model, string $key, $value, array $attributes); /** * Transform the attribute to its underlying model values. * * @param \FluentCart\Framework\Database\Orm\Model $model * @param string $key * @param mixed $value * @param array $attributes * @return mixed */ public function set($model, string $key, $value, array $attributes); } interface CastsInboundAttributes { /** * Transform the attribute to its underlying model values. * * @param \FluentCart\Framework\Database\Orm\Model $model * @param string $key * @param mixed $value * @param array $attributes * @return mixed */ public function set($model, string $key, $value, array $attributes); } } namespace FluentCart\Framework\Support { interface Enumerable extends \FluentCart\Framework\Support\ArrayableInterface, \Countable, \IteratorAggregate, \FluentCart\Framework\Support\JsonableInterface, \JsonSerializable { /** * Create a new collection instance if the value isn't one already. * * @param mixed $items * @return static */ public static function make($items = []); /** * Create a new instance by invoking the callback a given amount of times. * * @param int $number * @param callable|null $callback * @return static */ public static function times($number, ?callable $callback = null); /** * Create a collection with the given range. * * @param int $from * @param int $to * @return static */ public static function range($from, $to); /** * Wrap the given value in a collection if applicable. * * @param mixed $value * @return static */ public static function wrap($value); /** * Get the underlying items from the given collection if applicable. * * @param array|static $value * @return array */ public static function unwrap($value); /** * Create a new instance with no items. * * @return static */ public static function empty(); /** * Get all items in the enumerable. * * @return array */ public function all(); /** * Alias for the "avg" method. * * @param callable|string|null $callback * @return mixed */ public function average($callback = null); /** * Get the median of a given key. * * @param string|array|null $key * @return mixed */ public function median($key = null); /** * Get the mode of a given key. * * @param string|array|null $key * @return array|null */ public function mode($key = null); /** * Collapse the items into a single enumerable. * * @return static */ public function collapse(); /** * Alias for the "contains" method. * * @param mixed $key * @param mixed $operator * @param mixed $value * @return bool */ public function some($key, $operator = null, $value = null); /** * Determine if an item exists, using strict comparison. * * @param mixed $key * @param mixed $value * @return bool */ public function containsStrict($key, $value = null); /** * Get the average value of a given key. * * @param callable|string|null $callback * @return mixed */ public function avg($callback = null); /** * Determine if an item exists in the enumerable. * * @param mixed $key * @param mixed $operator * @param mixed $value * @return bool */ public function contains($key, $operator = null, $value = null); /** * Cross join with the given lists, returning all possible permutations. * * @param mixed ...$lists * @return static */ public function crossJoin(...$lists); /** * Dump the collection and end the script. * * @param mixed ...$args * @return void */ // public function dd(...$args); /** * Dump the collection. * * @return $this */ // public function dump(); /** * Get the items that are not present in the given items. * * @param mixed $items * @return static */ public function diff($items); /** * Get the items that are not present in the given items, using the callback. * * @param mixed $items * @param callable $callback * @return static */ public function diffUsing($items, callable $callback); /** * Get the items whose keys and values are not present in the given items. * * @param mixed $items * @return static */ public function diffAssoc($items); /** * Get the items whose keys and values are not present in the given items, using the callback. * * @param mixed $items * @param callable $callback * @return static */ public function diffAssocUsing($items, callable $callback); /** * Get the items whose keys are not present in the given items. * * @param mixed $items * @return static */ public function diffKeys($items); /** * Get the items whose keys are not present in the given items, using the callback. * * @param mixed $items * @param callable $callback * @return static */ public function diffKeysUsing($items, callable $callback); /** * Retrieve duplicate items. * * @param callable|string|null $callback * @param bool $strict * @return static */ public function duplicates($callback = null, $strict = false); /** * Retrieve duplicate items using strict comparison. * * @param callable|string|null $callback * @return static */ public function duplicatesStrict($callback = null); /** * Execute a callback over each item. * * @param callable $callback * @return $this */ public function each(callable $callback); /** * Execute a callback over each nested chunk of items. * * @param callable $callback * @return static */ public function eachSpread(callable $callback); /** * Determine if all items pass the given truth test. * * @param string|callable $key * @param mixed $operator * @param mixed $value * @return bool */ public function every($key, $operator = null, $value = null); /** * Get all items except for those with the specified keys. * * @param mixed $keys * @return static */ public function except($keys); /** * Run a filter over each of the items. * * @param callable|null $callback * @return static */ public function filter(?callable $callback = null); /** * Apply the callback if the value is truthy. * * @param bool $value * @param callable $callback * @param callable|null $default * @return static|mixed */ public function when($value, callable $callback, ?callable $default = null); /** * Apply the callback if the collection is empty. * * @param callable $callback * @param callable|null $default * @return static|mixed */ public function whenEmpty(callable $callback, ?callable $default = null); /** * Apply the callback if the collection is not empty. * * @param callable $callback * @param callable|null $default * @return static|mixed */ public function whenNotEmpty(callable $callback, ?callable $default = null); /** * Apply the callback if the value is falsy. * * @param bool $value * @param callable $callback * @param callable|null $default * @return static|mixed */ public function unless($value, callable $callback, ?callable $default = null); /** * Apply the callback unless the collection is empty. * * @param callable $callback * @param callable|null $default * @return static|mixed */ public function unlessEmpty(callable $callback, ?callable $default = null); /** * Apply the callback unless the collection is not empty. * * @param callable $callback * @param callable|null $default * @return static|mixed */ public function unlessNotEmpty(callable $callback, ?callable $default = null); /** * Filter items by the given key value pair. * * @param string $key * @param mixed $operator * @param mixed $value * @return static */ public function where($key, $operator = null, $value = null); /** * Filter items where the value for the given key is null. * * @param string|null $key * @return static */ public function whereNull($key = null); /** * Filter items where the value for the given key is not null. * * @param string|null $key * @return static */ public function whereNotNull($key = null); /** * Filter items by the given key value pair using strict comparison. * * @param string $key * @param mixed $value * @return static */ public function whereStrict($key, $value); /** * Filter items by the given key value pair. * * @param string $key * @param mixed $values * @param bool $strict * @return static */ public function whereIn($key, $values, $strict = false); /** * Filter items by the given key value pair using strict comparison. * * @param string $key * @param mixed $values * @return static */ public function whereInStrict($key, $values); /** * Filter items such that the value of the given key is between the given values. * * @param string $key * @param array $values * @return static */ public function whereBetween($key, $values); /** * Filter items such that the value of the given key is not between the given values. * * @param string $key * @param array $values * @return static */ public function whereNotBetween($key, $values); /** * Filter items by the given key value pair. * * @param string $key * @param mixed $values * @param bool $strict * @return static */ public function whereNotIn($key, $values, $strict = false); /** * Filter items by the given key value pair using strict comparison. * * @param string $key * @param mixed $values * @return static */ public function whereNotInStrict($key, $values); /** * Filter the items, removing any items that don't match the given type(s). * * @param string|string[] $type * @return static */ public function whereInstanceOf($type); /** * Get the first item from the enumerable passing the given truth test. * * @param callable|null $callback * @param mixed $default * @return mixed */ public function first(?callable $callback = null, $default = null); /** * Get the first item by the given key value pair. * * @param string $key * @param mixed $operator * @param mixed $value * @return mixed */ public function firstWhere($key, $operator = null, $value = null); /** * Get a flattened array of the items in the collection. * * @param int|float $depth * @return static */ public function flatten($depth = INF); /** * Flip the values with their keys. * * @return static */ public function flip(); /** * Get an item from the collection by key. * * @param mixed $key * @param mixed $default * @return mixed */ public function get($key, $default = null); /** * Group an associative array by a field or using a callback. * * @param array|callable|string $groupBy * @param bool $preserveKeys * @return static */ public function groupBy($groupBy, $preserveKeys = false); /** * Key an associative array by a field or using a callback. * * @param callable|string $keyBy * @return static */ public function keyBy($keyBy); /** * Determine if an item exists in the collection by key. * * @param mixed $key * @return bool */ public function has($key); /** * Concatenate values of a given key as a string. * * @param string $value * @param string|null $glue * @return string */ public function implode($value, $glue = null); /** * Intersect the collection with the given items. * * @param mixed $items * @return static */ public function intersect($items); /** * Intersect the collection with the given items by key. * * @param mixed $items * @return static */ public function intersectByKeys($items); /** * Determine if the collection is empty or not. * * @return bool */ public function isEmpty(); /** * Determine if the collection is not empty. * * @return bool */ public function isNotEmpty(); /** * Join all items from the collection using a string. The final items can use a separate glue string. * * @param string $glue * @param string $finalGlue * @return string */ public function join($glue, $finalGlue = ''); /** * Get the keys of the collection items. * * @return static */ public function keys(); /** * Get the last item from the collection. * * @param callable|null $callback * @param mixed $default * @return mixed */ public function last(?callable $callback = null, $default = null); /** * Run a map over each of the items. * * @param callable $callback * @return static */ public function map(callable $callback); /** * Run a map over each nested chunk of items. * * @param callable $callback * @return static */ public function mapSpread(callable $callback); /** * Run a dictionary map over the items. * * The callback should return an associative array with a single key/value pair. * * @param callable $callback * @return static */ public function mapToDictionary(callable $callback); /** * Run a grouping map over the items. * * The callback should return an associative array with a single key/value pair. * * @param callable $callback * @return static */ public function mapToGroups(callable $callback); /** * Run an associative map over each of the items. * * The callback should return an associative array with a single key/value pair. * * @param callable $callback * @return static */ public function mapWithKeys(callable $callback); /** * Map a collection and flatten the result by a single level. * * @param callable $callback * @return static */ public function flatMap(callable $callback); /** * Map the values into a new class. * * @param string $class * @return static */ public function mapInto($class); /** * Merge the collection with the given items. * * @param mixed $items * @return static */ public function merge($items); /** * Recursively merge the collection with the given items. * * @param mixed $items * @return static */ public function mergeRecursive($items); /** * Create a collection by using this collection for keys and another for its values. * * @param mixed $values * @return static */ public function combine($values); /** * Union the collection with the given items. * * @param mixed $items * @return static */ public function union($items); /** * Get the min value of a given key. * * @param callable|string|null $callback * @return mixed */ public function min($callback = null); /** * Get the max value of a given key. * * @param callable|string|null $callback * @return mixed */ public function max($callback = null); /** * Create a new collection consisting of every n-th element. * * @param int $step * @param int $offset * @return static */ public function nth($step, $offset = 0); /** * Get the items with the specified keys. * * @param mixed $keys * @return static */ public function only($keys); /** * "Paginate" the collection by slicing it into a smaller collection. * * @param int $page * @param int $perPage * @return static */ public function forPage($page, $perPage); /** * Partition the collection into two arrays using the given callback or key. * * @param callable|string $key * @param mixed $operator * @param mixed $value * @return static */ public function partition($key, $operator = null, $value = null); /** * Push all of the given items onto the collection. * * @param iterable $source * @return static */ public function concat($source); /** * Get one or a specified number of items randomly from the collection. * * @param int|null $number * @return static|mixed * * @throws \InvalidArgumentException */ public function random($number = null); /** * Reduce the collection to a single value. * * @param callable $callback * @param mixed $initial * @return mixed */ public function reduce(callable $callback, $initial = null); /** * Replace the collection items with the given items. * * @param mixed $items * @return static */ public function replace($items); /** * Recursively replace the collection items with the given items. * * @param mixed $items * @return static */ public function replaceRecursive($items); /** * Reverse items order. * * @return static */ public function reverse(); /** * Search the collection for a given value and return the corresponding key if successful. * * @param mixed $value * @param bool $strict * @return mixed */ public function search($value, $strict = false); /** * Shuffle the items in the collection. * * @param int|null $seed * @return static */ public function shuffle($seed = null); /** * Skip the first {$count} items. * * @param int $count * @return static */ public function skip($count); /** * Skip items in the collection until the given condition is met. * * @param mixed $value * @return static */ public function skipUntil($value); /** * Skip items in the collection while the given condition is met. * * @param mixed $value * @return static */ public function skipWhile($value); /** * Get a slice of items from the enumerable. * * @param int $offset * @param int|null $length * @return static */ public function slice($offset, $length = null); /** * Split a collection into a certain number of groups. * * @param int $numberOfGroups * @return static */ public function split($numberOfGroups); /** * Chunk the collection into chunks of the given size. * * @param int $size * @return static */ public function chunk($size); /** * Chunk the collection into chunks with a callback. * * @param callable $callback * @return static */ public function chunkWhile(callable $callback); /** * Sort through each item with a callback. * * @param callable|null|int $callback * @return static */ public function sort($callback = null); /** * Sort items in descending order. * * @param int $options * @return static */ public function sortDesc($options = SORT_REGULAR); /** * Sort the collection using the given callback. * * @param callable|string $callback * @param int $options * @param bool $descending * @return static */ public function sortBy($callback, $options = SORT_REGULAR, $descending = false); /** * Sort the collection in descending order using the given callback. * * @param callable|string $callback * @param int $options * @return static */ public function sortByDesc($callback, $options = SORT_REGULAR); /** * Sort the collection keys. * * @param int $options * @param bool $descending * @return static */ public function sortKeys($options = SORT_REGULAR, $descending = false); /** * Sort the collection keys in descending order. * * @param int $options * @return static */ public function sortKeysDesc($options = SORT_REGULAR); /** * Get the sum of the given values. * * @param callable|string|null $callback * @return mixed */ public function sum($callback = null); /** * Take the first or last {$limit} items. * * @param int $limit * @return static */ public function take($limit); /** * Take items in the collection until the given condition is met. * * @param mixed $value * @return static */ public function takeUntil($value); /** * Take items in the collection while the given condition is met. * * @param mixed $value * @return static */ public function takeWhile($value); /** * Pass the collection to the given callback and then return it. * * @param callable $callback * @return $this */ public function tap(callable $callback); /** * Pass the enumerable to the given callback and return the result. * * @param callable $callback * @return mixed */ public function pipe(callable $callback); /** * Get the values of a given key. * * @param string|array $value * @param string|null $key * @return static */ public function pluck($value, $key = null); /** * Create a collection of all elements that do not pass a given truth test. * * @param callable|mixed $callback * @return static */ public function reject($callback = true); /** * Return only unique items from the collection array. * * @param string|callable|null $key * @param bool $strict * @return static */ public function unique($key = null, $strict = false); /** * Return only unique items from the collection array using strict comparison. * * @param string|callable|null $key * @return static */ public function uniqueStrict($key = null); /** * Reset the keys on the underlying array. * * @return static */ public function values(); /** * Pad collection to the specified length with a value. * * @param int $size * @param mixed $value * @return static */ public function pad($size, $value); /** * Count the number of items in the collection using a given truth test. * * @param callable|null $callback * @return static */ public function countBy($callback = null); /** * Zip the collection together with one or more arrays. * * e.g. new Collection([1, 2, 3])->zip([4, 5, 6]); * => [[1, 4], [2, 5], [3, 6]] * * @param mixed ...$items * @return static */ public function zip($items); /** * Collect the values into a collection. * * @return \FluentCart\Framework\Support\Collection */ public function collect(); /** * Convert the collection to its string representation. * * @return string */ public function __toString(); /** * Add a method to the list of proxied methods. * * @param string $method * @return void */ public static function proxy($method); /** * Dynamically access collection proxies. * * @param string $key * @return mixed * * @throws \Exception */ public function __get($key); } /** * @property-read \FluentCart\Framework\Support\HigherOrderCollectionProxy $average * @property-read \FluentCart\Framework\Support\HigherOrderCollectionProxy $avg * @property-read \FluentCart\Framework\Support\HigherOrderCollectionProxy $contains * @property-read \FluentCart\Framework\Support\HigherOrderCollectionProxy $doesntContain * @property-read \FluentCart\Framework\Support\HigherOrderCollectionProxy $each * @property-read \FluentCart\Framework\Support\HigherOrderCollectionProxy $every * @property-read \FluentCart\Framework\Support\HigherOrderCollectionProxy $filter * @property-read \FluentCart\Framework\Support\HigherOrderCollectionProxy $first * @property-read \FluentCart\Framework\Support\HigherOrderCollectionProxy $flatMap * @property-read \FluentCart\Framework\Support\HigherOrderCollectionProxy $groupBy * @property-read \FluentCart\Framework\Support\HigherOrderCollectionProxy $keyBy * @property-read \FluentCart\Framework\Support\HigherOrderCollectionProxy $map * @property-read \FluentCart\Framework\Support\HigherOrderCollectionProxy $max * @property-read \FluentCart\Framework\Support\HigherOrderCollectionProxy $min * @property-read \FluentCart\Framework\Support\HigherOrderCollectionProxy $partition * @property-read \FluentCart\Framework\Support\HigherOrderCollectionProxy $reject * @property-read \FluentCart\Framework\Support\HigherOrderCollectionProxy $some * @property-read \FluentCart\Framework\Support\HigherOrderCollectionProxy $sortBy * @property-read \FluentCart\Framework\Support\HigherOrderCollectionProxy $sortByDesc * @property-read \FluentCart\Framework\Support\HigherOrderCollectionProxy $skipUntil * @property-read \FluentCart\Framework\Support\HigherOrderCollectionProxy $skipWhile * @property-read \FluentCart\Framework\Support\HigherOrderCollectionProxy $sum * @property-read \FluentCart\Framework\Support\HigherOrderCollectionProxy $takeUntil * @property-read \FluentCart\Framework\Support\HigherOrderCollectionProxy $takeWhile * @property-read \FluentCart\Framework\Support\HigherOrderCollectionProxy $unique * @property-read \FluentCart\Framework\Support\HigherOrderCollectionProxy $until */ trait EnumeratesValues { /** * Indicates that the object's string representation should be escaped when __toString is invoked. * * @var bool */ protected $escapeWhenCastingToString = false; /** * The methods that can be proxied. * * @var string[] */ protected static $proxies = ['average', 'avg', 'contains', 'doesntContain', 'each', 'every', 'filter', 'first', 'flatMap', 'groupBy', 'keyBy', 'map', 'max', 'min', 'partition', 'reject', 'skipUntil', 'skipWhile', 'some', 'sortBy', 'sortByDesc', 'sum', 'takeUntil', 'takeWhile', 'unique', 'until']; /** * Create a new collection instance if the value isn't one already. * * @param mixed $items * @return static */ public static function make($items = []) { } /** * Wrap the given value in a collection if applicable. * * @param mixed $value * @return static */ public static function wrap($value) { } /** * Get the underlying items from the given collection if applicable. * * @param array|static $value * @return array */ public static function unwrap($value) { } /** * Create a new instance with no items. * * @return static */ public static function empty() { } /** * Create a new collection by invoking the callback a given amount of times. * * @param int $number * @param callable|null $callback * @return static */ public static function times($number, ?callable $callback = null) { } /** * Alias for the "avg" method. * * @param callable|string|null $callback * @return mixed */ public function average($callback = null) { } /** * Alias for the "contains" method. * * @param mixed $key * @param mixed $operator * @param mixed $value * @return bool */ public function some($key, $operator = null, $value = null) { } /** * Determine if an item exists, using strict comparison. * * @param mixed $key * @param mixed $value * @return bool */ public function containsStrict($key, $value = null) { } /** * Execute a callback over each item. * * @param callable $callback * @return $this */ public function each(callable $callback) { } /** * Execute a callback over each nested chunk of items. * * @param callable $callback * @return static */ public function eachSpread(callable $callback) { } /** * Determine if all items pass the given truth test. * * @param string|callable $key * @param mixed $operator * @param mixed $value * @return bool */ public function every($key, $operator = null, $value = null) { } /** * Get the first item by the given key value pair. * * @param string $key * @param mixed $operator * @param mixed $value * @return mixed */ public function firstWhere($key, $operator = null, $value = null) { } /** * Determine if the collection is not empty. * * @return bool */ public function isNotEmpty() { } /** * Run a map over each nested chunk of items. * * @param callable $callback * @return static */ public function mapSpread(callable $callback) { } /** * Run a grouping map over the items. * * The callback should return an associative array with a single key/value pair. * * @param callable $callback * @return static */ public function mapToGroups(callable $callback) { } /** * Map a collection and flatten the result by a single level. * * @param callable $callback * @return static */ public function flatMap(callable $callback) { } /** * Map the values into a new class. * * @param string $class * @return static */ public function mapInto($class) { } /** * Get the min value of a given key. * * @param callable|string|null $callback * @return mixed */ public function min($callback = null) { } /** * Get the max value of a given key. * * @param callable|string|null $callback * @return mixed */ public function max($callback = null) { } /** * "Paginate" the collection by slicing it into a smaller collection. * * @param int $page * @param int $perPage * @return static */ public function forPage($page, $perPage) { } /** * Partition the collection into two arrays using the given callback or key. * * @param callable|string $key * @param mixed $operator * @param mixed $value * @return static */ public function partition($key, $operator = null, $value = null) { } /** * Get the sum of the given values. * * @param callable|string|null $callback * @return mixed */ public function sum($callback = null) { } /** * Apply the callback if the value is truthy. * * @param bool|mixed $value * @param callable|null $callback * @param callable|null $default * @return static|mixed */ public function when($value, ?callable $callback = null, ?callable $default = null) { } /** * Apply the callback if the collection is empty. * * @param callable $callback * @param callable|null $default * @return static|mixed */ public function whenEmpty(callable $callback, ?callable $default = null) { } /** * Apply the callback if the collection is not empty. * * @param callable $callback * @param callable|null $default * @return static|mixed */ public function whenNotEmpty(callable $callback, ?callable $default = null) { } /** * Apply the callback if the value is falsy. * * @param bool $value * @param callable $callback * @param callable|null $default * @return static|mixed */ public function unless($value, callable $callback, ?callable $default = null) { } /** * Apply the callback unless the collection is empty. * * @param callable $callback * @param callable|null $default * @return static|mixed */ public function unlessEmpty(callable $callback, ?callable $default = null) { } /** * Apply the callback unless the collection is not empty. * * @param callable $callback * @param callable|null $default * @return static|mixed */ public function unlessNotEmpty(callable $callback, ?callable $default = null) { } /** * Filter items by the given key value pair. * * @param string $key * @param mixed $operator * @param mixed $value * @return static */ public function where($key, $operator = null, $value = null) { } /** * Filter items where the value for the given key is null. * * @param string|null $key * @return static */ public function whereNull($key = null) { } /** * Filter items where the value for the given key is not null. * * @param string|null $key * @return static */ public function whereNotNull($key = null) { } /** * Filter items by the given key value pair using strict comparison. * * @param string $key * @param mixed $value * @return static */ public function whereStrict($key, $value) { } /** * Filter items by the given key value pair. * * @param string $key * @param mixed $values * @param bool $strict * @return static */ public function whereIn($key, $values, $strict = false) { } /** * Filter items by the given key value pair using strict comparison. * * @param string $key * @param mixed $values * @return static */ public function whereInStrict($key, $values) { } /** * Filter items such that the value of the given key is between the given values. * * @param string $key * @param array $values * @return static */ public function whereBetween($key, $values) { } /** * Filter items such that the value of the given key is not between the given values. * * @param string $key * @param array $values * @return static */ public function whereNotBetween($key, $values) { } /** * Filter items by the given key value pair. * * @param string $key * @param mixed $values * @param bool $strict * @return static */ public function whereNotIn($key, $values, $strict = false) { } /** * Filter items by the given key value pair using strict comparison. * * @param string $key * @param mixed $values * @return static */ public function whereNotInStrict($key, $values) { } /** * Filter the items, removing any items that don't match the given type(s). * * @param string|string[] $type * @return static */ public function whereInstanceOf($type) { } /** * Pass the collection to the given callback and return the result. * * @param callable $callback * @return mixed */ public function pipe(callable $callback) { } /** * Pass the collection into a new class. * * @param string $class * @return mixed */ public function pipeInto($class) { } /** * Pass the collection through a series of callable pipes * and return the result. * * @param array $pipes * @return mixed */ public function pipeThrough($pipes) { } /** * Pass the collection to the given callback and then return it. * * @param callable $callback * @return $this */ public function tap(callable $callback) { } /** * Reduce the collection to a single value. * * @param callable $callback * @param mixed $initial * @return mixed */ public function reduce(callable $callback, $initial = null) { } /** * Reduce the collection to multiple aggregate values. * * @param callable $callback * @param mixed ...$initial * @return array * * @deprecated Use "reduceSpread" instead * * @throws \UnexpectedValueException */ public function reduceMany(callable $callback, ...$initial) { } /** * Reduce the collection to multiple aggregate values. * * @param callable $callback * @param mixed ...$initial * @return array * * @throws \UnexpectedValueException */ public function reduceSpread(callable $callback, ...$initial) { } /** * Reduce an associative collection to a single value. * * @param callable $callback * @param mixed $initial * @return mixed */ public function reduceWithKeys(callable $callback, $initial = null) { } /** * Create a collection of all elements that do not pass a given truth test. * * @param callable|mixed $callback * @return static */ public function reject($callback = true) { } /** * Return only unique items from the collection array using strict comparison. * * @param string|callable|null $key * @return static */ public function uniqueStrict($key = null) { } /** * Collect the values into a collection. * * @return \FluentCart\Framework\Support\Collection */ public function collect() { } /** * Get the collection of items as a plain array. * * @return array */ public function toArray() { } /** * Convert the object into something JSON serializable. * * @return array */ #[\ReturnTypeWillChange] public function jsonSerialize() { } /** * Get the collection of items as JSON. * * @param int $options * @return string */ public function toJson($options = 0) { } /** * Get a CachingIterator instance. * * @param int $flags * @return \CachingIterator */ public function getCachingIterator($flags = \CachingIterator::CALL_TOSTRING) { } /** * Convert the collection to its string representation. * * @return string */ public function __toString() { } /** * Indicate that the model's string representation should be escaped when __toString is invoked. * * @param bool $escape * @return $this */ public function escapeWhenCastingToString($escape = true) { } /** * Add a method to the list of proxied methods. * * @param string $method * @return void */ public static function proxy($method) { } /** * Dynamically access collection proxies. * * @param string $key * @return mixed * * @throws \Exception */ public function __get($key) { } /** * Results array of items from Collection or ArrayableInterface. * * @param mixed $items * @return array */ protected function getArrayableItems($items) { } /** * Get an operator checker callback. * * @param string $key * @param string|null $operator * @param mixed $value * @return \Closure */ protected function operatorForWhere($key, $operator = null, $value = null) { } /** * Determine if the given value is callable, but not a string. * * @param mixed $value * @return bool */ protected function useAsCallable($value) { } /** * Get a value retrieving callback. * * @param callable|string|null $value * @return callable */ protected function valueRetriever($value) { } /** * Make a function to check an item's equality. * * @param mixed $value * @return \Closure */ protected function equality($value) { } /** * Make a function using another function, by negating its result. * * @param \Closure $callback * @return \Closure */ protected function negate(\Closure $callback) { } /** * Make a function that returns what's passed to it. * * @return \Closure */ protected function identity() { } } class Collection implements \ArrayAccess, \FluentCart\Framework\Support\CanBeEscapedWhenCastToString, \FluentCart\Framework\Support\Enumerable { use \FluentCart\Framework\Support\EnumeratesValues, \FluentCart\Framework\Support\MacroableTrait; /** * Pass only key to any callback. */ const USE_KEY = 1; /** * Pass both key/value to any callback. */ const USE_BOTH = 2; /** * The items contained in the collection. * * @var array */ protected $items = []; /** * Create a new collection. * * @param mixed $items * @return void */ public function __construct($items = []) { } /** * Create a new collection instance. * * @param array $items * @return static */ public static function of($items) { } /** * Create a collection with the given range. * * @param int $from * @param int $to * @return static */ public static function range($from, $to) { } /** * Get all of the items in the collection. * * @return array */ public function all() { } /** * Get a lazy collection for the items in this collection. * * @return \FluentCart\Framework\Support\LazyCollection */ public function lazy() { } /** * Get the average value of a given key. * * @param callable|string|null $callback * @return mixed */ public function avg($callback = null) { } /** * Get the median of a given key. * * @param string|array|null $key * @return mixed */ public function median($key = null) { } /** * Get the mode of a given key. * * @param string|array|null $key * @return array|null */ public function mode($key = null) { } /** * Collapse the collection of items into a single array. * * @return static */ public function collapse() { } /** * Determine if an item exists in the collection. * * @param mixed $key * @param mixed $operator * @param mixed $value * @return bool */ public function contains($key, $operator = null, $value = null) { } /** * Determine if an item is not contained in the collection. * * @param mixed $key * @param mixed $operator * @param mixed $value * @return bool */ public function doesntContain($key, $operator = null, $value = null) { } /** * Cross join with the given lists, returning all possible permutations. * * @param mixed ...$lists * @return static */ public function crossJoin(...$lists) { } /** * Get the items in the collection that are not present in the given items. * * @param mixed $items * @return static */ public function diff($items) { } /** * Get the items in the collection that are not present in the given items, using the callback. * * @param mixed $items * @param callable $callback * @return static */ public function diffUsing($items, callable $callback) { } /** * Get the items in the collection whose keys and values are not present in the given items. * * @param mixed $items * @return static */ public function diffAssoc($items) { } /** * Get the items in the collection whose keys and values are not present in the given items, using the callback. * * @param mixed $items * @param callable $callback * @return static */ public function diffAssocUsing($items, callable $callback) { } /** * Get the items in the collection whose keys are not present in the given items. * * @param mixed $items * @return static */ public function diffKeys($items) { } /** * Get the items in the collection whose keys are not present in the given items, using the callback. * * @param mixed $items * @param callable $callback * @return static */ public function diffKeysUsing($items, callable $callback) { } /** * Retrieve duplicate items from the collection. * * @param callable|string|null $callback * @param bool $strict * @return static */ public function duplicates($callback = null, $strict = false) { } /** * Retrieve duplicate items from the collection using strict comparison. * * @param callable|string|null $callback * @return static */ public function duplicatesStrict($callback = null) { } /** * Get the comparison function to detect duplicates. * * @param bool $strict * @return \Closure */ protected function duplicateComparator($strict) { } /** * Get all items except for those with the specified keys. * * @param \FluentCart\Framework\Support\Collection|mixed $keys * @return static */ public function except($keys) { } /** * Filter the collection using SQL like where. * * @param string $key * @param string|null $operator * @param mixed $value * @return static */ public function where($key, $operator = null, $value = null) { } /** * Run a filter over each of the items. * * @param callable|null $callback * @return static */ public function filter(?callable $callback = null) { } /** * Pass the items through a series of callbacks. * * @param array $callbacks * @param integer $mode * @return self */ public function passThrough(array $callbacks, $mode = 0) { } /** * Get the first item from the collection passing the given truth test. * * @param callable|null $callback * @param mixed $default * @return mixed */ public function first(?callable $callback = null, $default = null) { } /** * Get a flattened array of the items in the collection. * * @param int|float $depth * @return static */ public function flatten($depth = INF) { } /** * Flip the items in the collection. * * @return static */ public function flip() { } /** * Remove an item from the collection by key. * * @param string|int|array $keys * @return $this */ public function forget($keys) { } /** * Get an item from the collection by key. * * @param mixed $key * @param mixed $default * @return mixed */ public function get($key, $default = null) { } /** * Get an item from the collection by key or add it to collection if it does not exist. * * @param mixed $key * @param mixed $value * @return mixed */ public function getOrPut($key, $value) { } /** * Group an associative array by a field or using a callback. * * @param array|callable|string $groupBy * @param bool $preserveKeys * @return static */ public function groupBy($groupBy, $preserveKeys = false) { } /** * Key an associative array by a field or using a callback. * * @param callable|string $keyBy * @return static */ public function keyBy($keyBy) { } /** * Determine if an item exists in the collection by key. * * @param mixed $key * @return bool */ public function has($key) { } /** * Determine if any of the keys exist in the collection. * * @param mixed $key * @return bool */ public function hasAny($key) { } /** * Concatenate values of a given key as a string. * * @param string $value * @param string|null $glue * @return string */ public function implode($value, $glue = null) { } /** * Intersect the collection with the given items. * * @param mixed $items * @return static */ public function intersect($items) { } /** * Intersect the collection with the given items, * comparing both keys and values. * * @param mixed $items * @return static */ public function intersectAssoc($items) { } /** * Intersect the collection with the given items by key. * * @param mixed $items * @return static */ public function intersectByKeys($items) { } /** * Determine if the collection is empty or not. * * @return bool */ public function isEmpty() { } /** * Determine if the collection contains a single item. * * @return bool */ public function containsOneItem() { } /** * Join all items from the collection using a string. The final items can use a separate glue string. * * @param string $glue * @param string $finalGlue * @return string */ public function join($glue, $finalGlue = '') { } /** * Get the keys of the collection items. * * @return static */ public function keys() { } /** * Get the last item from the collection. * * @param callable|null $callback * @param mixed $default * @return mixed */ public function last(?callable $callback = null, $default = null) { } /** * Get the values of a given key. * * @param string|array|int|null $value * @param string|null $key * @return static */ public function pluck($value, $key = null) { } /** * Run a map over each of the items. * * @param callable $callback * @return static */ public function map(callable $callback) { } /** * Run a dictionary map over the items. * * The callback should return an associative array with a single key/value pair. * * @param callable $callback * @return static */ public function mapToDictionary(callable $callback) { } /** * Run an associative map over each of the items. * * The callback should return an associative array with a single key/value pair. * * @param callable $callback * @return static */ public function mapWithKeys(callable $callback) { } /** * Merge the collection with the given items. * * @param mixed $items * @return static */ public function merge($items) { } /** * Recursively merge the collection with the given items. * * @param mixed $items * @return static */ public function mergeRecursive($items) { } /** * Create a collection by using this collection for keys and another for its values. * * @param mixed $values * @return static */ public function combine($values) { } /** * Union the collection with the given items. * * @param mixed $items * @return static */ public function union($items) { } /** * Create a new collection consisting of every n-th element. * * @param int $step * @param int $offset * @return static */ public function nth($step, $offset = 0) { } /** * Get the items with the specified keys. * * @param mixed $keys * @return static */ public function only($keys) { } /** * Get and remove the last N items from the collection. * * @param int $count * @return mixed */ public function pop($count = 1) { } /** * Push an item onto the beginning of the collection. * * @param mixed $value * @param mixed $key * @return $this */ public function prepend($value, $key = null) { } /** * Push one or more items onto the end of the collection. * * @param mixed $values * @return $this */ public function push(...$values) { } /** * Push all of the given items onto the collection. * * @param iterable $source * @return static */ public function concat($source) { } /** * Get and remove an item from the collection. * * @param mixed $key * @param mixed $default * @return mixed */ public function pull($key, $default = null) { } /** * Put an item in the collection by key. * * @param mixed $key * @param mixed $value * @return $this */ public function put($key, $value) { } /** * Get one or a specified number of items randomly from the collection. * * @param int|null $number * @return static|mixed * * @throws \InvalidArgumentException */ public function random($number = null) { } /** * Replace the collection items with the given items. * * @param mixed $items * @return static */ public function replace($items) { } /** * Recursively replace the collection items with the given items. * * @param mixed $items * @return static */ public function replaceRecursive($items) { } /** * Reverse items order. * * @return static */ public function reverse() { } /** * Search the collection for a given value and return the corresponding key if successful. * * @param mixed $value * @param bool $strict * @return mixed */ public function search($value, $strict = false) { } /** * Get and remove the first N items from the collection. * * @param int $count * @return mixed */ public function shift($count = 1) { } /** * Shuffle the items in the collection. * * @param int|null $seed * @return static */ public function shuffle($seed = null) { } /** * Create chunks representing a "sliding window" view of the items in the collection. * * @param int $size * @param int $step * @return static */ public function sliding($size = 2, $step = 1) { } /** * Skip the first {$count} items. * * @param int $count * @return static */ public function skip($count) { } /** * Skip items in the collection until the given condition is met. * * @param mixed $value * @return static */ public function skipUntil($value) { } /** * Skip items in the collection while the given condition is met. * * @param mixed $value * @return static */ public function skipWhile($value) { } /** * Slice the underlying collection array. * * @param int $offset * @param int|null $length * @return static */ public function slice($offset, $length = null) { } /** * Split a collection into a certain number of groups. * * @param int $numberOfGroups * @return static */ public function split($numberOfGroups) { } /** * Split a collection into a certain number of groups, and fill the first groups completely. * * @param int $numberOfGroups * @return static */ public function splitIn($numberOfGroups) { } /** * Get the first item in the collection, but only if exactly one item exists. Otherwise, throw an exception. * * @param mixed $key * @param mixed $operator * @param mixed $value * @return mixed * * @throws \FluentCart\Framework\Support\ItemNotFoundException * @throws \FluentCart\Framework\Support\MultipleItemsFoundException */ public function sole($key = null, $operator = null, $value = null) { } /** * Get the first item in the collection but throw an exception if no matching items exist. * * @param mixed $key * @param mixed $operator * @param mixed $value * @return mixed * * @throws \FluentCart\Framework\Support\ItemNotFoundException */ public function firstOrFail($key = null, $operator = null, $value = null) { } /** * Chunk the collection into chunks of the given size. * * @param int $size * @return static */ public function chunk($size) { } /** * Chunk the collection into chunks with a callback. * * @param callable $callback * @return static */ public function chunkWhile(callable $callback) { } /** * Sort through each item with a callback. * * @param callable|int|null $callback * @return static */ public function sort($callback = null) { } /** * Sort items in descending order. * * @param int $options * @return static */ public function sortDesc($options = SORT_REGULAR) { } /** * Sort the collection using the given callback. * * @param callable|array|string $callback * @param int $options * @param bool $descending * @return static */ public function sortBy($callback, $options = SORT_REGULAR, $descending = false) { } /** * Sort the collection using multiple comparisons. * * @param array $comparisons * @return static */ protected function sortByMany(array $comparisons = []) { } /** * Sort the collection in descending order using the given callback. * * @param callable|string $callback * @param int $options * @return static */ public function sortByDesc($callback, $options = SORT_REGULAR) { } /** * Sort the collection keys. * * @param int $options * @param bool $descending * @return static */ public function sortKeys($options = SORT_REGULAR, $descending = false) { } /** * Sort the collection keys in descending order. * * @param int $options * @return static */ public function sortKeysDesc($options = SORT_REGULAR) { } /** * Sort the collection keys using a callback. * * @param callable $callback * @return static */ public function sortKeysUsing(callable $callback) { } /** * Splice a portion of the underlying collection array. * * @param int $offset * @param int|null $length * @param mixed $replacement * @return static */ public function splice($offset, $length = null, $replacement = []) { } /** * Take the first or last {$limit} items. * * @param int $limit * @return static */ public function take($limit) { } /** * Take items in the collection until the given condition is met. * * @param mixed $value * @return static */ public function takeUntil($value) { } /** * Take items in the collection while the given condition is met. * * @param mixed $value * @return static */ public function takeWhile($value) { } /** * Transform each item in the collection using a callback. * * @param callable $callback * @return $this */ public function transform(callable $callback) { } /** * Flattens a multi-dimensional collection into * a single level collection with dots. * * @return static */ public function dot() { } /** * Convert a flatten "dot" notation array into an expanded array. * * @return static */ public function undot() { } /** * Return only unique items from the collection array. * * @param string|callable|null $key * @param bool $strict * @return static */ public function unique($key = null, $strict = false) { } /** * Reset the keys on the underlying array. * * @return static */ public function values() { } /** * Zip the collection together with one or more arrays. * * e.g. new Collection([1, 2, 3])->zip([4, 5, 6]); * => [[1, 4], [2, 5], [3, 6]] * * @param mixed ...$items * @return static */ public function zip($items) { } /** * Pad collection to the specified length with a value. * * @param int $size * @param mixed $value * @return static */ public function pad($size, $value) { } /** * Get an iterator for the items. * * @return \ArrayIterator */ #[\ReturnTypeWillChange] public function getIterator() { } /** * Count the number of items in the collection. * * @return int */ #[\ReturnTypeWillChange] public function count() { } /** * Count the number of items in the collection by a field or using a callback. * * @param callable|string $countBy * @return static */ public function countBy($countBy = null) { } /** * Add an item to the collection. * * @param mixed $item * @return $this */ public function add($item) { } /** * Get a base Support collection instance from this collection. * * @return \FluentCart\Framework\Support\Collection */ public function toBase() { } /** * Determine if an item exists at an offset. * * @param mixed $key * @return bool */ #[\ReturnTypeWillChange] public function offsetExists($key) { } /** * Get an item at a given offset. * * @param mixed $key * @return mixed */ #[\ReturnTypeWillChange] public function offsetGet($key) { } /** * Set the item at a given offset. * * @param mixed $key * @param mixed $value * @return void */ #[\ReturnTypeWillChange] public function offsetSet($key, $value) { } /** * Unset the item at a given offset. * * @param mixed $key * @return void */ #[\ReturnTypeWillChange] public function offsetUnset($key) { } } } namespace FluentCart\Framework\Database\Orm\Relations\Concerns { trait InteractsWithDictionary { /** * Get a dictionary key attribute - casting it to a string if necessary. * * @param mixed $attribute * @return mixed * * @throws \FluentCart\Framework\Support\InvalidArgumentException */ protected function getDictionaryKey($attribute) { } } } namespace FluentCart\Framework\Database\Orm { class Collection extends \FluentCart\Framework\Support\Collection { use \FluentCart\Framework\Database\Orm\Relations\Concerns\InteractsWithDictionary; /** * Find a model in the collection by key. * * @param mixed $key * @param mixed $default * @return \FluentCart\Framework\Database\Orm\Model|static|null */ public function find($key, $default = null) { } /** * Load a set of relationships onto the collection. * * @param array|string $relations * @return $this */ public function load($relations) { } /** * Load a set of aggregations over relationship's column onto the collection. * * @param array|string $relations * @param string $column * @param string $function * @return $this */ public function loadAggregate($relations, $column, $function = null) { } /** * Load a set of relationship counts onto the collection. * * @param array|string $relations * @return $this */ public function loadCount($relations) { } /** * Load a set of relationship's max column values onto the collection. * * @param array|string $relations * @param string $column * @return $this */ public function loadMax($relations, $column) { } /** * Load a set of relationship's min column values onto the collection. * * @param array|string $relations * @param string $column * @return $this */ public function loadMin($relations, $column) { } /** * Load a set of relationship's column summations onto the collection. * * @param array|string $relations * @param string $column * @return $this */ public function loadSum($relations, $column) { } /** * Load a set of relationship's average column values onto the collection. * * @param array|string $relations * @param string $column * @return $this */ public function loadAvg($relations, $column) { } /** * Load a set of related existences onto the collection. * * @param array|string $relations * @return $this */ public function loadExists($relations) { } /** * Load a set of relationships onto the collection if they are not already eager loaded. * * @param array|string $relations * @return $this */ public function loadMissing($relations) { } /** * Load a relationship path if it is not already eager loaded. * * @param \FluentCart\Framework\Database\Orm\Collection $models * @param array $path * @return void */ protected function loadMissingRelation(self $models, array $path) { } /** * Load a set of relationships onto the mixed relationship collection. * * @param string $relation * @param array $relations * @return $this */ public function loadMorph($relation, $relations) { } /** * Load a set of relationship counts onto the mixed relationship collection. * * @param string $relation * @param array $relations * @return $this */ public function loadMorphCount($relation, $relations) { } /** * Determine if a key exists in the collection. * * @param mixed $key * @param mixed $operator * @param mixed $value * @return bool */ public function contains($key, $operator = null, $value = null) { } /** * Get the array of primary keys. * * @return array */ public function modelKeys() { } /** * Merge the collection with the given items. * * @param \ArrayAccess|array $items * @return static */ public function merge($items) { } /** * Run a map over each of the items. * * @param callable $callback * @return \FluentCart\Framework\Support\Collection|static */ public function map(callable $callback) { } /** * Run an associative map over each of the items. * * The callback should return an associative array with a single key / value pair. * * @param callable $callback * @return \FluentCart\Framework\Support\Collection|static */ public function mapWithKeys(callable $callback) { } /** * Reload a fresh model instance from the database for all the entities. * * @param array|string $with * @return static */ public function fresh($with = []) { } /** * Diff the collection with the given items. * * @param \ArrayAccess|array $items * @return static */ public function diff($items) { } /** * Intersect the collection with the given items. * * @param \ArrayAccess|array $items * @return static */ public function intersect($items) { } /** * Return only unique items from the collection. * * @param string|callable|null $key * @param bool $strict * @return static */ public function unique($key = null, $strict = false) { } /** * Returns only the models from the collection with the specified keys. * * @param mixed $keys * @return static */ public function only($keys) { } /** * Returns all models in the collection except the models with specified keys. * * @param mixed $keys * @return static */ public function except($keys) { } /** * Make the given, typically visible, attributes hidden across the entire collection. * * @param array|string $attributes * @return $this */ public function makeHidden($attributes) { } /** * Make the given, typically hidden, attributes visible across the entire collection. * * @param array|string $attributes * @return $this */ public function makeVisible($attributes) { } /** * Set the visible attributes across the entire collection. * * @param array $visible * @return $this */ public function setVisible($visible) { } /** * Set the hidden attributes across the entire collection. * * @param array $hidden * @return $this */ public function setHidden($hidden) { } /** * Append an attribute across the entire collection. * * @param array|string $attributes * @return $this */ public function append($attributes) { } /** * Get a dictionary keyed by primary keys. * * @param \ArrayAccess|array|null $items * @return array */ public function getDictionary($items = null) { } /** * Count the number of items in the collection by a field or using a callback. * * @param (callable(mixed, mixed): array-key)|string|null $countBy * @return \FluentCart\Framework\Support\Collection */ public function countBy($countBy = null) { } /** * The following methods are intercepted to always return base collections. */ /** * Get an array with the values of a given key. * * @param string|array $value * @param string|null $key * @return \FluentCart\Framework\Support\Collection */ public function pluck($value, $key = null) { } /** * Get the comparison function to detect duplicates. * * @param bool $strict * @return callable(mixed, mixed): bool */ protected function duplicateComparator($strict) { } /** * Get the keys of the collection items. * * @return \FluentCart\Framework\Support\Collection */ public function keys() { } /** * Zip the collection together with one or more arrays. * * @param mixed ...$items * @return \FluentCart\Framework\Support\Collection */ public function zip($items) { } /** * Collapse the collection of items into a single array. * * @return \FluentCart\Framework\Support\Collection */ public function collapse() { } /** * Get a flattened array of the items in the collection. * * @param int|float $depth * @return \FluentCart\Framework\Support\Collection */ public function flatten($depth = INF) { } /** * Flip the items in the collection. * * @return \FluentCart\Framework\Support\Collection */ public function flip() { } /** * Pad collection to the specified length with a value. * * @param int $size * @param mixed $value * @return \FluentCart\Framework\Support\Collection */ public function pad($size, $value) { } /** * Get the Orm query builder from the collection. * * @return \FluentCart\Framework\Database\Orm\Builder * * @throws \LogicException */ public function toQuery() { } } /** * @template TCollection of \FluentCart\Framework\Database\Orm\Collection */ trait HasCollection { /** * Create a new Orm Collection instance. * * @param array $models * @return TCollection */ public function newCollection(array $models = []) { } } /** * @mixin \FluentCart\Framework\Database\Orm\Builder */ class HigherOrderBuilderProxy { /** * The collection being operated on. * * @var \FluentCart\Framework\Database\Orm\Builder */ protected $builder; /** * The method being proxied. * * @var string */ protected $method; /** * Create a new proxy instance. * * @param \FluentCart\Framework\Database\Orm\Builder $builder * @param string $method * @return void */ public function __construct(\FluentCart\Framework\Database\Orm\Builder $builder, $method) { } /** * Proxy a scope call onto the query builder. * * @param string $method * @param array $parameters * @return mixed */ public function __call($method, $parameters) { } } class InvalidCastException extends \RuntimeException { /** * The name of the affected Orm model. * * @var string */ public $model; /** * The name of the column. * * @var string */ public $column; /** * The name of the cast type. * * @var string */ public $castType; /** * Create a new exception instance. * * @param object $model * @param string $column * @param string $castType * @return static */ public function __construct($model, $column, $castType) { } } class JsonEncodingException extends \RuntimeException { /** * Create a new JSON encoding exception for the model. * * @param mixed $model * @param string $message * @return static */ public static function forModel($model, $message) { } /** * Create a new JSON encoding exception for an attribute. * * @param mixed $model * @param mixed $key * @param string $message * @return static */ public static function forAttribute($model, $key, $message) { } } class MassAssignmentException extends \RuntimeException { // Pass } class MissingAttributeException extends \OutOfBoundsException { /** * Create a new missing attribute exception instance. * * @param \FluentCart\Framework\Database\Orm\Model $model * @param string $key * @return void */ public function __construct($model, $key) { } } } namespace FluentCart\Framework\Database { class RecordsNotFoundException extends \RuntimeException { // } } namespace FluentCart\Framework\Database\Orm { class ModelNotFoundException extends \FluentCart\Framework\Database\RecordsNotFoundException { /** * Name of the affected Orm model. * * @var string */ protected $model; /** * The affected model IDs. * * @var int|array */ protected $ids; /** * Set the affected Orm model and instance ids. * * @param string $model * @param int|array $ids * @return $this */ public function setModel($model, $ids = []) { } /** * Get the affected Orm model. * * @return string */ public function getModel() { } /** * Get the affected Orm model IDs. * * @return int|array */ public function getIds() { } } /** * @template TIntermediateModel of \FluentCart\Framework\Database\Orm\Model * @template TDeclaringModel of \FluentCart\Framework\Database\Orm\Model */ class PendingHasThroughRelationship { /** * The root model that the relationship exists on. * * @var TDeclaringModel */ protected $rootModel; /** * The local relationship. * * @var \FluentCart\Framework\Database\Orm\Relations\HasMany|\FluentCart\Framework\Database\Orm\Relations\HasOne */ protected $localRelationship; /** * Create a pending has-many-through or has-one-through relationship. * * @param mixed $rootModel * @param \FluentCart\Framework\Database\Orm\Relations\HasMany|\FluentCart\Framework\Database\Orm\Relations\HasOne $localRelationship */ public function __construct($rootModel, $localRelationship) { } /** * Define the distant relationship that this model has. * * @param string|callable $callback Either the distant relationship name or a callback returning the local relation. * @return \FluentCart\Framework\Database\Orm\Relations\HasManyThrough|\FluentCart\Framework\Database\Orm\Relations\HasOneThrough * The distant relationship instance. */ public function has($callback) { } /** * Handle dynamic method calls into the model. * * @param string $method * @param array $parameters * @return mixed */ public function __call($method, $parameters) { } } class RelationNotFoundException extends \RuntimeException { /** * The name of the affected Orm model. * * @var string */ public $model; /** * The name of the relation. * * @var string */ public $relation; /** * Create a new exception instance. * * @param object $model * @param string $relation * @param string|null $type * @return static */ public static function make($model, $relation, $type = null) { } } } namespace FluentCart\Framework\Database\Orm\Relations\Concerns { trait ComparesRelatedModels { /** * Determine if the model is the related instance of the relationship. * * @param \FluentCart\Framework\Database\Orm\Model|null $model * @return bool */ public function is($model) { } /** * Determine if the model is not the related instance of the relationship. * * @param \FluentCart\Framework\Database\Orm\Model|null $model * @return bool */ public function isNot($model) { } /** * Get the value of the parent model's key. * * @return mixed */ abstract public function getParentKey(); /** * Get the value of the model's related key. * * @param \FluentCart\Framework\Database\Orm\Model $model * @return mixed */ abstract protected function getRelatedKeyFrom(\FluentCart\Framework\Database\Orm\Model $model); /** * Compare the parent key with the related key. * * @param mixed $parentKey * @param mixed $relatedKey * @return bool */ protected function compareKeys($parentKey, $relatedKey) { } } trait SupportsDefaultModels { /** * Indicates if a default model instance should be used. * * Alternatively, may be a Closure or array. * * @var \Closure|array|bool */ protected $withDefault; /** * Make a new related instance for the given model. * * @param \FluentCart\Framework\Database\Orm\Model $parent * @return \FluentCart\Framework\Database\Orm\Model */ abstract protected function newRelatedInstanceFor(\FluentCart\Framework\Database\Orm\Model $parent); /** * Return a new model instance in case the relationship does not exist. * * @param \Closure|array|bool $callback * @return $this */ public function withDefault($callback = true) { } /** * Get the default value for this relation. * * @param \FluentCart\Framework\Database\Orm\Model $parent * @return \FluentCart\Framework\Database\Orm\Model|null */ protected function getDefaultFor(\FluentCart\Framework\Database\Orm\Model $parent) { } } } namespace FluentCart\Framework\Database\Orm\Relations { class BelongsTo extends \FluentCart\Framework\Database\Orm\Relations\Relation { use \FluentCart\Framework\Database\Orm\Relations\Concerns\ComparesRelatedModels, \FluentCart\Framework\Database\Orm\Relations\Concerns\InteractsWithDictionary, \FluentCart\Framework\Database\Orm\Relations\Concerns\SupportsDefaultModels; /** * The child model instance of the relation. * * @var \FluentCart\Framework\Database\Orm\Model */ protected $child; /** * The foreign key of the parent model. * * @var string */ protected $foreignKey; /** * The associated key on the parent model. * * @var string */ protected $ownerKey; /** * The name of the relationship. * * @var string */ protected $relationName; /** * Create a new belongs to relationship instance. * * @param \FluentCart\Framework\Database\Orm\Builder $query * @param \FluentCart\Framework\Database\Orm\Model $child * @param string $foreignKey * @param string $ownerKey * @param string $relationName * @return void */ public function __construct(\FluentCart\Framework\Database\Orm\Builder $query, \FluentCart\Framework\Database\Orm\Model $child, $foreignKey, $ownerKey, $relationName) { } /** * Get the results of the relationship. * * @return mixed */ public function getResults() { } /** * Set the base constraints on the relation query. * * @return void */ public function addConstraints() { } /** * Set the constraints for an eager load of the relation. * * @param array $models * @return void */ public function addEagerConstraints(array $models) { } /** * Gather the keys from an array of related models. * * @param \FluentCart\Framework\Database\Orm\Model[] $models Array of related model instances. * @return array Array of keys. */ protected function getEagerModelKeys(array $models) { } /** @inheritDoc */ public function initRelation(array $models, $relation) { } /** @inheritDoc */ public function match(array $models, \FluentCart\Framework\Database\Orm\Collection $results, $relation) { } /** * Associate the model instance to the given parent. * * @param \FluentCart\Framework\Database\Orm\Model|int|string|null $model The related model or its key. * @return \FluentCart\Framework\Database\Orm\Model Returns the child model instance. */ public function associate($model) { } /** * Dissociate previously associated model from the given parent. * * @return \FluentCart\Framework\Database\Orm\Model */ public function dissociate() { } /** * Alias of "dissociate" method. * * @return \FluentCart\Framework\Database\Orm\Model */ public function disassociate() { } /** @inheritDoc */ public function getRelationExistenceQuery(\FluentCart\Framework\Database\Orm\Builder $query, \FluentCart\Framework\Database\Orm\Builder $parentQuery, $columns = ['*']) { } /** * Add the constraints for a relationship query on the same table. * * @param \FluentCart\Framework\Database\Orm\Builder<\FluentCart\Framework\Database\Orm\Model> $query * @param \FluentCart\Framework\Database\Orm\Builder<\FluentCart\Framework\Database\Orm\Model> $parentQuery * @param array|mixed $columns * @return \FluentCart\Framework\Database\Orm\Builder<\FluentCart\Framework\Database\Orm\Model> */ public function getRelationExistenceQueryForSelfRelation(\FluentCart\Framework\Database\Orm\Builder $query, \FluentCart\Framework\Database\Orm\Builder $parentQuery, $columns = ['*']) { } /** * Determine if the related model has an auto-incrementing ID. * * @return bool */ protected function relationHasIncrementingId() { } /** * Make a new related instance for the given model. * * @param \FluentCart\Framework\Database\Orm\Model $parent * @return \FluentCart\Framework\Database\Orm\Model */ protected function newRelatedInstanceFor(\FluentCart\Framework\Database\Orm\Model $parent) { } /** * Get the child of the relationship. * * @return \FluentCart\Framework\Database\Orm\Model */ public function getChild() { } /** * Get the foreign key of the relationship. * * @return string */ public function getForeignKeyName() { } /** * Get the fully qualified foreign key of the relationship. * * @return string */ public function getQualifiedForeignKeyName() { } /** * Get the key value of the child's foreign key. * * @return mixed */ public function getParentKey() { } /** * Get the associated key of the relationship. * * @return string */ public function getOwnerKeyName() { } /** * Get the fully qualified associated key of the relationship. * * @return string */ public function getQualifiedOwnerKeyName() { } /** * Get the value of the model's foreign key. * * @param \FluentCart\Framework\Database\Orm\Model $model * @return int|string */ protected function getRelatedKeyFrom(\FluentCart\Framework\Database\Orm\Model $model) { } /** * Get the value of the model's foreign key. * * @param \FluentCart\Framework\Database\Orm\Model $model * @return mixed */ protected function getForeignKeyFrom(\FluentCart\Framework\Database\Orm\Model $model) { } /** * Get the name of the relationship. * * @return string */ public function getRelationName() { } } } namespace FluentCart\Framework\Database\Orm\Relations\Concerns { trait InteractsWithPivotTable { /** * Toggles a model (or models) from the parent. * * Each existing model is detached, and non existing ones are attached. * * @param mixed $ids * @param bool $touch * @return array */ public function toggle($ids, $touch = true) { } /** * Sync the intermediate tables with a list of IDs without detaching. * * @param \FluentCart\Framework\Support\Collection|\FluentCart\Framework\Database\Orm\Model|array $ids * @return array */ public function syncWithoutDetaching($ids) { } /** * Sync the intermediate tables with a list of IDs or collection of models. * * @param \FluentCart\Framework\Support\Collection|\FluentCart\Framework\Database\Orm\Model|array $ids * @param bool $detaching * @return array */ public function sync($ids, $detaching = true) { } /** * Sync the intermediate tables with a list of IDs or collection of models with the given pivot values. * * @param \FluentCart\Framework\Support\Collection|\FluentCart\Framework\Database\Orm\Model|array $ids * @param array $values * @param bool $detaching * @return array */ public function syncWithPivotValues($ids, array $values, bool $detaching = true) { } /** * Format the sync / toggle record list so that it is keyed by ID. * * @param array $records * @return array */ protected function formatRecordsList(array $records) { } /** * Attach all of the records that aren't in the given current records. * * @param array $records * @param array $current * @param bool $touch * @return array */ protected function attachNew(array $records, array $current, $touch = true) { } /** * Update an existing pivot record on the table. * * @param mixed $id * @param array $attributes * @param bool $touch * @return int */ public function updateExistingPivot($id, array $attributes, $touch = true) { } /** * Update an existing pivot record on the table via a custom class. * * @param mixed $id * @param array $attributes * @param bool $touch * @return int */ protected function updateExistingPivotUsingCustomClass($id, array $attributes, $touch) { } /** * Attach a model to the parent. * * @param mixed $id * @param array $attributes * @param bool $touch * @return void */ public function attach($id, array $attributes = [], $touch = true) { } /** * Attach a model to the parent using a custom class. * * @param mixed $id * @param array $attributes * @return void */ protected function attachUsingCustomClass($id, array $attributes) { } /** * Create an array of records to insert into the pivot table. * * @param array $ids * @param array $attributes * @return array */ protected function formatAttachRecords($ids, array $attributes) { } /** * Create a full attachment record payload. * * @param int $key * @param mixed $value * @param array $attributes * @param bool $hasTimestamps * @return array */ protected function formatAttachRecord($key, $value, $attributes, $hasTimestamps) { } /** * Get the attach record ID and extra attributes. * * @param mixed $key * @param mixed $value * @param array $attributes * @return array */ protected function extractAttachIdAndAttributes($key, $value, array $attributes) { } /** * Create a new pivot attachment record. * * @param int $id * @param bool $timed * @return array */ protected function baseAttachRecord($id, $timed) { } /** * Set the creation and update timestamps on an attach record. * * @param array $record * @param bool $exists * @return array */ protected function addTimestampsToAttachment(array $record, $exists = false) { } /** * Determine whether the given column is defined as a pivot column. * * @param string $column * @return bool */ public function hasPivotColumn($column) { } /** * Detach models from the relationship. * * @param mixed $ids * @param bool $touch * @return int */ public function detach($ids = null, $touch = true) { } /** * Detach models from the relationship using a custom class. * * @param mixed $ids * @return int */ protected function detachUsingCustomClass($ids) { } /** * Get the pivot models that are currently attached. * * @return \FluentCart\Framework\Support\Collection */ protected function getCurrentlyAttachedPivots() { } /** * Create a new pivot model instance. * * @param array $attributes * @param bool $exists * @return \FluentCart\Framework\Database\Orm\Relations\Pivot */ public function newPivot(array $attributes = [], $exists = false) { } /** * Create a new existing pivot model instance. * * @param array $attributes * @return \FluentCart\Framework\Database\Orm\Relations\Pivot */ public function newExistingPivot(array $attributes = []) { } /** * Get a new plain query builder for the pivot table. * * @return \FluentCart\Framework\Database\Query\Builder */ public function newPivotStatement() { } /** * Get a new pivot statement for a given "other" ID. * * @param mixed $id * @return \FluentCart\Framework\Database\Query\Builder */ public function newPivotStatementForId($id) { } /** * Create a new query builder for the pivot table. * * @return \FluentCart\Framework\Database\Query\Builder */ public function newPivotQuery() { } /** * Set the columns on the pivot table to retrieve. * * @param array|mixed $columns * @return $this */ public function withPivot($columns) { } /** * Get all of the IDs from the given mixed value. * * @param mixed $value * @return array */ protected function parseIds($value) { } /** * Get the ID from the given mixed value. * * @param mixed $value * @return mixed */ protected function parseId($value) { } /** * Cast the given keys to integers if they are numeric and string otherwise. * * @param array $keys * @return array */ protected function castKeys(array $keys) { } /** * Cast the given key to convert to primary key type. * * @param mixed $key * @return mixed */ protected function castKey($key) { } /** * Cast the given pivot attributes. * * @param array $attributes * @return array */ protected function castAttributes($attributes) { } /** * Converts a given value to a given type value. * * @param string $type * @param mixed $value * @return mixed */ protected function getTypeSwapValue($type, $value) { } } } namespace FluentCart\Framework\Database\Orm\Relations { /** * @template TRelatedModel of \FluentCart\Framework\Database\Orm\Model * @template TDeclaringModel of \FluentCart\Framework\Database\Orm\Model */ class BelongsToMany extends \FluentCart\Framework\Database\Orm\Relations\Relation { use \FluentCart\Framework\Database\Orm\Relations\Concerns\InteractsWithDictionary, \FluentCart\Framework\Database\Orm\Relations\Concerns\InteractsWithPivotTable; /** * The intermediate table for the relation. * * @var string */ protected $table; /** * The foreign key of the parent model. * * @var string */ protected $foreignPivotKey; /** * The associated key of the relation. * * @var string */ protected $relatedPivotKey; /** * The key name of the parent model. * * @var string */ protected $parentKey; /** * The key name of the related model. * * @var string */ protected $relatedKey; /** * The "name" of the relationship. * * @var string */ protected $relationName; /** * The pivot table columns to retrieve. * * @var array */ protected $pivotColumns = []; /** * Any pivot table restrictions for where clauses. * * @var array */ protected $pivotWheres = []; /** * Any pivot table restrictions for whereIn clauses. * * @var array */ protected $pivotWhereIns = []; /** * Any pivot table restrictions for whereNull clauses. * * @var array */ protected $pivotWhereNulls = []; /** * The default values for the pivot columns. * * @var array */ protected $pivotValues = []; /** * Indicates if timestamps are available on the pivot table. * * @var bool */ public $withTimestamps = false; /** * The custom pivot table column for the created_at timestamp. * * @var string */ protected $pivotCreatedAt; /** * The custom pivot table column for the updated_at timestamp. * * @var string */ protected $pivotUpdatedAt; /** * The class name of the custom pivot model to use for the relationship. * * @var string */ protected $using; /** * The name of the accessor to use for the "pivot" relationship. * * @var string */ protected $accessor = 'pivot'; /** * Create a new belongs to many relationship instance. * * * @param \FluentCart\Framework\Database\Orm\Builder $query * @param TDeclaringModel $parent * @param string|class-string $table * @param string $foreignPivotKey * @param string $relatedPivotKey * @param string $parentKey * @param string $relatedKey * @param string|null $relationName */ public function __construct(\FluentCart\Framework\Database\Orm\Builder $query, \FluentCart\Framework\Database\Orm\Model $parent, $table, $foreignPivotKey, $relatedPivotKey, $parentKey, $relatedKey, $relationName = null) { } /** * Attempt to resolve the intermediate table name from the given string. * * @param string $table * @return string */ protected function resolveTableName($table) { } /** * Set the base constraints on the relation query. * * @return void */ public function addConstraints() { } /** * Set the join clause for the relation query. * * @param \FluentCart\Framework\Database\Orm\Builder|null $query * @return $this */ protected function performJoin($query = null) { } /** * Set the where clause for the relation query. * * @return $this */ protected function addWhereConstraints() { } /** @inheritDoc */ public function addEagerConstraints(array $models) { } /** @inheritDoc */ public function initRelation(array $models, $relation) { } /** @inheritDoc */ public function match(array $models, \FluentCart\Framework\Database\Orm\Collection $results, $relation) { } /** * Build model dictionary keyed by the relation's foreign key. * * @param \FluentCart\Framework\Database\Orm\Collection $results * @return array> */ protected function buildDictionary(\FluentCart\Framework\Database\Orm\Collection $results) { } /** * Get the class being used for pivot models. * * @return string */ public function getPivotClass() { } /** * Specify the custom pivot model to use for the relationship. * * @param string $class * @return $this */ public function using($class) { } /** * Specify the custom pivot accessor to use for the relationship. * * @param string $accessor * @return $this */ public function as($accessor) { } /** * Set a where clause for a pivot table column. * * @param string|\FluentCart\Framework\Database\Query\Expression $column * @param mixed $operator * @param mixed $value * @param string $boolean * @return $this */ public function wherePivot($column, $operator = null, $value = null, $boolean = 'and') { } /** * Set a "where between" clause for a pivot table column. * * @param string|\FluentCart\Framework\Database\Query\Expression $column * @param array $values * @param string $boolean * @param bool $not * @return $this */ public function wherePivotBetween($column, array $values, $boolean = 'and', $not = false) { } /** * Set a "or where between" clause for a pivot table column. * * @param string|\FluentCart\Framework\Database\Query\Expression $column * @param array $values * @return $this */ public function orWherePivotBetween($column, array $values) { } /** * Set a "where pivot not between" clause for a pivot table column. * * @param string|\FluentCart\Framework\Database\Query\Expression $column * @param array $values * @param string $boolean * @return $this */ public function wherePivotNotBetween($column, array $values, $boolean = 'and') { } /** * Set a "or where not between" clause for a pivot table column. * * @param string|\FluentCart\Framework\Database\Query\Expression $column * @param array $values * @return $this */ public function orWherePivotNotBetween($column, array $values) { } /** * Set a "where in" clause for a pivot table column. * * @param string|\FluentCart\Framework\Database\Query\Expression $column * @param mixed $values * @param string $boolean * @param bool $not * @return $this */ public function wherePivotIn($column, $values, $boolean = 'and', $not = false) { } /** * Set an "or where" clause for a pivot table column. * * @param string|\FluentCart\Framework\Database\Query\Expression $column * @param mixed $operator * @param mixed $value * @return $this */ public function orWherePivot($column, $operator = null, $value = null) { } /** * Set a where clause for a pivot table column. * * In addition, new pivot records will receive this value. * * @param string|\FluentCart\Framework\Database\Query\Expression|array $column * @param mixed $value * @return $this * * @throws \InvalidArgumentException */ public function withPivotValue($column, $value = null) { } /** * Set an "or where in" clause for a pivot table column. * * @param string $column * @param mixed $values * @return $this */ public function orWherePivotIn($column, $values) { } /** * Set a "where not in" clause for a pivot table column. * * @param string|\FluentCart\Framework\Database\Query\Expression $column * @param mixed $values * @param string $boolean * @return $this */ public function wherePivotNotIn($column, $values, $boolean = 'and') { } /** * Set an "or where not in" clause for a pivot table column. * * @param string $column * @param mixed $values * @return $this */ public function orWherePivotNotIn($column, $values) { } /** * Set a "where null" clause for a pivot table column. * * @param string|\FluentCart\Framework\Database\Query\Expression $column * @param string $boolean * @param bool $not * @return $this */ public function wherePivotNull($column, $boolean = 'and', $not = false) { } /** * Set a "where not null" clause for a pivot table column. * * @param string|\FluentCart\Framework\Database\Query\Expression $column * @param string $boolean * @return $this */ public function wherePivotNotNull($column, $boolean = 'and') { } /** * Set a "or where null" clause for a pivot table column. * * @param string|\FluentCart\Framework\Database\Query\Expression $column * @param bool $not * @return $this */ public function orWherePivotNull($column, $not = false) { } /** * Set a "or where not null" clause for a pivot table column. * * @param string|\FluentCart\Framework\Database\Query\Expression $column * @return $this */ public function orWherePivotNotNull($column) { } /** * Add an "order by" clause for a pivot table column. * * @param string|\FluentCart\Framework\Database\Query\Expression $column * @param string $direction * @return $this */ public function orderByPivot($column, $direction = 'asc') { } /** * Find a related model by its primary key or return a new instance of the related model. * * @param mixed $id * @param array $columns * @return \FluentCart\Framework\Database\Orm\Collection|TRelatedModel */ public function findOrNew($id, $columns = ['*']) { } /** * Get the first related model record matching the attributes or instantiate it. * * @param array $attributes * @param array $values * @return TRelatedModel */ public function firstOrNew(array $attributes = [], array $values = []) { } /** * Get the first record matching the attributes. If the record is not found, create it. * * @param array $attributes * @param array $values * @param array $joining * @param bool $touch * @return TRelatedModel */ public function firstOrCreate(array $attributes = [], array $values = [], array $joining = [], $touch = true) { } /** * Attempt to create the record. If a unique constraint violation occurs, attempt to find the matching record. * * @param array $attributes * @param array $values * @param array $joining * @param bool $touch * @return TRelatedModel */ public function createOrFirst(array $attributes = [], array $values = [], array $joining = [], $touch = true) { } /** * Create or update a related record matching the attributes, and fill it with values. * * @param array $attributes * @param array $values * @param array $joining * @param bool $touch * @return TRelatedModel */ public function updateOrCreate(array $attributes, array $values = [], array $joining = [], $touch = true) { } /** * Find a related model by its primary key. * * @param mixed $id * @param array $columns * @return \FluentCart\Framework\Database\Orm\Collection|TRelatedModel|null */ public function find($id, $columns = ['*']) { } /** * Find multiple related models by their primary keys. * * @param \FluentCart\Framework\Support\ArrayableInterface|array $ids * @param array $columns * @return \FluentCart\Framework\Database\Orm\Collection */ public function findMany($ids, $columns = ['*']) { } /** * Find a related model by its primary key or throw an exception. * * @param mixed $id * @param array $columns * @return \FluentCart\Framework\Database\Orm\Collection|TRelatedModel * * @throws \FluentCart\Framework\Database\Orm\ModelNotFoundException */ public function findOrFail($id, $columns = ['*']) { } /** * Find a related model by its primary key or call a callback. * * @template TValue * * @param mixed $id * @param (\Closure(): TValue)|list|string $columns * @param (\Closure(): TValue)|null $callback * @return \FluentCart\Framework\Database\Orm\Collection|TRelatedModel|TValue */ public function findOr($id, $columns = ['*'], ?\Closure $callback = null) { } /** * Add a basic where clause to the query, and return the first result. * * @param \Closure|string|array $column * @param mixed $operator * @param mixed $value * @param string $boolean * @return TRelatedModel|null */ public function firstWhere($column, $operator = null, $value = null, $boolean = 'and') { } /** * Execute the query and get the first result. * * @param array $columns * @return TRelatedModel|null */ public function first($columns = ['*']) { } /** * Execute the query and get the first result or throw an exception. * * @param array $columns * @return TRelatedModel * * @throws \FluentCart\Framework\Database\Orm\ModelNotFoundException */ public function firstOrFail($columns = ['*']) { } /** * Execute the query and get the first result or call a callback. * * @template TValue * @param (\Closure(): TValue)|list $columns * @param (\Closure(): TValue)|null $callback * @return TRelatedModel|TValue */ public function firstOr($columns = ['*'], ?\Closure $callback = null) { } /** @inheritDoc */ public function getResults() { } /** @inheritDoc */ public function get($columns = ['*']) { } /** * Get the select columns for the relation query. * * @param array $columns * @return array */ protected function shouldSelect(array $columns = ['*']) { } /** * Get the pivot columns for the relation. * * "pivot_" is prefixed at each column for easy removal later. * * @return array */ protected function aliasedPivotColumns() { } /** * Get a paginator for the "select" statement. * * @param int|null $perPage * @param array $columns * @param string $pageName * @param int|null $page * @return \FluentCart\Framework\Pagination\LengthAwarePaginator */ public function paginate($perPage = null, $columns = ['*'], $pageName = 'page', $page = null) { } /** * Paginate the given query into a simple paginator. * * @param int|null $perPage * @param array $columns * @param string $pageName * @param int|null $page * @return \FluentCart\Framework\Pagination\Paginator */ public function simplePaginate($perPage = null, $columns = ['*'], $pageName = 'page', $page = null) { } /** * Paginate the given query into a cursor paginator. * * @param int|null $perPage * @param array $columns * @param string $cursorName * @param string|null $cursor * @return \FluentCart\Framework\Pagination\CursorPaginator */ public function cursorPaginate($perPage = null, $columns = ['*'], $cursorName = 'cursor', $cursor = null) { } /** * Chunk the results of the query. * * @param int $count * @param callable $callback * @return bool */ public function chunk($count, callable $callback) { } /** * Chunk the results of a query by comparing numeric IDs. * * @param int $count * @param callable $callback * @param string|null $column * @param string|null $alias * @return bool */ public function chunkById($count, callable $callback, $column = null, $alias = null) { } /** * Chunk the results of a query by comparing IDs in descending order. * * @param int $count * @param callable $callback * @param string|null $column * @param string|null $alias * @return bool */ public function chunkByIdDesc($count, callable $callback, $column = null, $alias = null) { } /** * Execute a callback over each item while chunking by ID. * * @param callable $callback * @param int $count * @param string|null $column * @param string|null $alias * @return bool */ public function eachById(callable $callback, $count = 1000, $column = null, $alias = null) { } /** * Chunk the results of a query by comparing IDs in a given order. * * @param int $count * @param callable $callback * @param string|null $column * @param string|null $alias * @param bool $descending * @return bool */ public function orderedChunkById($count, callable $callback, $column = null, $alias = null, $descending = false) { } /** * Execute a callback over each item while chunking. * * @param callable $callback * @param int $count * @return bool */ public function each(callable $callback, $count = 1000) { } /** * Query lazily, by chunks of the given size. * * @param int $chunkSize * @return \FluentCart\Framework\Support\LazyCollection */ public function lazy($chunkSize = 1000) { } /** * Query lazily, by chunking the results of a query by comparing IDs. * * @param int $chunkSize * @param string|null $column * @param string|null $alias * @return \FluentCart\Framework\Support\LazyCollection */ public function lazyById($chunkSize = 1000, $column = null, $alias = null) { } /** * Query lazily, by chunking the results of a query by comparing IDs in descending order. * * @param int $chunkSize * @param string|null $column * @param string|null $alias * @return \FluentCart\Framework\Support\LazyCollection */ public function lazyByIdDesc($chunkSize = 1000, $column = null, $alias = null) { } /** * Get a lazy collection for the given query. * * @return \FluentCart\Framework\Support\LazyCollection */ public function cursor() { } /** * Prepare the query builder for query execution. * * @return \FluentCart\Framework\Database\Orm\Builder */ protected function prepareQueryBuilder() { } /** * Hydrate the pivot table relationship on the models. * * @param array $models * @return void */ protected function hydratePivotRelation(array $models) { } /** * Get the pivot attributes from a model. * * @param TRelatedModel $model * @return array */ protected function migratePivotAttributes(\FluentCart\Framework\Database\Orm\Model $model) { } /** * If we're touching the parent model, touch. * * @return void */ public function touchIfTouching() { } /** * Determine if we should touch the parent on sync. * * @return bool */ protected function touchingParent() { } /** * Attempt to guess the name of the inverse of the relation. * * @return string */ protected function guessInverseRelation() { } /** * Touch all of the related models for the relationship. * * E.g.: Touch all roles associated with this user. * * @return void */ public function touch() { } /** * Get all of the IDs for the related models. * * @return \FluentCart\Framework\Support\Collection */ public function allRelatedIds() { } /** * Save a new model and attach it to the parent model. * * @param TRelatedModel $model * @param array $pivotAttributes * @param bool $touch * @return TRelatedModel */ public function save(\FluentCart\Framework\Database\Orm\Model $model, array $pivotAttributes = [], $touch = true) { } /** * Save a new model without raising any events and attach it to the parent model. * * @param TRelatedModel $model * @param array $pivotAttributes * @param bool $touch * @return TRelatedModel */ public function saveQuietly(\FluentCart\Framework\Database\Orm\Model $model, array $pivotAttributes = [], $touch = true) { } /** * Save an array of new models and attach them to the parent model. * * @template TContainer of \FluentCart\Framework\Support\Collection|array * * @param TContainer $models * @param array $pivotAttributes * @return TContainer */ public function saveMany($models, array $pivotAttributes = []) { } /** * Save an array of new models without raising any events and attach them to the parent model. * * @template TContainer of \FluentCart\Framework\Support\Collection|array * * @param TContainer $models * @param array $pivotAttributes * @return TContainer */ public function saveManyQuietly($models, array $pivotAttributes = []) { } /** * Create a new instance of the related model. * * @param array $attributes * @param array $joining * @param bool $touch * @return TRelatedModel */ public function create(array $attributes = [], array $joining = [], $touch = true) { } /** * Create an array of new instances of the related models. * * @param iterable $records * @param array $joinings * @return array */ public function createMany(iterable $records, array $joinings = []) { } /** @inheritDoc */ public function getRelationExistenceQuery(\FluentCart\Framework\Database\Orm\Builder $query, \FluentCart\Framework\Database\Orm\Builder $parentQuery, $columns = ['*']) { } /** * Add the constraints for a relationship query on the same table. * * @param \FluentCart\Framework\Database\Orm\Builder $query * @param \FluentCart\Framework\Database\Orm\Builder $parentQuery * @param array|mixed $columns * @return \FluentCart\Framework\Database\Orm\Builder */ public function getRelationExistenceQueryForSelfJoin(\FluentCart\Framework\Database\Orm\Builder $query, \FluentCart\Framework\Database\Orm\Builder $parentQuery, $columns = ['*']) { } /** * Alias to set the "limit" value of the query. * * @param int $value * @return $this */ public function take($value) { } /** * Set the "limit" value of the query. * * @param int $value * @return $this */ public function limit($value) { } /** * Get the key for comparing against the parent key in "has" query. * * @return string */ public function getExistenceCompareKey() { } /** * Specify that the pivot table has creation and update timestamps. * * @param mixed $createdAt * @param mixed $updatedAt * @return $this */ public function withTimestamps($createdAt = null, $updatedAt = null) { } /** * Get the name of the "created at" column. * * @return string */ public function createdAt() { } /** * Get the name of the "updated at" column. * * @return string */ public function updatedAt() { } /** * Get the foreign key for the relation. * * @return string */ public function getForeignPivotKeyName() { } /** * Get the fully qualified foreign key for the relation. * * @return string */ public function getQualifiedForeignPivotKeyName() { } /** * Get the "related key" for the relation. * * @return string */ public function getRelatedPivotKeyName() { } /** * Get the fully qualified "related key" for the relation. * * @return string */ public function getQualifiedRelatedPivotKeyName() { } /** * Get the parent key for the relationship. * * @return string */ public function getParentKeyName() { } /** * Get the fully qualified parent key name for the relation. * * @return string */ public function getQualifiedParentKeyName() { } /** * Get the related key for the relationship. * * @return string */ public function getRelatedKeyName() { } /** * Get the fully qualified related key name for the relation. * * @return string */ public function getQualifiedRelatedKeyName() { } /** * Get the intermediate table for the relationship. * * @return string */ public function getTable() { } /** * Get the relationship name for the relationship. * * @return string */ public function getRelationName() { } /** * Get the name of the pivot accessor for this relationship. * * @return string */ public function getPivotAccessor() { } /** * Get the pivot columns for this relationship. * * @return array */ public function getPivotColumns() { } /** * Qualify the given column name by the pivot table. * * @param string|\FluentCart\Framework\Database\Query\Expression $column * @return string|\FluentCart\Framework\Database\Query\Expression */ public function qualifyPivotColumn($column) { } } } namespace FluentCart\Framework\Database\Orm\Relations\Concerns { trait AsPivot { /** * The parent model of the relationship. * * @var \FluentCart\Framework\Database\Orm\Model */ public $pivotParent; /** * The name of the foreign key column. * * @var string */ protected $foreignKey; /** * The name of the "other key" column. * * @var string */ protected $relatedKey; /** * Create a new pivot model instance. * * @param \FluentCart\Framework\Database\Orm\Model $parent * @param array $attributes * @param string $table * @param bool $exists * @return static */ public static function fromAttributes(\FluentCart\Framework\Database\Orm\Model $parent, $attributes, $table, $exists = false) { } /** * Create a new pivot model from raw values returned from a query. * * @param \FluentCart\Framework\Database\Orm\Model $parent * @param array $attributes * @param string $table * @param bool $exists * @return static */ public static function fromRawAttributes(\FluentCart\Framework\Database\Orm\Model $parent, $attributes, $table, $exists = false) { } /** * Set the keys for a select query. * * @param \FluentCart\Framework\Database\Orm\Builder $query * @return \FluentCart\Framework\Database\Orm\Builder */ protected function setKeysForSelectQuery($query) { } /** * Set the keys for a save update query. * * @param \FluentCart\Framework\Database\Orm\Builder $query * @return \FluentCart\Framework\Database\Orm\Builder */ protected function setKeysForSaveQuery($query) { } /** * Delete the pivot model record from the database. * * @return int */ public function delete() { } /** * Get the query builder for a delete operation on the pivot. * * @return \FluentCart\Framework\Database\Orm\Builder */ protected function getDeleteQuery() { } /** * Get the table associated with the model. * * @return string */ public function getTable() { } /** * Get the foreign key column name. * * @return string */ public function getForeignKey() { } /** * Get the "related key" column name. * * @return string */ public function getRelatedKey() { } /** * Get the "related key" column name. * * @return string */ public function getOtherKey() { } /** * Set the key names for the pivot model instance. * * @param string $foreignKey * @param string $relatedKey * @return $this */ public function setPivotKeys($foreignKey, $relatedKey) { } /** * Determine if the pivot model or given attributes has timestamp attributes. * * @param array|null $attributes * @return bool */ public function hasTimestampAttributes($attributes = null) { } /** * Get the name of the "created at" column. * * @return string */ public function getCreatedAtColumn() { } /** * Get the name of the "updated at" column. * * @return string */ public function getUpdatedAtColumn() { } /** * Get the queueable identity for the entity. * * @return mixed */ public function getQueueableId() { } /** * Get a new query to restore one or more models by their queueable IDs. * * @param int[]|string[]|string $ids * @return \FluentCart\Framework\Database\Orm\Builder */ public function newQueryForRestoration($ids) { } /** * Get a new query to restore multiple models by their queueable IDs. * * @param int[]|string[] $ids * @return \FluentCart\Framework\Database\Orm\Builder */ protected function newQueryForCollectionRestoration(array $ids) { } /** * Unset all the loaded relations for the instance. * * @return $this */ public function unsetRelations() { } } trait CanBeOneOfMany { /** * Determines whether the relationship is one-of-many. * * @var bool */ protected $isOneOfMany = false; /** * The name of the relationship. * * @var string */ protected $relationName; /** * The one of many inner join subselect query builder instance. * * @var \FluentCart\Framework\Database\Orm\Builder|null */ protected $oneOfManySubQuery; /** * Add constraints for inner join subselect for one of many relationships. * * @param \FluentCart\Framework\Database\Orm\Builder $query * @param string|null $column * @param string|null $aggregate * @return void */ abstract public function addOneOfManySubQueryConstraints(\FluentCart\Framework\Database\Orm\Builder $query, $column = null, $aggregate = null); /** * Get the columns the determine the relationship groups. * * @return array|string */ abstract public function getOneOfManySubQuerySelectColumns(); /** * Add join query constraints for one of many relationships. * * @param \FluentCart\Framework\Database\Query\JoinClause $join * @return void */ abstract public function addOneOfManyJoinSubQueryConstraints(\FluentCart\Framework\Database\Query\JoinClause $join); /** * Indicate that the relation is a single result of a larger one-to-many relationship. * * @param string|array|null $column * @param string|\Closure|null $aggregate * @param string|null $relation * @return $this * * @throws \InvalidArgumentException */ public function ofMany($column = 'id', $aggregate = 'MAX', $relation = null) { } /** * Indicate that the relation is the latest single result of a larger one-to-many relationship. * * @param string|array|null $column * @param string|null $relation * @return $this */ public function latestOfMany($column = 'id', $relation = null) { } /** * Indicate that the relation is the oldest single result of a larger one-to-many relationship. * * @param string|array|null $column * @param string|null $relation * @return $this */ public function oldestOfMany($column = 'id', $relation = null) { } /** * Get the default alias for the one of many inner join clause. * * @param string $relation * @return string */ protected function getDefaultOneOfManyJoinAlias($relation) { } /** * Get a new query for the related model, grouping the query by the given column, often the foreign key of the relationship. * * @param string|array $groupBy * @param string|null $column * @param string|null $aggregate * @return \FluentCart\Framework\Database\Orm\Builder */ protected function newOneOfManySubQuery($groupBy, $column = null, $aggregate = null) { } /** * Add the join subquery to the given query on the given column and the relationship's foreign key. * * @param \FluentCart\Framework\Database\Orm\Builder $parent * @param \FluentCart\Framework\Database\Orm\Builder $subQuery * @param string $on * @return void */ protected function addOneOfManyJoinSubQuery(\FluentCart\Framework\Database\Orm\Builder $parent, \FluentCart\Framework\Database\Orm\Builder $subQuery, $on) { } /** * Merge the relationship query joins to the given query builder. * * @param \FluentCart\Framework\Database\Orm\Builder $query * @return void */ protected function mergeOneOfManyJoinsTo(\FluentCart\Framework\Database\Orm\Builder $query) { } /** * Get the query builder that will contain the relationship constraints. * * @return \FluentCart\Framework\Database\Orm\Builder */ protected function getRelationQuery() { } /** * Get the one of many inner join subselect builder instance. * * @return \FluentCart\Framework\Database\Orm\Builder|void */ public function getOneOfManySubQuery() { } /** * Get the qualified column name for the one-of-many relationship using the subselect join query's alias. * * @param string $column * @return string */ public function qualifySubSelectColumn($column) { } /** * Qualify related column using the related table name if it is not already qualified. * * @param string $column * @return string */ protected function qualifyRelatedColumn($column) { } /** * Guess the "hasOne" relationship's name via backtrace. * * @return string */ protected function guessRelationship() { } /** * Determine whether the relationship is a one-of-many relationship. * * @return bool */ public function isOneOfMany() { } /** * Get the name of the relationship. * * @return string */ public function getRelationName() { } } trait SupportsInverseRelations { /** * The name of the inverse relationship. * * @var string|null */ protected $inverseRelationship = null; /** * Instruct Orm to link the related models back to the parent after the relationship query has run. * * Alias of "chaperone". * * @param string|null $relation * @return $this */ public function inverse(?string $relation = null) { } /** * Instruct Orm to link the related models back to the parent after the relationship query has run. * * @param string|null $relation * @return $this */ public function chaperone(?string $relation = null) { } /** * Guess the name of the inverse relationship. * * @return string|null */ protected function guessInverseRelation() { } /** * Get the possible inverse relations for the parent model. * * @return array */ protected function getPossibleInverseRelations(): array { } /** * Set the inverse relation on all models in a collection. * * @param \FluentCart\Framework\Database\Orm\Collection $models * @param \FluentCart\Framework\Database\Orm\Model|null $parent * @return \FluentCart\Framework\Database\Orm\Collection */ protected function applyInverseRelationToCollection($models, ?\FluentCart\Framework\Database\Orm\Model $parent = null) { } /** * Set the inverse relation on a model. * * @param \FluentCart\Framework\Database\Orm\Model $model * @param \FluentCart\Framework\Database\Orm\Model|null $parent * @return \FluentCart\Framework\Database\Orm\Model */ protected function applyInverseRelationToModel(\FluentCart\Framework\Database\Orm\Model $model, ?\FluentCart\Framework\Database\Orm\Model $parent = null) { } /** * Get the name of the inverse relationship. * * @return string|null */ public function getInverseRelationship() { } /** * Remove the chaperone / inverse relationship for this query. * * Alias of "withoutChaperone". * * @return $this */ public function withoutInverse() { } /** * Remove the chaperone / inverse relationship for this query. * * @return $this */ public function withoutChaperone() { } } } namespace FluentCart\Framework\Database\Orm\Relations { /** * @template TRelatedModel of \FluentCart\Framework\Database\Orm\Model */ abstract class HasOneOrMany extends \FluentCart\Framework\Database\Orm\Relations\Relation { use \FluentCart\Framework\Database\Orm\Relations\Concerns\InteractsWithDictionary, \FluentCart\Framework\Database\Orm\Relations\Concerns\SupportsInverseRelations; /** * The foreign key of the parent model. * * @var string */ protected $foreignKey; /** * The local key of the parent model. * * @var string */ protected $localKey; /** * Create a new has one or many relationship instance. * * @param \FluentCart\Framework\Database\Orm\Builder $query * @param \FluentCart\Framework\Database\Orm\Model $parent * @param string $foreignKey * @param string $localKey * @return void */ public function __construct(\FluentCart\Framework\Database\Orm\Builder $query, \FluentCart\Framework\Database\Orm\Model $parent, $foreignKey, $localKey) { } /** * Create and return an un-saved instance of the related model. * * @param array $attributes * @return \FluentCart\Framework\Database\Orm\Model */ public function make(array $attributes = []) { } /** * Create and return an un-saved instance of the related models. * * @param iterable $records * @return \FluentCart\Framework\Database\Orm\Collection */ public function makeMany($records) { } /** * Set the base constraints on the relation query. * * @return void */ public function addConstraints() { } /** * Set the constraints for an eager load of the relation. * * @param array $models * @return void */ public function addEagerConstraints(array $models) { } /** * Match the eagerly loaded results to their single parents. * * @param array $models * @param \FluentCart\Framework\Database\Orm\Collection $results * @param string $relation * @return array */ public function matchOne(array $models, \FluentCart\Framework\Database\Orm\Collection $results, $relation) { } /** * Match the eagerly loaded results to their many parents. * * @param array $models * @param \FluentCart\Framework\Database\Orm\Collection $results * @param string $relation * @return array */ public function matchMany(array $models, \FluentCart\Framework\Database\Orm\Collection $results, $relation) { } /** * Match the eagerly loaded results to their many parents. * * @param array $models * @param \FluentCart\Framework\Database\Orm\Collection $results * @param string $relation * @param string $type * @return array */ protected function matchOneOrMany(array $models, \FluentCart\Framework\Database\Orm\Collection $results, $relation, $type) { } /** * Get the value of a relationship by one or many type. * * @param array $dictionary * @param string $key * @param string $type * @return mixed */ protected function getRelationValue(array $dictionary, $key, $type) { } /** * Build model dictionary keyed by the relation's foreign key. * * @param \FluentCart\Framework\Database\Orm\Collection $results * @return array */ protected function buildDictionary(\FluentCart\Framework\Database\Orm\Collection $results) { } /** * Find a model by its primary key or return a new instance of the related model. * * @param mixed $id * @param array $columns * @return \FluentCart\Framework\Support\Collection|\FluentCart\Framework\Database\Orm\Model */ public function findOrNew($id, $columns = ['*']) { } /** * Get the first related model record matching the attributes or instantiate it. * * @param array $attributes * @param array $values * @return \FluentCart\Framework\Database\Orm\Model */ public function firstOrNew(array $attributes = [], array $values = []) { } /** * Get the first related record matching the attributes or create it. * * @param array $attributes * @param array $values * @return \FluentCart\Framework\Database\Orm\Model */ public function firstOrCreate(array $attributes = [], array $values = []) { } /** * Attempt to create the record. If a unique constraint * violation occurs, attempt to find the matching record. * * @param array $attributes * @param array $values * @return TRelatedModel */ public function createOrFirst(array $attributes = [], array $values = []) { } /** * Create or update a related record matching the attributes, and fill it with values. * * @param array $attributes * @param array $values * @return \FluentCart\Framework\Database\Orm\Model */ public function updateOrCreate(array $attributes, array $values = []) { } /** * Insert new records or update the existing ones. * * @param array $values * @param array|string $uniqueBy * @param array|null $update * @return int */ public function upsert(array $values, $uniqueBy, $update = null) { } /** * Attach a model instance to the parent model. * * @param \FluentCart\Framework\Database\Orm\Model $model * @return \FluentCart\Framework\Database\Orm\Model|false */ public function save(\FluentCart\Framework\Database\Orm\Model $model) { } /** * Attach a model instance without raising any events to the parent model. * * @param TRelatedModel $model * @return TRelatedModel|false */ public function saveQuietly(\FluentCart\Framework\Database\Orm\Model $model) { } /** * Attach a collection of models to the parent instance. * * @param iterable $models * @return iterable */ public function saveMany($models) { } /** * Attach a collection of models to the parent instance * without raising any events to the parent model. * * @param iterable $models * @return iterable */ public function saveManyQuietly($models) { } /** * Create a new instance of the related model. * * @param array $attributes * @return \FluentCart\Framework\Database\Orm\Model */ public function create(array $attributes = []) { } /** * Create a new instance of the related model * without raising any events to the parent model. * * @param array $attributes * @return TRelatedModel */ public function createQuietly(array $attributes = []) { } /** * Create a new instance of the related model. Allow mass-assignment. * * @param array $attributes * @return \FluentCart\Framework\Database\Orm\Model */ public function forceCreate(array $attributes = []) { } /** * Create a new instance of the related model with * mass assignment without raising model events. * * @param array $attributes * @return TRelatedModel */ public function forceCreateQuietly(array $attributes = []) { } /** * Create a Collection of new instances of the related model. * * @param iterable $records * @return \FluentCart\Framework\Database\Orm\Collection */ public function createMany(iterable $records) { } /** * Create a Collection of new instances of the related * model without raising any events to the parent model. * * @param iterable $records * @return \FluentCart\Framework\Database\Orm\Collection */ public function createManyQuietly(iterable $records) { } /** * Set the foreign ID for creating a related model. * * @param \FluentCart\Framework\Database\Orm\Model $model * @return void */ protected function setForeignAttributesForCreate(\FluentCart\Framework\Database\Orm\Model $model) { } /** * Add the constraints for a relationship query. * * @param \FluentCart\Framework\Database\Orm\Builder $query * @param \FluentCart\Framework\Database\Orm\Builder $parentQuery * @param array|mixed $columns * @return \FluentCart\Framework\Database\Orm\Builder */ public function getRelationExistenceQuery(\FluentCart\Framework\Database\Orm\Builder $query, \FluentCart\Framework\Database\Orm\Builder $parentQuery, $columns = ['*']) { } /** * Add the constraints for a relationship query on the same table. * * @param \FluentCart\Framework\Database\Orm\Builder $query * @param \FluentCart\Framework\Database\Orm\Builder $parentQuery * @param array|mixed $columns * @return \FluentCart\Framework\Database\Orm\Builder */ public function getRelationExistenceQueryForSelfRelation(\FluentCart\Framework\Database\Orm\Builder $query, \FluentCart\Framework\Database\Orm\Builder $parentQuery, $columns = ['*']) { } /** * Alias to set the "limit" value of the query. * * @param int $value * @return $this */ public function take($value) { } /** * Set the "limit" value of the query. * * @param int $value * @return $this */ public function limit($value) { } /** * Get the key for comparing against the parent key in "has" query. * * @return string */ public function getExistenceCompareKey() { } /** * Get the key value of the parent's local key. * * @return mixed */ public function getParentKey() { } /** * Get the fully qualified parent key name. * * @return string */ public function getQualifiedParentKeyName() { } /** * Get the plain foreign key. * * @return string */ public function getForeignKeyName() { } /** * Get the foreign key for the relationship. * * @return string */ public function getQualifiedForeignKeyName() { } /** * Get the local key for the relationship. * * @return string */ public function getLocalKeyName() { } } class HasMany extends \FluentCart\Framework\Database\Orm\Relations\HasOneOrMany { /** * Convert the relationship to a "has one" relationship. * * @return \FluentCart\Framework\Database\Orm\Relations\HasOne */ public function one() { } /** * Get the results of the relationship. * * @return mixed */ public function getResults() { } /** * Initialize the relation on a set of models. * * @param array $models * @param string $relation * @return array */ public function initRelation(array $models, $relation) { } /** * Match the eagerly loaded results to their parents. * * @param array $models * @param \FluentCart\Framework\Database\Orm\Collection $results * @param string $relation * @return array */ public function match(array $models, \FluentCart\Framework\Database\Orm\Collection $results, $relation) { } } /** * @template TRelatedModel of \FluentCart\Framework\Database\Orm\Model * @template TIntermediateModel of \FluentCart\Framework\Database\Orm\Model * @template TDeclaringModel of \FluentCart\Framework\Database\Orm\Model * @template TResult */ abstract class HasOneOrManyThrough extends \FluentCart\Framework\Database\Orm\Relations\Relation { use \FluentCart\Framework\Database\Orm\Relations\Concerns\InteractsWithDictionary; /** * The "through" parent model instance. * * @var TIntermediateModel */ protected $throughParent; /** * The far parent model instance. * * @var TDeclaringModel */ protected $farParent; /** * The near key on the relationship. * * @var string */ protected $firstKey; /** * The far key on the relationship. * * @var string */ protected $secondKey; /** * The local key on the relationship. * * @var string */ protected $localKey; /** * The local key on the intermediary model. * * @var string */ protected $secondLocalKey; /** * Create a new has many through relationship instance. * * @param \FluentCart\Framework\Database\Orm\Builder $query * @param TDeclaringModel $farParent * @param TIntermediateModel $throughParent * @param string $firstKey * @param string $secondKey * @param string $localKey * @param string $secondLocalKey * @return void */ public function __construct(\FluentCart\Framework\Database\Orm\Builder $query, \FluentCart\Framework\Database\Orm\Model $farParent, \FluentCart\Framework\Database\Orm\Model $throughParent, $firstKey, $secondKey, $localKey, $secondLocalKey) { } /** * Set the base constraints on the relation query. * * @return void */ public function addConstraints() { } /** * Set the join clause on the query. * * @param \FluentCart\Framework\Database\Orm\Builder|null $query * @return void */ protected function performJoin(?\FluentCart\Framework\Database\Orm\Builder $query = null) { } /** * Get the fully qualified parent key name. * * @return string */ public function getQualifiedParentKeyName() { } /** * Determine whether "through" parent of the relation uses Soft Deletes. * * @return bool */ public function throughParentSoftDeletes() { } /** * Indicate that trashed "through" parents should be included in the query. * * @return $this */ public function withTrashedParents() { } /** @inheritDoc */ public function addEagerConstraints(array $models) { } /** * Build model dictionary keyed by the relation's foreign key. * * @param \FluentCart\Framework\Database\Orm\Collection $results * @return array> */ protected function buildDictionary(\FluentCart\Framework\Database\Orm\Collection $results) { } /** * Get the first related model record matching the attributes or instantiate it. * * @param array $attributes * @param array $values * @return TRelatedModel */ public function firstOrNew(array $attributes = [], array $values = []) { } /** * Get the first record matching the attributes. If the record is not found, create it. * * @param array $attributes * @param array $values * @return TRelatedModel */ public function firstOrCreate(array $attributes = [], array $values = []) { } /** * Attempt to create the record. If a unique constraint violation occurs, attempt to find the matching record. * * @param array $attributes * @param array $values * @return TRelatedModel */ public function createOrFirst(array $attributes = [], array $values = []) { } /** * Create or update a related record matching the attributes, and fill it with values. * * @param array $attributes * @param array $values * @return TRelatedModel */ public function updateOrCreate(array $attributes, array $values = []) { } /** * Add a basic where clause to the query, and return the first result. * * @param \Closure|string|array $column * @param mixed $operator * @param mixed $value * @param string $boolean * @return TRelatedModel|null */ public function firstWhere($column, $operator = null, $value = null, $boolean = 'and') { } /** * Execute the query and get the first related model. * * @param array $columns * @return TRelatedModel|null */ public function first($columns = ['*']) { } /** * Execute the query and get the first result or throw an exception. * * @param array $columns * @return TRelatedModel * * @throws \FluentCart\Framework\Database\Orm\ModelNotFoundException */ public function firstOrFail($columns = ['*']) { } /** * Execute the query and get the first result or call a callback. * * @template TValue * * @param (\Closure(): TValue)|list $columns * @param (\Closure(): TValue)|null $callback * @return TRelatedModel|TValue */ public function firstOr($columns = ['*'], ?\Closure $callback = null) { } /** * Find a related model by its primary key. * * @param mixed $id * @param array $columns * @return \FluentCart\Framework\Database\Orm\Collection|TRelatedModel|null */ public function find($id, $columns = ['*']) { } /** * Find multiple related models by their primary keys. * * @param array|mixed $ids * @param array $columns * @return \FluentCart\Framework\Database\Orm\Collection */ public function findMany($ids, $columns = ['*']) { } /** * Find a related model by its primary key or throw an exception. * * @param mixed $id * @param array $columns * @return \FluentCart\Framework\Database\Orm\Model| \FluentCart\Framework\Database\Orm\Collection * * @throws \FluentCart\Framework\Database\Orm\ModelNotFoundException */ public function findOrFail($id, $columns = ['*']) { } /** * Find a related model by its primary key or call a callback. * * @template TValue * * @param mixed $id * @param array|string|(\Closure(): TValue) $columns * @param (\Closure(): TValue)|null $callback * @return \FluentCart\Framework\Database\Orm\Model|\FluentCart\Framework\Database\Orm\Collection|TValue */ public function findOr($id, $columns = ['*'], ?\Closure $callback = null) { } /** @inheritDoc */ public function get($columns = ['*']) { } /** * Get a paginator for the "select" statement. * * @param int|null $perPage * @param array $columns * @param string $pageName * @param int $page * @return \FluentCart\Framework\Pagination\LengthAwarePaginatorInterface */ public function paginate($perPage = null, $columns = ['*'], $pageName = 'page', $page = null) { } /** * Paginate the given query into a simple paginator. * * @param int|null $perPage * @param array $columns * @param string $pageName * @param int|null $page * @return \FluentCart\Framework\Pagination\PaginatorInterface */ public function simplePaginate($perPage = null, $columns = ['*'], $pageName = 'page', $page = null) { } /** * Paginate the given query into a cursor paginator. * * @param int|null $perPage * @param array $columns * @param string $cursorName * @param string|null $cursor * @return \FluentCart\Framework\Pagination\CursorPaginatorInterface */ public function cursorPaginate($perPage = null, $columns = ['*'], $cursorName = 'cursor', $cursor = null) { } /** * Set the select clause for the relation query. * * @param array $columns * @return array */ protected function shouldSelect(array $columns = ['*']) { } /** * Chunk the results of the query. * * @param int $count * @param callable $callback * @return bool */ public function chunk($count, callable $callback) { } /** * Chunk the results of a query by comparing numeric IDs. * * @param int $count * @param callable $callback * @param string|null $column * @param string|null $alias * @return bool */ public function chunkById($count, callable $callback, $column = null, $alias = null) { } /** * Chunk the results of a query by comparing IDs in descending order. * * @param int $count * @param callable $callback * @param string|null $column * @param string|null $alias * @return bool */ public function chunkByIdDesc($count, callable $callback, $column = null, $alias = null) { } /** * Execute a callback over each item while chunking by ID. * * @param callable $callback * @param int $count * @param string|null $column * @param string|null $alias * @return bool */ public function eachById(callable $callback, $count = 1000, $column = null, $alias = null) { } /** * Get a generator for the given query. * * @return \FluentCart\Framework\Support\LazyCollection */ public function cursor() { } /** * Execute a callback over each item while chunking. * * @param callable $callback * @param int $count * @return bool */ public function each(callable $callback, $count = 1000) { } /** * Query lazily, by chunks of the given size. * * @param int $chunkSize * @return \FluentCart\Framework\Support\LazyCollection */ public function lazy($chunkSize = 1000) { } /** * Query lazily, by chunking the results of a query by comparing IDs. * * @param int $chunkSize * @param string|null $column * @param string|null $alias * @return \FluentCart\Framework\Support\LazyCollection */ public function lazyById($chunkSize = 1000, $column = null, $alias = null) { } /** * Query lazily, by chunking the results of a query by comparing IDs in descending order. * * @param int $chunkSize * @param string|null $column * @param string|null $alias * @return \FluentCart\Framework\Support\LazyCollection */ public function lazyByIdDesc($chunkSize = 1000, $column = null, $alias = null) { } /** * Prepare the query builder for query execution. * * @param array $columns * @return \FluentCart\Framework\Database\Orm\Builder */ protected function prepareQueryBuilder($columns = ['*']) { } /** @inheritDoc */ public function getRelationExistenceQuery(\FluentCart\Framework\Database\Orm\Builder $query, \FluentCart\Framework\Database\Orm\Builder $parentQuery, $columns = ['*']) { } /** * Add the constraints for a relationship query on the same table. * * @param \FluentCart\Framework\Database\Orm\Builder $query * @param \FluentCart\Framework\Database\Orm\Builder $parentQuery * @param array|mixed $columns * @return \FluentCart\Framework\Database\Orm\Builder */ public function getRelationExistenceQueryForSelfRelation(\FluentCart\Framework\Database\Orm\Builder $query, \FluentCart\Framework\Database\Orm\Builder $parentQuery, $columns = ['*']) { } /** * Add the constraints for a relationship query on the same table as the through parent. * * @param \FluentCart\Framework\Database\Orm\Builder $query * @param \FluentCart\Framework\Database\Orm\Builder $parentQuery * @param array|mixed $columns * @return \FluentCart\Framework\Database\Orm\Builder */ public function getRelationExistenceQueryForThroughSelfRelation(\FluentCart\Framework\Database\Orm\Builder $query, \FluentCart\Framework\Database\Orm\Builder $parentQuery, $columns = ['*']) { } /** * Alias to set the "limit" value of the query. * * @param int $value * @return $this */ public function take($value) { } /** * Set the "limit" value of the query. * * @param int $value * @return $this */ public function limit($value) { } /** * Get the qualified foreign key on the related model. * * @return string */ public function getQualifiedFarKeyName() { } /** * Get the foreign key on the "through" model. * * @return string */ public function getFirstKeyName() { } /** * Get the qualified foreign key on the "through" model. * * @return string */ public function getQualifiedFirstKeyName() { } /** * Get the foreign key on the related model. * * @return string */ public function getForeignKeyName() { } /** * Get the qualified foreign key on the related model. * * @return string */ public function getQualifiedForeignKeyName() { } /** * Get the local key on the far parent model. * * @return string */ public function getLocalKeyName() { } /** * Get the qualified local key on the far parent model. * * @return string */ public function getQualifiedLocalKeyName() { } /** * Get the local key on the intermediary model. * * @return string */ public function getSecondLocalKeyName() { } } class HasManyThrough extends \FluentCart\Framework\Database\Orm\Relations\HasOneOrManyThrough { use \FluentCart\Framework\Database\Orm\Relations\Concerns\InteractsWithDictionary; /** * Convert the relationship to a "has one through" relationship. * * @return \FluentCart\Framework\Database\Orm\Relations\HasOneThrough */ public function one() { } /** @inheritDoc */ public function initRelation(array $models, $relation) { } /** @inheritDoc */ public function match(array $models, \FluentCart\Framework\Database\Orm\Collection $results, $relation) { } /** @inheritDoc */ public function getResults() { } } } namespace FluentCart\Framework\Database\Orm { interface SupportsPartialRelations { /** * Indicate that the relation is a single result of a larger one-to-many relationship. * * @param string|null $column * @param string|\Closure|null $aggregate * @param string $relation * @return self */ public function ofMany($column = 'id', $aggregate = 'MAX', $relation = null); /** * Determine whether the relationship is a one-of-many relationship. * * @return bool */ public function isOneOfMany(); /** * Get the one of many inner join subselect query builder instance. * * @return \FluentCart\Framework\Database\Orm\Builder|void */ public function getOneOfManySubQuery(); } } namespace FluentCart\Framework\Database\Orm\Relations { class HasOne extends \FluentCart\Framework\Database\Orm\Relations\HasOneOrMany implements \FluentCart\Framework\Database\Orm\SupportsPartialRelations { use \FluentCart\Framework\Database\Orm\Relations\Concerns\ComparesRelatedModels, \FluentCart\Framework\Database\Orm\Relations\Concerns\CanBeOneOfMany, \FluentCart\Framework\Database\Orm\Relations\Concerns\SupportsDefaultModels; /** * Get the results of the relationship. * * @return mixed */ public function getResults() { } /** * Initialize the relation on a set of models. * * @param array $models * @param string $relation * @return array */ public function initRelation(array $models, $relation) { } /** * Match the eagerly loaded results to their parents. * * @param array $models * @param \FluentCart\Framework\Database\Orm\Collection $results * @param string $relation * @return array */ public function match(array $models, \FluentCart\Framework\Database\Orm\Collection $results, $relation) { } /** * Add the constraints for an internal relationship existence query. * * Essentially, these queries compare on column names like "whereColumn". * * @param \FluentCart\Framework\Database\Orm\Builder $query * @param \FluentCart\Framework\Database\Orm\Builder $parentQuery * @param array|mixed $columns * @return \FluentCart\Framework\Database\Orm\Builder */ public function getRelationExistenceQuery(\FluentCart\Framework\Database\Orm\Builder $query, \FluentCart\Framework\Database\Orm\Builder $parentQuery, $columns = ['*']) { } /** * Add constraints for inner join subselect for one of many relationships. * * @param \FluentCart\Framework\Database\Orm\Builder $query * @param string|null $column * @param string|null $aggregate * @return void */ public function addOneOfManySubQueryConstraints(\FluentCart\Framework\Database\Orm\Builder $query, $column = null, $aggregate = null) { } /** * Get the columns that should be selected by the one of many subquery. * * @return array|string */ public function getOneOfManySubQuerySelectColumns() { } /** * Add join query constraints for one of many relationships. * * @param \FluentCart\Framework\Database\Query\JoinClause $join * @return void */ public function addOneOfManyJoinSubQueryConstraints(\FluentCart\Framework\Database\Query\JoinClause $join) { } /** * Make a new related instance for the given model. * * @param \FluentCart\Framework\Database\Orm\Model $parent * @return \FluentCart\Framework\Database\Orm\Model */ public function newRelatedInstanceFor(\FluentCart\Framework\Database\Orm\Model $parent) { } /** * Get the value of the model's foreign key. * * @param \FluentCart\Framework\Database\Orm\Model $model * @return mixed */ protected function getRelatedKeyFrom(\FluentCart\Framework\Database\Orm\Model $model) { } } class HasOneThrough extends \FluentCart\Framework\Database\Orm\Relations\HasOneOrManyThrough { use \FluentCart\Framework\Database\Orm\Relations\Concerns\InteractsWithDictionary, \FluentCart\Framework\Database\Orm\Relations\Concerns\SupportsDefaultModels; /** * Get the results of the relationship. * * @return mixed */ public function getResults() { } /** * Initialize the relation on a set of models. * * @param array $models * @param string $relation * @return array */ public function initRelation(array $models, $relation) { } /** * Match the eagerly loaded results to their parents. * * @param array $models * @param \FluentCart\Framework\Database\Orm\Collection $results * @param string $relation * @return array */ public function match(array $models, \FluentCart\Framework\Database\Orm\Collection $results, $relation) { } /** * Make a new related instance for the given model. * * @param \FluentCart\Framework\Database\Orm\Model $parent * @return \FluentCart\Framework\Database\Orm\Model */ public function newRelatedInstanceFor(\FluentCart\Framework\Database\Orm\Model $parent) { } } abstract class MorphOneOrMany extends \FluentCart\Framework\Database\Orm\Relations\HasOneOrMany { /** * The foreign key type for the relationship. * * @var string */ protected $morphType; /** * The class name of the parent model. * * @var string */ protected $morphClass; /** * Create a new morph one or many relationship instance. * * @param \FluentCart\Framework\Database\Orm\Builder $query * @param \FluentCart\Framework\Database\Orm\Model $parent * @param string $type * @param string $id * @param string $localKey * @return void */ public function __construct(\FluentCart\Framework\Database\Orm\Builder $query, \FluentCart\Framework\Database\Orm\Model $parent, $type, $id, $localKey) { } /** * Set the base constraints on the relation query. * * @return void */ public function addConstraints() { } /** * Set the constraints for an eager load of the relation. * * @param array $models * @return void */ public function addEagerConstraints(array $models) { } /** * Create a new instance of the related model. Allow mass-assignment. * * @param array $attributes * @return \FluentCart\Framework\Database\Orm\Model */ public function forceCreate(array $attributes = []) { } /** * Set the foreign ID and type for creating a related model. * * @param \FluentCart\Framework\Database\Orm\Model $model * @return void */ protected function setForeignAttributesForCreate(\FluentCart\Framework\Database\Orm\Model $model) { } /** * Insert new records or update the existing ones. * * @param array $values * @param array|string $uniqueBy * @param array|null $update * @return int */ public function upsert(array $values, $uniqueBy, $update = null) { } /** * Get the relationship query. * * @param \FluentCart\Framework\Database\Orm\Builder $query * @param \FluentCart\Framework\Database\Orm\Builder $parentQuery * @param array|mixed $columns * @return \FluentCart\Framework\Database\Orm\Builder */ public function getRelationExistenceQuery(\FluentCart\Framework\Database\Orm\Builder $query, \FluentCart\Framework\Database\Orm\Builder $parentQuery, $columns = ['*']) { } /** * Get the foreign key "type" name. * * @return string */ public function getQualifiedMorphType() { } /** * Get the plain morph type name without the table. * * @return string */ public function getMorphType() { } /** * Get the class name of the parent model. * * @return string */ public function getMorphClass() { } } class MorphMany extends \FluentCart\Framework\Database\Orm\Relations\MorphOneOrMany { /** * Convert the relationship to a "morph one" relationship. * * @return \FluentCart\Framework\Database\Orm\Relations\MorphOne */ public function one() { } /** * Get the results of the relationship. * * @return mixed */ public function getResults() { } /** * Initialize the relation on a set of models. * * @param array $models * @param string $relation * @return array */ public function initRelation(array $models, $relation) { } /** * Match the eagerly loaded results to their parents. * * @param array $models * @param \FluentCart\Framework\Database\Orm\Collection $results * @param string $relation * @return array */ public function match(array $models, \FluentCart\Framework\Database\Orm\Collection $results, $relation) { } /** * Create a new instance of the related model. Allow mass-assignment. * * @param array $attributes * @return \FluentCart\Framework\Database\Orm\Model */ public function forceCreate(array $attributes = []) { } } /** * @template TRelatedModel of \FluentCart\Framework\Database\Orm\Model * @template TDeclaringModel of \FluentCart\Framework\Database\Orm\Model */ class MorphOne extends \FluentCart\Framework\Database\Orm\Relations\MorphOneOrMany implements \FluentCart\Framework\Database\Orm\SupportsPartialRelations { use \FluentCart\Framework\Database\Orm\Relations\Concerns\CanBeOneOfMany, \FluentCart\Framework\Database\Orm\Relations\Concerns\ComparesRelatedModels, \FluentCart\Framework\Database\Orm\Relations\Concerns\SupportsDefaultModels; /** @inheritDoc */ public function getResults() { } /** @inheritDoc */ public function initRelation(array $models, $relation) { } /** @inheritDoc */ public function match(array $models, \FluentCart\Framework\Database\Orm\Collection $results, $relation) { } /** @inheritDoc */ public function getRelationExistenceQuery(\FluentCart\Framework\Database\Orm\Builder $query, \FluentCart\Framework\Database\Orm\Builder $parentQuery, $columns = ['*']) { } /** * Add constraints for inner join subselect for one of many relationships. * * @param \FluentCart\Framework\Database\Orm\Builder $query * @param string|null $column * @param string|null $aggregate * @return void */ public function addOneOfManySubQueryConstraints(\FluentCart\Framework\Database\Orm\Builder $query, $column = null, $aggregate = null) { } /** * Get the columns that should be selected by the one of many subquery. * * @return array|string */ public function getOneOfManySubQuerySelectColumns() { } /** * Add join query constraints for one of many relationships. * * @param \FluentCart\Framework\Database\Query\JoinClause $join * @return void */ public function addOneOfManyJoinSubQueryConstraints(\FluentCart\Framework\Database\Query\JoinClause $join) { } /** * Make a new related instance for the given model. * * @param TDeclaringModel $parent * @return TRelatedModel */ public function newRelatedInstanceFor(\FluentCart\Framework\Database\Orm\Model $parent) { } /** * Get the value of the model's foreign key. * * @param TRelatedModel $model * @return int|string */ protected function getRelatedKeyFrom(\FluentCart\Framework\Database\Orm\Model $model) { } } class Pivot extends \FluentCart\Framework\Database\Orm\Model { use \FluentCart\Framework\Database\Orm\Relations\Concerns\AsPivot; /** * Indicates if the IDs are auto-incrementing. * * @var bool */ public $incrementing = false; /** * The attributes that aren't mass assignable. * * @var array */ protected $guarded = []; } class MorphPivot extends \FluentCart\Framework\Database\Orm\Relations\Pivot { /** * The type of the polymorphic relation. * * Explicitly define this so it's not included in saved attributes. * * @var string */ protected $morphType; /** * The value of the polymorphic relation. * * Explicitly define this so it's not included in saved attributes. * * @var string */ protected $morphClass; /** * Set the keys for a save update query. * * @param \FluentCart\Framework\Database\Orm\Builder $query * @return \FluentCart\Framework\Database\Orm\Builder */ protected function setKeysForSaveQuery($query) { } /** * Set the keys for a select query. * * @param \FluentCart\Framework\Database\Orm\Builder $query * @return \FluentCart\Framework\Database\Orm\Builder */ protected function setKeysForSelectQuery($query) { } /** * Delete the pivot model record from the database. * * @return int */ public function delete() { } /** * Get the morph type for the pivot. * * @return string */ public function getMorphType() { } /** * Set the morph type for the pivot. * * @param string $morphType * @return $this */ public function setMorphType($morphType) { } /** * Set the morph class for the pivot. * * @param string $morphClass * @return \FluentCart\Framework\Database\Orm\Relations\MorphPivot */ public function setMorphClass($morphClass) { } /** * Get a new query to restore one or more models by their queueable IDs. * * @param array|int $ids * @return \FluentCart\Framework\Database\Orm\Builder */ public function newQueryForRestoration($ids) { } /** * Get a new query to restore multiple models by their queueable IDs. * * @param array $ids * @return \FluentCart\Framework\Database\Orm\Builder */ protected function newQueryForCollectionRestoration(array $ids) { } } class MorphTo extends \FluentCart\Framework\Database\Orm\Relations\BelongsTo { use \FluentCart\Framework\Database\Orm\Relations\Concerns\InteractsWithDictionary; /** * The type of the polymorphic relation. * * @var string */ protected $morphType; /** * The models whose relations are being eager loaded. * * @var \FluentCart\Framework\Database\Orm\Collection */ protected $models; /** * All of the models keyed by ID. * * @var array */ protected $dictionary = []; /** * A buffer of dynamic calls to query macros. * * @var array */ protected $macroBuffer = []; /** * A map of relations to load for each individual morph type. * * @var array */ protected $morphableEagerLoads = []; /** * A map of relationship counts to load for each individual morph type. * * @var array */ protected $morphableEagerLoadCounts = []; /** * A map of constraints to apply for each individual morph type. * * @var array */ protected $morphableConstraints = []; /** * Create a new morph to relationship instance. * * @param \FluentCart\Framework\Database\Orm\Builder $query * @param \FluentCart\Framework\Database\Orm\Model $parent * @param string $foreignKey * @param string $ownerKey * @param string $type * @param string $relation * @return void */ public function __construct(\FluentCart\Framework\Database\Orm\Builder $query, \FluentCart\Framework\Database\Orm\Model $parent, $foreignKey, $ownerKey, $type, $relation) { } /** * Set the constraints for an eager load of the relation. * * @param array $models * @return void */ public function addEagerConstraints(array $models) { } /** * Build a dictionary with the models. * * @param \FluentCart\Framework\Database\Orm\Collection $models * @return void */ protected function buildDictionary(\FluentCart\Framework\Database\Orm\Collection $models) { } /** * Get the results of the relationship. * * Called via eager load method of Orm query builder. * * @return mixed */ public function getEager() { } /** * Get all of the relation results for a type. * * @param string $type * @return \FluentCart\Framework\Database\Orm\Collection */ protected function getResultsByType($type) { } /** * Gather all of the foreign keys for a given type. * * @param string $type * @param string $keyType * @return array */ protected function gatherKeysByType($type, $keyType) { } /** * Create a new model instance by type. * * @param string $type * @return \FluentCart\Framework\Database\Orm\Model */ public function createModelByType($type) { } /** * Match the eagerly loaded results to their parents. * * @param array $models * @param \FluentCart\Framework\Database\Orm\Collection $results * @param string $relation * @return array */ public function match(array $models, \FluentCart\Framework\Database\Orm\Collection $results, $relation) { } /** * Match the results for a given type to their parents. * * @param string $type * @param \FluentCart\Framework\Database\Orm\Collection $results * @return void */ protected function matchToMorphParents($type, \FluentCart\Framework\Database\Orm\Collection $results) { } /** * Associate the model instance to the given parent. * * @param \FluentCart\Framework\Database\Orm\Model $model * @return \FluentCart\Framework\Database\Orm\Model */ public function associate($model) { } /** * Dissociate previously associated model from the given parent. * * @return \FluentCart\Framework\Database\Orm\Model */ public function dissociate() { } /** * Touch all of the related models for the relationship. * * @return void */ public function touch() { } /** * Make a new related instance for the given model. * * @param \FluentCart\Framework\Database\Orm\Model $parent * @return \FluentCart\Framework\Database\Orm\Model */ protected function newRelatedInstanceFor(\FluentCart\Framework\Database\Orm\Model $parent) { } /** * Get the foreign key "type" name. * * @return string */ public function getMorphType() { } /** * Get the dictionary used by the relationship. * * @return array */ public function getDictionary() { } /** * Specify which relations to load for a given morph type. * * @param array $with * @return \FluentCart\Framework\Database\Orm\Relations\MorphTo */ public function morphWith(array $with) { } /** * Specify which relationship counts to load for a given morph type. * * @param array $withCount * @return \FluentCart\Framework\Database\Orm\Relations\MorphTo */ public function morphWithCount(array $withCount) { } /** * Specify constraints on the query for a given morph type. * * @param array $callbacks * @return \FluentCart\Framework\Database\Orm\Relations\MorphTo */ public function constrain(array $callbacks) { } /** * Indicate that soft deleted models should be included in the results. * * @return $this */ public function withTrashed() { } /** * Indicate that soft deleted models should not be included in the results. * * @return $this */ public function withoutTrashed() { } /** * Indicate that only soft deleted models should be included in the results. * * @return $this */ public function onlyTrashed() { } /** * Replay stored macro calls on the actual related instance. * * @param \FluentCart\Framework\Database\Orm\Builder $query * @return \FluentCart\Framework\Database\Orm\Builder */ protected function replayMacros(\FluentCart\Framework\Database\Orm\Builder $query) { } /** * Handle dynamic method calls to the relationship. * * @param string $method * @param array $parameters * @return mixed */ public function __call($method, $parameters) { } } class MorphToMany extends \FluentCart\Framework\Database\Orm\Relations\BelongsToMany { /** * The type of the polymorphic relation. * * @var string */ protected $morphType; /** * The class name of the morph type constraint. * * @var string */ protected $morphClass; /** * Indicates if we are connecting the inverse of the relation. * * This primarily affects the morphClass constraint. * * @var bool */ protected $inverse; /** * Create a new morph to many relationship instance. * * @param \FluentCart\Framework\Database\Orm\Builder $query * @param \FluentCart\Framework\Database\Orm\Model $parent * @param string $name * @param string $table * @param string $foreignPivotKey * @param string $relatedPivotKey * @param string $parentKey * @param string $relatedKey * @param string|null $relationName * @param bool $inverse * @return void */ public function __construct(\FluentCart\Framework\Database\Orm\Builder $query, \FluentCart\Framework\Database\Orm\Model $parent, $name, $table, $foreignPivotKey, $relatedPivotKey, $parentKey, $relatedKey, $relationName = null, $inverse = false) { } /** * Set the where clause for the relation query. * * @return $this */ protected function addWhereConstraints() { } /** * Set the constraints for an eager load of the relation. * * @param array $models * @return void */ public function addEagerConstraints(array $models) { } /** * Create a new pivot attachment record. * * @param int $id * @param bool $timed * @return array */ protected function baseAttachRecord($id, $timed) { } /** * Add the constraints for a relationship count query. * * @param \FluentCart\Framework\Database\Orm\Builder $query * @param \FluentCart\Framework\Database\Orm\Builder $parentQuery * @param array|mixed $columns * @return \FluentCart\Framework\Database\Orm\Builder */ public function getRelationExistenceQuery(\FluentCart\Framework\Database\Orm\Builder $query, \FluentCart\Framework\Database\Orm\Builder $parentQuery, $columns = ['*']) { } /** * Get the pivot models that are currently attached. * * @return \FluentCart\Framework\Support\Collection */ protected function getCurrentlyAttachedPivots() { } /** * Create a new query builder for the pivot table. * * @return \FluentCart\Framework\Database\Query\Builder */ public function newPivotQuery() { } /** * Create a new pivot model instance. * * @param array $attributes * @param bool $exists * @return \FluentCart\Framework\Database\Orm\Relations\Pivot */ public function newPivot(array $attributes = [], $exists = false) { } /** * Get the pivot columns for the relation. * * "pivot_" is prefixed at each column for easy removal later. * * @return array */ protected function aliasedPivotColumns() { } /** * Get the foreign key "type" name. * * @return string */ public function getMorphType() { } /** * Get the fully qualified morph type for the relation. * * @return string */ public function getQualifiedMorphTypeName() { } /** * Get the class name of the parent model. * * @return string */ public function getMorphClass() { } /** * Get the indicator for a reverse relationship. * * @return bool */ public function getInverse() { } } } namespace FluentCart\Framework\Database\Orm { interface Scope { /** * Apply the scope to a given Orm query builder. * * @param \FluentCart\Framework\Database\Orm\Builder $builder * @param \FluentCart\Framework\Database\Orm\Model $model * @return void */ public function apply(\FluentCart\Framework\Database\Orm\Builder $builder, \FluentCart\Framework\Database\Orm\Model $model); } trait Searchable { /** * Searchable columns. * * @var array */ protected $searchableColumns = []; /** * Search the model in a case-insensitive manner. * * @param \FluentCart\Framework\Database\Orm\Builder $query * @param string $value * @return \FluentCart\Framework\Database\Orm\Builder * @throws \Exception */ public function scopeSearch($query, $value) { } } /** * @method static static|\FluentCart\Framework\Database\Orm\Builder|\FluentCart\Framework\Database\Query\Builder withTrashed(bool $withTrashed = true) * @method static static|\FluentCart\Framework\Database\Orm\Builder|\FluentCart\Framework\Database\Query\Builder onlyTrashed() * @method static static|\FluentCart\Framework\Database\Orm\Builder|\FluentCart\Framework\Database\Query\Builder withoutTrashed() */ trait SoftDeletes { /** * Indicates if the model is currently force deleting. * * @var bool */ protected $forceDeleting = false; /** * Boot the soft deleting trait for a model. * * @return void */ public static function bootSoftDeletes() { } /** * Initialize the soft deleting trait for an instance. * * @return void */ public function initializeSoftDeletes() { } /** * Force a hard delete on a soft deleted model. * * @return bool|null */ public function forceDelete() { } /** * Force a hard delete on a soft deleted model without raising any events. * * @return bool|null */ public function forceDeleteQuietly() { } /** * Destroy the models for the given IDs. * * @param \FluentCart\Framework\Support\Collection|array|int|string $ids * @return int */ public static function forceDestroy($ids) { } /** * Perform the actual delete query on this model instance. * * @return mixed */ protected function performDeleteOnModel() { } /** * Perform the actual delete query on this model instance. * * @return void */ protected function runSoftDelete() { } /** * Restore a soft-deleted model instance. * * @return bool|null */ public function restore() { } /** * Determine if the model instance has been soft-deleted. * * @return bool */ public function trashed() { } /** * Register a "softDeleted" model event callback with the dispatcher. * * @param \Closure|string $callback * @return void */ public static function softDeleted($callback) { } /** * Register a "restoring" model event callback with the dispatcher. * * @param \Closure|string $callback * @return void */ public static function restoring($callback) { } /** * Register a "restored" model event callback with the dispatcher. * * @param \Closure|string $callback * @return void */ public static function restored($callback) { } /** * Register a "forceDeleted" model event callback with the dispatcher. * * @param \Closure|string $callback * @return void */ public static function forceDeleted($callback) { } /** * Determine if the model is currently force deleting. * * @return bool */ public function isForceDeleting() { } /** * Get the name of the "deleted at" column. * * @return string */ public function getDeletedAtColumn() { } /** * Get the fully qualified "deleted at" column. * * @return string */ public function getQualifiedDeletedAtColumn() { } } class SoftDeletingScope implements \FluentCart\Framework\Database\Orm\Scope { /** * All of the extensions to be added to the builder. * * @var string[] */ protected $extensions = ['Restore', 'WithTrashed', 'WithoutTrashed', 'OnlyTrashed']; /** * Apply the scope to a given Orm query builder. * * @param \FluentCart\Framework\Database\Orm\Builder $builder * @param \FluentCart\Framework\Database\Orm\Model $model * @return void */ public function apply(\FluentCart\Framework\Database\Orm\Builder $builder, \FluentCart\Framework\Database\Orm\Model $model) { } /** * Extend the query builder with the needed functions. * * @param \FluentCart\Framework\Database\Orm\Builder $builder * @return void */ public function extend(\FluentCart\Framework\Database\Orm\Builder $builder) { } /** * Get the "deleted at" column for the builder. * * @param \FluentCart\Framework\Database\Orm\Builder $builder * @return string */ protected function getDeletedAtColumn(\FluentCart\Framework\Database\Orm\Builder $builder) { } /** * Add the restore extension to the builder. * * @param \FluentCart\Framework\Database\Orm\Builder $builder * @return void */ protected function addRestore(\FluentCart\Framework\Database\Orm\Builder $builder) { } /** * Add the with-trashed extension to the builder. * * @param \FluentCart\Framework\Database\Orm\Builder $builder * @return void */ protected function addWithTrashed(\FluentCart\Framework\Database\Orm\Builder $builder) { } /** * Add the without-trashed extension to the builder. * * @param \FluentCart\Framework\Database\Orm\Builder $builder * @return void */ protected function addWithoutTrashed(\FluentCart\Framework\Database\Orm\Builder $builder) { } /** * Add the only-trashed extension to the builder. * * @param \FluentCart\Framework\Database\Orm\Builder $builder * @return void */ protected function addOnlyTrashed(\FluentCart\Framework\Database\Orm\Builder $builder) { } } trait UserProxyTrait { /** * Resolve the WPUserProxy instance. * * Always returns a live WPUserProxy reflecting latest WP_User data. * * @return \FluentCart\Framework\Http\Request\WPUserProxy */ protected function resolveWPUser() { } /** * Dual-purpose is() method: * - is(string $role) - checks user role * - is(User $model) - checks model identity * * @param string|self $value * @return bool */ public function is($value) { } /** * Dynamically call methods on the WPUserProxy if not found in the model. * * @param string $method * @param array $args * @return mixed * * @throws \BadMethodCallException|\InvalidArgumentException */ public function __call($method, $args) { } } } namespace FluentCart\Framework\Database\Query { class Builder { use \FluentCart\Framework\Database\Concerns\BuildsQueries, \FluentCart\Framework\Database\Concerns\BuildsWhereDateClauses, \FluentCart\Framework\Database\Concerns\ExplainsQueries, \FluentCart\Framework\Support\ForwardsCalls, \FluentCart\Framework\Support\MacroableTrait { __call as macroCall; } /** * The database connection instance. * * @var \FluentCart\Framework\Database\ConnectionInterface */ public $connection; /** * The database query grammar instance. * * @var \FluentCart\Framework\Database\Query\Grammars\Grammar */ public $grammar; /** * The database query post processor instance. * * @var \FluentCart\Framework\Database\Query\Processors\Processor */ public $processor; /** * The current query value bindings. * * @var array */ public $bindings = ['select' => [], 'from' => [], 'join' => [], 'where' => [], 'groupBy' => [], 'having' => [], 'order' => [], 'union' => [], 'unionOrder' => []]; /** * An aggregate function and column to be run. * * @var array */ public $aggregate; /** * The columns that should be returned. * * @var array */ public $columns; /** * Indicates if the query returns distinct results. * * Occasionally contains the columns that should be distinct. * * @var bool|array */ public $distinct = false; /** * The table which the query is targeting. * * @var string */ public $from; /** * The index hint for the query. * * @var \FluentCart\Framework\Database\Query\IndexHint */ public $indexHint; /** * The table joins for the query. * * @var array */ public $joins; /** * The where constraints for the query. * * @var array */ public $wheres = []; /** * The groupings for the query. * * @var array */ public $groups; /** * The having constraints for the query. * * @var array */ public $havings; /** * The orderings for the query. * * @var array */ public $orders; /** * The maximum number of records to return. * * @var int */ public $limit; /** * The maximum number of records to return per group. * * @var array */ public $groupLimit; /** * The number of records to skip. * * @var int */ public $offset; /** * The query union statements. * * @var array */ public $unions; /** * The maximum number of union records to return. * * @var int */ public $unionLimit; /** * The number of union records to skip. * * @var int */ public $unionOffset; /** * The orderings for the union query. * * @var array */ public $unionOrders; /** * Indicates whether row locking is being used. * * @var string|bool */ public $lock; /** * The callbacks that should be invoked before the query is executed. * * @var array */ public $beforeQueryCallbacks = []; /** * The callbacks that should be invoked after retrieving data from the database. * * @var array */ protected $afterQueryCallbacks = []; /** * All of the available clause operators. * * @var string[] */ public $operators = ['=', '<', '>', '<=', '>=', '<>', '!=', '<=>', 'like', 'like binary', 'not like', 'ilike', '&', '|', '^', '<<', '>>', '&~', 'is', 'is not', 'rlike', 'not rlike', 'regexp', 'not regexp', '~', '~*', '!~', '!~*', 'similar to', 'not similar to', 'not ilike', '~~*', '!~~*']; /** * All of the available bitwise operators. * * @var string[] */ public $bitwiseOperators = ['&', '|', '^', '<<', '>>', '&~']; /** * Whether to use write pdo for the select. * * @var bool */ public $useWritePdo = false; /** * Allow dynamic property injection. * * @var array */ protected $dynamicProperties = []; /** * Create a new query builder instance. * * @param \FluentCart\Framework\Database\ConnectionInterface $connection * @param \FluentCart\Framework\Database\Query\Grammars\Grammar|null $grammar * @param \FluentCart\Framework\Database\Query\Processors\Processor|null $processor * @return void */ public function __construct(\FluentCart\Framework\Database\ConnectionInterface $connection, ?\FluentCart\Framework\Database\Query\Grammars\Grammar $grammar = null, ?\FluentCart\Framework\Database\Query\Processors\Processor $processor = null) { } /** * Set the columns to be selected. * * @param array|mixed $columns * @return $this */ public function select($columns = ['*']) { } /** * Add a subselect expression to the query. * * @param \Closure|\FluentCart\Framework\Database\Query\Builder|\FluentCart\Framework\Database\Orm\Builder|string $query * @param string $as * @return $this * * @throws \InvalidArgumentException */ public function selectSub($query, $as) { } /** * Add a new "raw" select expression to the query. * * @param string $expression * @param array $bindings * @return $this */ public function selectRaw($expression, array $bindings = []) { } /** * Makes "from" fetch from a subquery. * * @param \Closure|\FluentCart\Framework\Database\Query\Builder|string $query * @param string $as * @return $this * * @throws \InvalidArgumentException */ public function fromSub($query, $as) { } /** * Add a raw from clause to the query. * * @param string $expression * @param mixed $bindings * @return $this */ public function fromRaw($expression, $bindings = []) { } /** * Creates a subquery and parse it. * * @param \Closure|\FluentCart\Framework\Database\Query\Builder|string $query * @return array */ protected function createSub($query) { } /** * Parse the subquery into SQL and bindings. * * @param mixed $query * @return array * * @throws \InvalidArgumentException */ protected function parseSub($query) { } /** * Prepend the database name if the given query is on another database. * * @param mixed $query * @return mixed */ protected function prependDatabaseNameIfCrossDatabaseQuery($query) { } /** * Add a new select column to the query. * * @param array|mixed $column * @return $this */ public function addSelect($column) { } /** * Force the query to only return distinct results. * * @return $this */ public function distinct() { } /** * Set the table which the query is targeting. * * @param \Closure|\FluentCart\Framework\Database\Query\Builder|string $table * @param string|null $as * @return $this */ public function from($table, $as = null) { } /** * Add an index hint to suggest a query index. * * @param string $index * @return $this */ public function useIndex($index) { } /** * Add an index hint to force a query index. * * @param string $index * @return $this */ public function forceIndex($index) { } /** * Add an index hint to ignore a query index. * * @param string $index * @return $this */ public function ignoreIndex($index) { } /** * Add a join clause to the query. * * @param string $table * @param \Closure|string $first * @param string|null $operator * @param string|null $second * @param string $type * @param bool $where * @return $this */ public function join($table, $first, $operator = null, $second = null, $type = 'inner', $where = false) { } /** * Add a "join where" clause to the query. * * @param string $table * @param \Closure|string $first * @param string $operator * @param string $second * @param string $type * @return $this */ public function joinWhere($table, $first, $operator, $second, $type = 'inner') { } /** * Add a subquery join clause to the query. * * @param \Closure|\FluentCart\Framework\Database\Query\Builder|\FluentCart\Framework\Database\Orm\Builder|string $query * @param string $as * @param \Closure|string $first * @param string|null $operator * @param string|null $second * @param string $type * @param bool $where * @return $this * * @throws \InvalidArgumentException */ public function joinSub($query, $as, $first, $operator = null, $second = null, $type = 'inner', $where = false) { } /** * Add a lateral join clause to the query. * * @param \Closure|\FluentCart\Framework\Database\Query\Builder|\FluentCart\Framework\Database\Orm\Builder|string $query * @param string $as * @param string $type * @return $this */ public function joinLateral($query, string $as, string $type = 'inner') { } /** * Add a lateral left join to the query. * * @param \Closure|\FluentCart\Framework\Database\Query\Builder|\FluentCart\Framework\Database\Orm\Builder|string $query * @param string $as * @return $this */ public function leftJoinLateral($query, string $as) { } /** * Add a left join to the query. * * @param string $table * @param \Closure|string $first * @param string|null $operator * @param string|null $second * @return $this */ public function leftJoin($table, $first, $operator = null, $second = null) { } /** * Add a "join where" clause to the query. * * @param string $table * @param \Closure|string $first * @param string $operator * @param string $second * @return $this */ public function leftJoinWhere($table, $first, $operator, $second) { } /** * Add a subquery left join to the query. * * @param \Closure|\FluentCart\Framework\Database\Query\Builder|\FluentCart\Framework\Database\Orm\Builder|string $query * @param string $as * @param \Closure|string $first * @param string|null $operator * @param string|null $second * @return $this */ public function leftJoinSub($query, $as, $first, $operator = null, $second = null) { } /** * Add a right join to the query. * * @param string $table * @param \Closure|string $first * @param string|null $operator * @param string|null $second * @return $this */ public function rightJoin($table, $first, $operator = null, $second = null) { } /** * Add a "right join where" clause to the query. * * @param string $table * @param \Closure|string $first * @param string $operator * @param string $second * @return $this */ public function rightJoinWhere($table, $first, $operator, $second) { } /** * Add a subquery right join to the query. * * @param \Closure|\FluentCart\Framework\Database\Query\Builder|\FluentCart\Framework\Database\Orm\Builder|string $query * @param string $as * @param \Closure|string $first * @param string|null $operator * @param string|null $second * @return $this */ public function rightJoinSub($query, $as, $first, $operator = null, $second = null) { } /** * Add a "cross join" clause to the query. * * @param string $table * @param \Closure|string|null $first * @param string|null $operator * @param string|null $second * @return $this */ public function crossJoin($table, $first = null, $operator = null, $second = null) { } /** * Add a subquery cross join to the query. * * @param \Closure|\FluentCart\Framework\Database\Query\Builder|string $query * @param string $as * @return $this */ public function crossJoinSub($query, $as) { } /** * Get a new join clause. * * @param \FluentCart\Framework\Database\Query\Builder $parentQuery * @param string $type * @param string $table * @return \FluentCart\Framework\Database\Query\JoinClause */ protected function newJoinClause(self $parentQuery, $type, $table) { } /** * Get a new join lateral clause. * * @param \FluentCart\Framework\Database\Query\Builder $parentQuery * @param string $type * @param string $table * @return \FluentCart\Framework\Database\Query\JoinLateralClause */ protected function newJoinLateralClause(self $parentQuery, $type, $table) { } /** * Merge an array of where clauses and bindings. * * @param array $wheres * @param array $bindings * @return $this */ public function mergeWheres($wheres, $bindings) { } /** * Add a basic where clause to the query. * * @param \Closure|string|array $column * @param mixed $operator * @param mixed $value * @param string $boolean * @return $this */ public function where($column, $operator = null, $value = null, $boolean = 'and') { } /** * Add an array of where clauses to the query. * * @param array $column * @param string $boolean * @param string $method * @return $this */ protected function addArrayOfWheres($column, $boolean, $method = 'where') { } /** * Prepare the value and operator for a where clause. * * @param string $value * @param string $operator * @param bool $useDefault * @return array * * @throws \InvalidArgumentException */ public function prepareValueAndOperator($value, $operator, $useDefault = false) { } /** * Determine if the given operator and value combination is legal. * * Prevents using Null values with invalid operators. * * @param string $operator * @param mixed $value * @return bool */ protected function invalidOperatorAndValue($operator, $value) { } /** * Determine if the given operator is supported. * * @param string $operator * @return bool */ protected function invalidOperator($operator) { } /** * Determine if the operator is a bitwise operator. * * @param string $operator * @return bool */ protected function isBitwiseOperator($operator) { } /** * Add an "or where" clause to the query. * * @param \Closure|string|array $column * @param mixed $operator * @param mixed $value * @return $this */ public function orWhere($column, $operator = null, $value = null) { } /** * Add a basic "where not" clause to the query. * * @param \Closure|string|array|\FluentCart\Framework\Database\Query\Expression $column * @param mixed $operator * @param mixed $value * @param string $boolean * @return $this */ public function whereNot($column, $operator = null, $value = null, $boolean = 'and') { } /** * Add an "or where not" clause to the query. * * @param \Closure|string|array|\FluentCart\Framework\Database\Query\Expression $column * @param mixed $operator * @param mixed $value * @return $this */ public function orWhereNot($column, $operator = null, $value = null) { } /** * Add a "where" clause comparing two columns to the query. * * @param string|array $first * @param string|null $operator * @param string|null $second * @param string|null $boolean * @return $this */ public function whereColumn($first, $operator = null, $second = null, $boolean = 'and') { } /** * Add an "or where" clause comparing two columns to the query. * * @param string|array $first * @param string|null $operator * @param string|null $second * @return $this */ public function orWhereColumn($first, $operator = null, $second = null) { } /** * Add a raw where clause to the query. * * @param string $sql * @param mixed $bindings * @param string $boolean * @return $this */ public function whereRaw($sql, $bindings = [], $boolean = 'and') { } /** * Add a raw or where clause to the query. * * @param string $sql * @param mixed $bindings * @return $this */ public function orWhereRaw($sql, $bindings = []) { } /** * Add a "where like" clause to the query. * * @param \FluentCart\Framework\Database\Query\Expression|string $column * @param string $value * @param bool $caseSensitive * @param string $boolean * @param bool $not * @return $this */ public function whereLike($column, $value, $caseSensitive = false, $boolean = 'and', $not = false) { } /** * Add an "or where like" clause to the query. * * @param \FluentCart\Framework\Database\Query\Expression|string $column * @param string $value * @param bool $caseSensitive * @return $this */ public function orWhereLike($column, $value, $caseSensitive = false) { } /** * Add a "where not like" clause to the query. * * @param \FluentCart\Framework\Database\Query\Expression|string $column * @param string $value * @param bool $caseSensitive * @param string $boolean * @return $this */ public function whereNotLike($column, $value, $caseSensitive = false, $boolean = 'and') { } /** * Add an "or where not like" clause to the query. * * @param \FluentCart\Framework\Database\Query\Expression|string $column * @param string $value * @param bool $caseSensitive * @return $this */ public function orWhereNotLike($column, $value, $caseSensitive = false) { } /** * Add a "where like" clause to the query. * * @param \FluentCart\Framework\Database\Query\Expression|string $column * @param string $value * @param bool $caseSensitive * @param string $boolean * @param bool $not * @return $this */ public function whereStartsLike($column, $value, $caseSensitive = false, $boolean = 'and', $not = false) { } /** * Add a "where like" clause to the query. * * @param \FluentCart\Framework\Database\Query\Expression|string $column * @param string $value * @param bool $caseSensitive * @param string $boolean * @param bool $not * @return $this */ public function whereEndsLike($column, $value, $caseSensitive = false, $boolean = 'and', $not = false) { } /** * Add a "where in" clause to the query. * * @param string $column * @param mixed $values * @param string $boolean * @param bool $not * @return $this */ public function whereIn($column, $values, $boolean = 'and', $not = false) { } /** * Add an "or where in" clause to the query. * * @param string $column * @param mixed $values * @return $this */ public function orWhereIn($column, $values) { } /** * Add a "where not in" clause to the query. * * @param string $column * @param mixed $values * @param string $boolean * @return $this */ public function whereNotIn($column, $values, $boolean = 'and') { } /** * Add an "or where not in" clause to the query. * * @param string $column * @param mixed $values * @return $this */ public function orWhereNotIn($column, $values) { } /** * Add a "where in raw" clause for integer values to the query. * * @param string $column * @param \FluentCart\Framework\Support\ArrayableInterface|array $values * @param string $boolean * @param bool $not * @return $this */ public function whereIntegerInRaw($column, $values, $boolean = 'and', $not = false) { } /** * Add an "or where in raw" clause for integer values to the query. * * @param string $column * @param \FluentCart\Framework\Support\ArrayableInterface|array $values * @return $this */ public function orWhereIntegerInRaw($column, $values) { } /** * Add a "where not in raw" clause for integer values to the query. * * @param string $column * @param \FluentCart\Framework\Support\ArrayableInterface|array $values * @param string $boolean * @return $this */ public function whereIntegerNotInRaw($column, $values, $boolean = 'and') { } /** * Add an "or where not in raw" clause for integer values to the query. * * @param string $column * @param \FluentCart\Framework\Support\ArrayableInterface|array $values * @return $this */ public function orWhereIntegerNotInRaw($column, $values) { } /** * Add a "where null" clause to the query. * * @param string|array $columns * @param string $boolean * @param bool $not * @return $this */ public function whereNull($columns, $boolean = 'and', $not = false) { } /** * Add an "or where null" clause to the query. * * @param string|array $column * @return $this */ public function orWhereNull($column) { } /** * Add a "where not null" clause to the query. * * @param string|array $columns * @param string $boolean * @return $this */ public function whereNotNull($columns, $boolean = 'and') { } /** * Add a where between statement to the query. * * @param string|\FluentCart\Framework\Database\Query\Expression $column * @param array $values * @param string $boolean * @param bool $not * @return $this */ public function whereBetween($column, array $values, $boolean = 'and', $not = false) { } /** * Add a where between statement using columns to the query. * * @param string $column * @param array $values * @param string $boolean * @param bool $not * @return $this */ public function whereBetweenColumns($column, array $values, $boolean = 'and', $not = false) { } /** * Add an or where between statement to the query. * * @param string $column * @param array $values * @return $this */ public function orWhereBetween($column, array $values) { } /** * Add an or where between statement using columns to the query. * * @param string $column * @param array $values * @return $this */ public function orWhereBetweenColumns($column, array $values) { } /** * Add a where not between statement to the query. * * @param string $column * @param array $values * @param string $boolean * @return $this */ public function whereNotBetween($column, iterable $values, $boolean = 'and') { } /** * Add a where not between statement using columns to the query. * * @param string $column * @param array $values * @param string $boolean * @return $this */ public function whereNotBetweenColumns($column, array $values, $boolean = 'and') { } /** * Add an or where not between statement to the query. * * @param string $column * @param array $values * @return $this */ public function orWhereNotBetween($column, iterable $values) { } /** * Add an or where not between statement using columns to the query. * * @param string $column * @param array $values * @return $this */ public function orWhereNotBetweenColumns($column, array $values) { } /** * Add an "or where not null" clause to the query. * * @param string $column * @return $this */ public function orWhereNotNull($column) { } /** * Add a "where date" statement to the query. * * @param \FluentCart\Framework\Database\Query\Expression|string $column * @param string $operator * @param \DateTimeInterface|string|null $value * @param string $boolean * @return $this */ public function whereDate($column, $operator, $value = null, $boolean = 'and') { } /** * Add an "or where date" statement to the query. * * @param string $column * @param string $operator * @param \DateTimeInterface|string|null $value * @return $this */ public function orWhereDate($column, $operator, $value = null) { } /** * Add a "where time" statement to the query. * * @param string $column * @param string $operator * @param \DateTimeInterface|string|null $value * @param string $boolean * @return $this */ public function whereTime($column, $operator, $value = null, $boolean = 'and') { } /** * Add an "or where time" statement to the query. * * @param string $column * @param string $operator * @param \DateTimeInterface|string|null $value * @return $this */ public function orWhereTime($column, $operator, $value = null) { } /** * Add a "where day" statement to the query. * * @param string $column * @param string $operator * @param \DateTimeInterface|string|null $value * @param string $boolean * @return $this */ public function whereDay($column, $operator, $value = null, $boolean = 'and') { } /** * Add an "or where day" statement to the query. * * @param string $column * @param string $operator * @param \DateTimeInterface|string|null $value * @return $this */ public function orWhereDay($column, $operator, $value = null) { } /** * Add a "where month" statement to the query. * * @param string $column * @param string $operator * @param \DateTimeInterface|string|null $value * @param string $boolean * @return $this */ public function whereMonth($column, $operator, $value = null, $boolean = 'and') { } /** * Add an "or where month" statement to the query. * * @param string $column * @param string $operator * @param \DateTimeInterface|string|null $value * @return $this */ public function orWhereMonth($column, $operator, $value = null) { } /** * Add a "where year" statement to the query. * * @param string $column * @param string $operator * @param \DateTimeInterface|string|int|null $value * @param string $boolean * @return $this */ public function whereYear($column, $operator, $value = null, $boolean = 'and') { } /** * Add an "or where year" statement to the query. * * @param string $column * @param string $operator * @param \DateTimeInterface|string|int|null $value * @return $this */ public function orWhereYear($column, $operator, $value = null) { } /** * Add a date based (year, month, day, time) statement to the query. * * @param string $type * @param string $column * @param string $operator * @param mixed $value * @param string $boolean * @return $this */ protected function addDateBasedWhere($type, $column, $operator, $value, $boolean = 'and') { } /** * Add a nested where statement to the query. * * @param \Closure $callback * @param string $boolean * @return $this */ public function whereNested(\Closure $callback, $boolean = 'and') { } /** * Create a new query instance for nested where condition. * * @return \FluentCart\Framework\Database\Query\Builder */ public function forNestedWhere() { } /** * Add another query builder as a nested where to the query builder. * * @param \FluentCart\Framework\Database\Query\Builder $query * @param string $boolean * @return $this */ public function addNestedWhereQuery($query, $boolean = 'and') { } /** * Add a full sub-select to the query. * * @param string $column * @param string $operator * @param \Closure $callback * @param string $boolean * @return $this */ protected function whereSub($column, $operator, $callback, $boolean) { } /** * Add an exists clause to the query. * * @param \Closure $callback * @param string $boolean * @param bool $not * @return $this */ public function whereExists(\Closure $callback, $boolean = 'and', $not = false) { } /** * Add an or exists clause to the query. * * @param \Closure $callback * @param bool $not * @return $this */ public function orWhereExists($callback, $not = false) { } /** * Add a where not exists clause to the query. * * @param \Closure $callback * @param string $boolean * @return $this */ public function whereNotExists($callback, $boolean = 'and') { } /** * Add a where not exists clause to the query. * * @param \Closure $callback * @return $this */ public function orWhereNotExists($callback) { } /** * Add an exists clause to the query. * * @param \FluentCart\Framework\Database\Query\Builder $query * @param string $boolean * @param bool $not * @return $this */ public function addWhereExistsQuery(self $query, $boolean = 'and', $not = false) { } /** * Adds a where condition using row values. * * @param array $columns * @param string $operator * @param array $values * @param string $boolean * @return $this * * @throws \InvalidArgumentException */ public function whereRowValues($columns, $operator, $values, $boolean = 'and') { } /** * Adds an or where condition using row values. * * @param array $columns * @param string $operator * @param array $values * @return $this */ public function orWhereRowValues($columns, $operator, $values) { } /** * Add a "where JSON contains" clause to the query. * * @param string $column * @param mixed $value * @param string $boolean * @param bool $not * @return $this */ public function whereJsonContains($column, $value, $boolean = 'and', $not = false) { } /** * Add an "or where JSON contains" clause to the query. * * @param string $column * @param mixed $value * @return $this */ public function orWhereJsonContains($column, $value) { } /** * Add a "where JSON not contains" clause to the query. * * @param string $column * @param mixed $value * @param string $boolean * @return $this */ public function whereJsonDoesntContain($column, $value, $boolean = 'and') { } /** * Add an "or where JSON not contains" clause to the query. * * @param string $column * @param mixed $value * @return $this */ public function orWhereJsonDoesntContain($column, $value) { } /** * Add a "where JSON overlaps" clause to the query. * * @param string $column * @param mixed $value * @param string $boolean * @param bool $not * @return $this */ public function whereJsonOverlaps($column, $value, $boolean = 'and', $not = false) { } /** * Add an "or where JSON overlaps" clause to the query. * * @param string $column * @param mixed $value * @return $this */ public function orWhereJsonOverlaps($column, $value) { } /** * Add a "where JSON not overlap" clause to the query. * * @param string $column * @param mixed $value * @param string $boolean * @return $this */ public function whereJsonDoesntOverlap($column, $value, $boolean = 'and') { } /** * Add an "or where JSON not overlap" clause to the query. * * @param string $column * @param mixed $value * @return $this */ public function orWhereJsonDoesntOverlap($column, $value) { } /** * Add a clause that determines if a JSON path exists to the query. * * @param string $column * @param string $boolean * @param bool $not * @return $this */ public function whereJsonContainsKey($column, $boolean = 'and', $not = false) { } /** * Add an "or" clause that determines if a JSON path exists to the query. * * @param string $column * @return $this */ public function orWhereJsonContainsKey($column) { } /** * Add a clause that determines if a JSON path does not exist to the query. * * @param string $column * @param string $boolean * @return $this */ public function whereJsonDoesntContainKey($column, $boolean = 'and') { } /** * Add an "or" clause that determines if a JSON path does not exist to the query. * * @param string $column * @return $this */ public function orWhereJsonDoesntContainKey($column) { } /** * Add a "where JSON length" clause to the query. * * @param string $column * @param mixed $operator * @param mixed $value * @param string $boolean * @return $this */ public function whereJsonLength($column, $operator, $value = null, $boolean = 'and') { } /** * Add an "or where JSON length" clause to the query. * * @param string $column * @param mixed $operator * @param mixed $value * @return $this */ public function orWhereJsonLength($column, $operator, $value = null) { } /** * Handles dynamic "where" clauses to the query. * * @param string $method * @param array $parameters * @return $this */ public function dynamicWhere($method, $parameters) { } /** * Add a single dynamic where clause statement to the query. * * @param string $segment * @param string $connector * @param array $parameters * @param int $index * @return void */ protected function addDynamic($segment, $connector, $parameters, $index) { } /** * Add a "where fulltext" clause to the query. * * @param string|string[] $columns * @param string $value * @param string $boolean * @return $this */ public function whereFullText($columns, $value, array $options = [], $boolean = 'and') { } /** * Add a "or where fulltext" clause to the query. * * @param string|string[] $columns * @param string $value * @return $this */ public function orWhereFullText($columns, $value, array $options = []) { } /** * Add a "where" clause to the query for multiple columns with "and" conditions between them. * * @param \FluentCart\Framework\Database\Query\Expression[]|string[] $columns * @param mixed $operator * @param mixed $value * @param string $boolean * @return $this */ public function whereAll($columns, $operator = null, $value = null, $boolean = 'and') { } /** * Add an "or where" clause to the query for multiple columns with "and" conditions between them. * * @param \FluentCart\Framework\Database\Query\Expression[]|string[] $columns * @param mixed $operator * @param mixed $value * @return $this */ public function orWhereAll($columns, $operator = null, $value = null) { } /** * Add a "where" clause to the query for multiple columns with "or" conditions between them. * * @param \FluentCart\Framework\Database\Query\Expression[]|string[] $columns * @param mixed $operator * @param mixed $value * @param string $boolean * @return $this */ public function whereAny($columns, $operator = null, $value = null, $boolean = 'and') { } /** * Add an "or where" clause to the query for multiple columns with "or" conditions between them. * * @param \FluentCart\Framework\Database\Query\Expression[]|string[] $columns * @param mixed $operator * @param mixed $value * @return $this */ public function orWhereAny($columns, $operator = null, $value = null) { } /** * Add a "where not" clause to the query for multiple columns where none of the conditions should be true. * * @param \FluentCart\Framework\Database\Query\Expression[]|string[] $columns * @param mixed $operator * @param mixed $value * @param string $boolean * @return $this */ public function whereNone($columns, $operator = null, $value = null, $boolean = 'and') { } /** * Add an "or where not" clause to the query for multiple columns where none of the conditions should be true. * * @param \FluentCart\Framework\Database\Query\Expression[]|string[] $columns * @param mixed $operator * @param mixed $value * @return $this */ public function orWhereNone($columns, $operator = null, $value = null) { } /** * Add a "group by" clause to the query. * * @param array|string ...$groups * @return $this */ public function groupBy(...$groups) { } /** * Add a raw groupBy clause to the query. * * @param string $sql * @param array $bindings * @return $this */ public function groupByRaw($sql, array $bindings = []) { } /** * Add a "having" clause to the query. * * @param string $column * @param string|null $operator * @param string|null $value * @param string $boolean * @return $this */ public function having($column, $operator = null, $value = null, $boolean = 'and') { } /** * Add an "or having" clause to the query. * * @param string $column * @param string|null $operator * @param string|null $value * @return $this */ public function orHaving($column, $operator = null, $value = null) { } /** * Add a nested having statement to the query. * * @param \Closure $callback * @param string $boolean * @return $this */ public function havingNested(\Closure $callback, $boolean = 'and') { } /** * Add another query builder as a nested having to the query builder. * * @param \FluentCart\Framework\Database\Query\Builder $query * @param string $boolean * @return $this */ public function addNestedHavingQuery($query, $boolean = 'and') { } /** * Add a "having null" clause to the query. * * @param string|array $columns * @param string $boolean * @param bool $not * @return $this */ public function havingNull($columns, $boolean = 'and', $not = false) { } /** * Add an "or having null" clause to the query. * * @param string $column * @return $this */ public function orHavingNull($column) { } /** * Add a "having not null" clause to the query. * * @param string|array $columns * @param string $boolean * @return $this */ public function havingNotNull($columns, $boolean = 'and') { } /** * Add an "or having not null" clause to the query. * * @param string $column * @return $this */ public function orHavingNotNull($column) { } /** * Add a "having between " clause to the query. * * @param string $column * @param array $values * @param string $boolean * @param bool $not * @return $this */ public function havingBetween($column, array $values, $boolean = 'and', $not = false) { } /** * Add a raw having clause to the query. * * @param string $sql * @param array $bindings * @param string $boolean * @return $this */ public function havingRaw($sql, array $bindings = [], $boolean = 'and') { } /** * Add a raw or having clause to the query. * * @param string $sql * @param array $bindings * @return $this */ public function orHavingRaw($sql, array $bindings = []) { } /** * Add an "order by" clause to the query. * * @param \Closure|\FluentCart\Framework\Database\Orm\Builder|\FluentCart\Framework\Database\Query\Builder|\FluentCart\Framework\Database\Query\Expression|string $column * @param string $direction * @param array $allowedColumns * @return $this * * @throws \InvalidArgumentException */ public function orderBy($column, $direction = 'asc', $allowedColumns = []) { } /** * Add a descending "order by" clause to the query. * * @param \Closure|\FluentCart\Framework\Database\Orm\Builder|\FluentCart\Framework\Database\Query\Builder|\FluentCart\Framework\Database\Query\Expression|string $column * @return $this */ public function orderByDesc($column) { } /** * Add an "order by" clause for a timestamp to the query. * * @param \Closure|\FluentCart\Framework\Database\Orm\Builder|\FluentCart\Framework\Database\Query\Builder|\FluentCart\Framework\Database\Query\Expression|string $column * @return $this */ public function latest($column = 'created_at') { } /** * Add an "order by" clause for a timestamp to the query. * * @param \Closure|\FluentCart\Framework\Database\Orm\Builder|\FluentCart\Framework\Database\Query\Builder|\FluentCart\Framework\Database\Query\Expression|string $column * @return $this */ public function oldest($column = 'created_at') { } /** * Put the query's results in random order. * * @param string $seed * @return $this */ public function inRandomOrder($seed = '') { } /** * Add a raw "order by" clause to the query. * * @param string $sql * @param array $bindings * @return $this */ public function orderByRaw($sql, $bindings = []) { } /** * Alias to set the "offset" value of the query. * * @param int $value * @return $this */ public function skip($value) { } /** * Set the "offset" value of the query. * * @param int $value * @return $this */ public function offset($value) { } /** * Alias to set the "limit" value of the query. * * @param int $value * @return $this */ public function take($value) { } /** * Set the "limit" value of the query. * * @param int $value * @return $this */ public function limit($value) { } /** * Add a "group limit" clause to the query. * * @param int $value * @param string $column * @return $this */ public function groupLimit($value, $column) { } /** * Set the limit and offset for a given page. * * @param int $page * @param int $perPage * @return $this */ public function forPage($page, $perPage = 15) { } /** * Constrain the query to the previous "page" of results before a given ID. * * @param int $perPage * @param int|null $lastId * @param string $column * @return $this */ public function forPageBeforeId($perPage = 15, $lastId = 0, $column = 'id') { } /** * Constrain the query to the next "page" of results after a given ID. * * @param int $perPage * @param int|null $lastId * @param string $column * @return $this */ public function forPageAfterId($perPage = 15, $lastId = 0, $column = 'id') { } /** * Remove all existing orders and optionally add a new order. * * @param \Closure|\FluentCart\Framework\Database\Query\Builder|\FluentCart\Framework\Database\Query\Expression|string|null $column * @param string $direction * @return $this */ public function reorder($column = null, $direction = 'asc') { } /** * Get an array with all orders with a given column removed. * * @param string $column * @return array */ protected function removeExistingOrdersFor($column) { } /** * Add a union statement to the query. * * @param \FluentCart\Framework\Database\Query\Builder|\Closure $query * @param bool $all * @return $this */ public function union($query, $all = false) { } /** * Add a union all statement to the query. * * @param \FluentCart\Framework\Database\Query\Builder|\Closure $query * @return $this */ public function unionAll($query) { } /** * Lock the selected rows in the table. * * @param string|bool $value * @return $this */ public function lock($value = true) { } /** * Lock the selected rows in the table for updating. * * @return \FluentCart\Framework\Database\Query\Builder */ public function lockForUpdate() { } /** * Share lock the selected rows in the table. * * @return \FluentCart\Framework\Database\Query\Builder */ public function sharedLock() { } /** * Register a closure to be invoked before the query is executed. * * @param callable $callback * @return $this */ public function beforeQuery(callable $callback) { } /** * Invoke the "before query" modification callbacks. * * @return void */ public function applyBeforeQueryCallbacks() { } /** * Register a closure to be invoked after the query is executed. * * @param \Closure $callback * @return $this */ public function afterQuery(\Closure $callback) { } /** * Invoke the "after query" modification callbacks. * * @param mixed $result * @return mixed */ public function applyAfterQueryCallbacks($result) { } /** * Get the SQL representation of the query. * * @return string */ public function toSql() { } /** * Get the raw SQL representation of the query with embedded bindings. * * @return string */ public function toRawSql() { } /** * Execute a query for a single record by ID. * * @param int|string $id * @param array $columns * @return mixed|static */ public function find($id, $columns = ['*']) { } /** * Execute a query for a single record by ID or call a callback. * * @template TValue * * @param mixed $id * @param (\Closure(): TValue)|list|string $columns * @param (\Closure(): TValue)|null $callback * @return object|TValue */ public function findOr($id, $columns = ['*'], ?\Closure $callback = null) { } /** * Get a single column's value from the first result of a query. * * @param string $column * @return mixed */ public function value($column) { } /** * Get a single expression value from the first result of a query. * * @param string $expression * @param array $bindings * @return mixed */ public function rawValue(string $expression, array $bindings = []) { } /** * Get a single column's value from the first result of a query if it's the sole matching record. * * @param string $column * @return mixed * * @throws \FluentCart\Framework\Database\RecordsNotFoundException * @throws \FluentCart\Framework\Database\MultipleRecordsFoundException */ public function soleValue($column) { } /** * Execute the query as a "select" statement. * * @param array|string $columns * @return \FluentCart\Framework\Support\Collection */ public function get($columns = ['*']) { } /** * Run the query as a "select" statement against the connection. * * @return array */ protected function runSelect() { } /** * Remove the group limit keys from the results in the collection. * * @param \FluentCart\Framework\Support\Collection $items * @return \FluentCart\Framework\Support\Collection */ protected function withoutGroupLimitKeys($items) { } /** * Paginate the given query into a simple paginator. * * @param int $perPage * @param array $columns * @param string $pageName * @param int|null $page * @param int|null $total * @return \FluentCart\Framework\Pagination\LengthAwarePaginatorInterface */ public function paginate($perPage = 15, $columns = ['*'], $pageName = 'page', $page = null, $total = null) { } /** * Get a paginator only supporting simple next and previous links. * * This is more efficient on larger data-sets, etc. * * @param int $perPage * @param array $columns * @param string $pageName * @param int|null $page * @return \FluentCart\Framework\Pagination\PaginatorInterface */ public function simplePaginate($perPage = 15, $columns = ['*'], $pageName = 'page', $page = null) { } /** * Get a cursor paginator for efficient pagination of large datasets. * * Cursor pagination uses a unique column value (or multiple columns) * as a pointer, allowing for consistent, efficient * navigation without large OFFSETs. * * @param int|null $perPage * @param array $columns * @param string $cursorName * @param \FluentCart\Framework\Pagination\Cursor|string|null $cursor * @return \FluentCart\Framework\Pagination\CursorPaginatorInterface */ public function cursorPaginate($perPage = 15, $columns = ['*'], $cursorName = 'cursor', $cursor = null) { } /** * Ensure the proper order by required for cursor pagination. * * @param bool $shouldReverse * @return \FluentCart\Framework\Support\Collection */ protected function ensureOrderForCursorPagination($shouldReverse = false) { } /** * Get the count of the total records for the paginator. * * @param array $columns * @return int */ public function getCountForPagination($columns = ['*']) { } /** * Run a pagination count query. * * @param array $columns * @return array */ protected function runPaginationCountQuery($columns = ['*']) { } /** * Clone the existing query instance for usage in a pagination subquery. * * @return self */ protected function cloneForPaginationCount() { } /** * Remove the column aliases since they will break count queries. * * @param array $columns * @return array */ protected function withoutSelectAliases(array $columns) { } /** * Get a lazy collection for the given query. * * @return \FluentCart\Framework\Support\LazyCollection */ public function cursor() { } /** * Get a lazy collection for the given query. * * @return \FluentCart\Framework\Support\LazyCollection */ public function rawCursor() { } /** * Throw an exception if the query doesn't have an orderBy clause. * * @return void * * @throws \RuntimeException */ protected function enforceOrderBy() { } /** * Get a collection instance containing the values of a given column. * * @param string $column * @param string|null $key * @return \FluentCart\Framework\Support\Collection */ public function pluck($column, $key = null) { } /** * Strip off the table name or alias from a column identifier. * * @param string $column * @return string|null */ protected function stripTableForPluck($column) { } /** * Retrieve column values from rows represented as objects. * * @param array $queryResult * @param string $column * @param string $key * @return \FluentCart\Framework\Support\Collection */ protected function pluckFromObjectColumn($queryResult, $column, $key) { } /** * Retrieve column values from rows represented as arrays. * * @param array $queryResult * @param string $column * @param string $key * @return \FluentCart\Framework\Support\Collection */ protected function pluckFromArrayColumn($queryResult, $column, $key) { } /** * Concatenate values of a given column as a string. * * @param string $column * @param string $glue * @return string */ public function implode($column, $glue = '') { } /** * Determine if any rows exist for the current query. * * @return bool */ public function exists() { } /** * Determine if no rows exist for the current query. * * @return bool */ public function doesntExist() { } /** * Execute the given callback if no rows exist for the current query. * * @param \Closure $callback * @return mixed */ public function existsOr(\Closure $callback) { } /** * Execute the given callback if rows exist for the current query. * * @param \Closure $callback * @return mixed */ public function doesntExistOr(\Closure $callback) { } /** * Retrieve the "count" result of the query. * * @param string $columns * @return int */ public function count($columns = '*') { } /** * Retrieve the minimum value of a given column. * * @param string $column * @return mixed */ public function min($column) { } /** * Retrieve the maximum value of a given column. * * @param string $column * @return mixed */ public function max($column) { } /** * Retrieve the sum of the values of a given column. * * @param string $column * @return mixed */ public function sum($column) { } /** * Retrieve the average of the values of a given column. * * @param string $column * @return mixed */ public function avg($column) { } /** * Alias for the "avg" method. * * @param string $column * @return mixed */ public function average($column) { } /** * Execute an aggregate function on the database. * * @param string $function * @param array $columns * @return mixed */ public function aggregate($function, $columns = ['*']) { } /** * Execute a numeric aggregate function on the database. * * @param string $function * @param array $columns * @return float|int */ public function numericAggregate($function, $columns = ['*']) { } /** * Set the aggregate property without running the query. * * @param string $function * @param array $columns * @return $this */ protected function setAggregate($function, $columns) { } /** * Execute the given callback while selecting the given columns. * * After running the callback, the columns are reset to the original value. * * @param array $columns * @param callable $callback * @return mixed */ protected function onceWithColumns($columns, $callback) { } /** * Insert new records into the database. * * @param array $values * @return bool */ public function insert(array $values) { } /** * Insert new records into the database while ignoring errors. * * @param array $values * @return int */ public function insertOrIgnore(array $values) { } /** * Insert a new record and get the value of the primary key. * * @param array $values * @param string|null $sequence * @return int */ public function insertGetId(array $values, $sequence = null) { } /** * Insert new records into the table using a subquery. * * @param array $columns * @param \Closure|\FluentCart\Framework\Database\Query\Builder|string $query * @return int */ public function insertUsing(array $columns, $query) { } /** * Insert new records into the table using a subquery while ignoring errors. * * @param array $columns * @param \Closure|\FluentCart\Framework\Database\Query\Builder|\FluentCart\Framework\Database\Orm\Builder|string $query * @return int|bool Returns the number of affected rows or false on failure */ public function insertOrIgnoreUsing(array $columns, $query) { } /** * Update records in the database. * * @param array $values * @return int */ public function update(array $values) { } /** * Update records in a PostgreSQL database using the update from syntax. * * @param array $values * @return int */ public function updateFrom(array $values) { } /** * Insert or update a record matching the attributes, and fill it with values. * * @param array $attributes * @param array $values * @return bool */ public function updateOrInsert(array $attributes, $values = []) { } /** * Insert new records or update the existing ones. * * @param array $values * @param array|string $uniqueBy * @param array|null $update * @return int */ public function upsert(array $values, $uniqueBy, $update = null) { } /** * Increment a column's value by a given amount. * * @param string $column * @param float|int $amount * @param array $extra * @return int * * @throws \InvalidArgumentException */ public function increment($column, $amount = 1, array $extra = []) { } /** * Increment the given column's values by the given amounts. * * @param array $columns * @param array $extra * @return int * * @throws \InvalidArgumentException */ public function incrementEach(array $columns, array $extra = []) { } /** * Decrement a column's value by a given amount. * * @param string $column * @param float|int $amount * @param array $extra * @return int * * @throws \InvalidArgumentException */ public function decrement($column, $amount = 1, array $extra = []) { } /** * Decrement the given column's values by the given amounts. * * @param array $columns * @param array $extra * @return int * * @throws \InvalidArgumentException */ public function decrementEach(array $columns, array $extra = []) { } /** * Delete records from the database. * * @param mixed $id * @return int */ public function delete($id = null) { } /** * Run a truncate statement on the table. * * @return void */ public function truncate() { } /** * Get a new instance of the query builder. * * @return \FluentCart\Framework\Database\Query\Builder */ public function newQuery() { } /** * Create a new query instance for a sub-query. * * @return \FluentCart\Framework\Database\Query\Builder */ protected function forSubQuery() { } /** * Get all of the query builder's columns in a text-only array with all expressions evaluated. * * @return array */ public function getColumns() { } /** * Create a raw database expression. * * @param mixed $value * @return \FluentCart\Framework\Database\Query\Expression */ public function raw($value) { } /** * Get the query builder instances that are used in the union of the query. * * @return \FluentCart\Framework\Support\Collection */ protected function getUnionBuilders() { } /** * Get the current query value bindings in a flattened array. * * @return array */ public function getBindings() { } /** * Get the raw array of bindings. * * @return array */ public function getRawBindings() { } /** * Set the bindings on the query builder. * * @param array $bindings * @param string $type * @return $this * * @throws \InvalidArgumentException */ public function setBindings(array $bindings, $type = 'where') { } /** * Add a binding to the query. * * @param mixed $value * @param string $type * @return $this * * @throws \InvalidArgumentException */ public function addBinding($value, $type = 'where') { } /** * Cast the given binding value. * * @param mixed $value * @return mixed */ public function castBinding($value) { } /** * Merge an array of bindings into our bindings. * * @param \FluentCart\Framework\Database\Query\Builder $query * @return $this */ public function mergeBindings(self $query) { } /** * Remove all of the expressions from a list of bindings. * * @param array $bindings * @return array */ public function cleanBindings(array $bindings) { } /** * Get a scalar type value from an unknown type of input. * * @param mixed $value * @return mixed */ protected function flattenValue($value) { } /** * Get the default key name of the table. * * @return string */ protected function defaultKeyName() { } /** * Get the database connection instance. * * @return \FluentCart\Framework\Database\ConnectionInterface */ public function getConnection() { } /** * Get the database query processor instance. * * @return \FluentCart\Framework\Database\Query\Processors\Processor */ public function getProcessor() { } /** * Get the query grammar instance. * * @return \FluentCart\Framework\Database\Query\Grammars\Grammar */ public function getGrammar() { } /** * Use the write pdo for query. * * @return $this */ public function useWritePdo() { } /** * Determine if the value is a query builder instance or a Closure. * * @param mixed $value * @return bool */ protected function isQueryable($value) { } /** * Clone the query. * * @return static */ public function clone() { } /** * Clone the query without the given properties. * * @param array $properties * @return static */ public function cloneWithout(array $properties) { } /** * Clone the query without the given bindings. * * @param array $except * @return static */ public function cloneWithoutBindings(array $except) { } /** * Handle dynamic method calls into the method. * * @param string $method * @param array $parameters * @return mixed * * @throws \BadMethodCallException */ public function __call($method, $parameters) { } /** * Set a dynamic property. * * @param string $key * @param mixed $value */ public function __set($key, $value) { } /** * Get dynamically injected value. * * @param string $key * @return mixed */ public function __get($key) { } } interface ExpressionInterface { /** * Get the value of the expression. * * @param \FluentCart\Framework\Database\BaseGrammar $grammar * @return string|int|float */ public function getValue(\FluentCart\Framework\Database\BaseGrammar $grammar); } interface ConditionExpression extends \FluentCart\Framework\Database\Query\ExpressionInterface { // ... } class Expression implements \FluentCart\Framework\Database\Query\ExpressionInterface { /** * The value of the expression. * * @var mixed */ protected $value; /** * Create a new raw query expression. * * @param mixed $value * @return void */ public function __construct($value) { } /** * Get the value of the expression. * * @param \FluentCart\Framework\Database\BaseGrammar $grammar * @return mixed */ public function getValue(\FluentCart\Framework\Database\BaseGrammar $grammar) { } /** * Convert the object to its string representation. * * @return string [description] */ public function __toString() { } } } namespace FluentCart\Framework\Database\Query\Grammars { class Grammar extends \FluentCart\Framework\Database\BaseGrammar { use \FluentCart\Framework\Database\Concerns\CompilesJsonPaths; /** * The grammar specific operators. * * @var array */ protected $operators = []; /** * The grammar specific bitwise operators. * * @var array */ protected $bitwiseOperators = []; /** * The components that make up a select clause. * * @var string[] */ protected $selectComponents = ['aggregate', 'columns', 'from', 'indexHint', 'joins', 'wheres', 'groups', 'havings', 'orders', 'limit', 'offset', 'lock']; /** * Compile a select query into SQL. * * @param \FluentCart\Framework\Database\Query\Builder $query * @return string */ public function compileSelect(\FluentCart\Framework\Database\Query\Builder $query) { } /** * Compile the components necessary for a select clause. * * @param \FluentCart\Framework\Database\Query\Builder $query * @return array */ protected function compileComponents(\FluentCart\Framework\Database\Query\Builder $query) { } /** * Compile an aggregated select clause. * * @param \FluentCart\Framework\Database\Query\Builder $query * @param array $aggregate * @return string */ protected function compileAggregate(\FluentCart\Framework\Database\Query\Builder $query, $aggregate) { } /** * Compile the "select *" portion of the query. * * @param \FluentCart\Framework\Database\Query\Builder $query * @param array $columns * @return string|null */ protected function compileColumns(\FluentCart\Framework\Database\Query\Builder $query, $columns) { } /** * Compile the "from" portion of the query. * * @param \FluentCart\Framework\Database\Query\Builder $query * @param string $table * @return string */ protected function compileFrom(\FluentCart\Framework\Database\Query\Builder $query, $table) { } /** * Compile the "join" portions of the query. * * @param \FluentCart\Framework\Database\Query\Builder $query * @param array $joins * @return string */ protected function compileJoins(\FluentCart\Framework\Database\Query\Builder $query, $joins) { } /** * Compile a "lateral join" clause. * * @param \FluentCart\Framework\Database\Query\JoinLateralClause $join * @param string $expression * @return string * * @throws \RuntimeException */ public function compileJoinLateral(\FluentCart\Framework\Database\Query\JoinLateralClause $join, string $expression) { } /** * Compile the "where" portions of the query. * * @param \FluentCart\Framework\Database\Query\Builder $query * @return string */ public function compileWheres(\FluentCart\Framework\Database\Query\Builder $query) { } /** * Get an array of all the where clauses for the query. * * @param \FluentCart\Framework\Database\Query\Builder $query * @return array */ protected function compileWheresToArray($query) { } /** * Format the where clause statements into one string. * * @param \FluentCart\Framework\Database\Query\Builder $query * @param array $sql * @return string */ protected function concatenateWhereClauses($query, $sql) { } /** * Compile a raw where clause. * * @param \FluentCart\Framework\Database\Query\Builder $query * @param array $where * @return string */ protected function whereRaw(\FluentCart\Framework\Database\Query\Builder $query, $where) { } /** * Compile a basic where clause. * * @param \FluentCart\Framework\Database\Query\Builder $query * @param array $where * @return string */ protected function whereBasic(\FluentCart\Framework\Database\Query\Builder $query, $where) { } /** * Compile a bitwise operator where clause. * * @param \FluentCart\Framework\Database\Query\Builder $query * @param array $where * @return string */ protected function whereBitwise(\FluentCart\Framework\Database\Query\Builder $query, $where) { } /** * Compile a "where like" clause. * * @param \FluentCart\Framework\Database\Query\Builder $query * @param array $where * @return string */ protected function whereLike(\FluentCart\Framework\Database\Query\Builder $query, $where) { } /** * Compile a "where in" clause. * * @param \FluentCart\Framework\Database\Query\Builder $query * @param array $where * @return string */ protected function whereIn(\FluentCart\Framework\Database\Query\Builder $query, $where) { } /** * Compile a "where not in" clause. * * @param \FluentCart\Framework\Database\Query\Builder $query * @param array $where * @return string */ protected function whereNotIn(\FluentCart\Framework\Database\Query\Builder $query, $where) { } /** * Compile a "where not in raw" clause. * * For safety, whereIntegerInRaw ensures this method is only used with integer values. * * @param \FluentCart\Framework\Database\Query\Builder $query * @param array $where * @return string */ protected function whereNotInRaw(\FluentCart\Framework\Database\Query\Builder $query, $where) { } /** * Compile a "where in raw" clause. * * For safety, whereIntegerInRaw ensures this method is only used with integer values. * * @param \FluentCart\Framework\Database\Query\Builder $query * @param array $where * @return string */ protected function whereInRaw(\FluentCart\Framework\Database\Query\Builder $query, $where) { } /** * Compile a "where null" clause. * * @param \FluentCart\Framework\Database\Query\Builder $query * @param array $where * @return string */ protected function whereNull(\FluentCart\Framework\Database\Query\Builder $query, $where) { } /** * Compile a "where not null" clause. * * @param \FluentCart\Framework\Database\Query\Builder $query * @param array $where * @return string */ protected function whereNotNull(\FluentCart\Framework\Database\Query\Builder $query, $where) { } /** * Compile a "between" where clause. * * @param \FluentCart\Framework\Database\Query\Builder $query * @param array $where * @return string */ protected function whereBetween(\FluentCart\Framework\Database\Query\Builder $query, $where) { } /** * Compile a "between" where clause. * * @param \FluentCart\Framework\Database\Query\Builder $query * @param array $where * @return string */ protected function whereBetweenColumns(\FluentCart\Framework\Database\Query\Builder $query, $where) { } /** * Compile a "where date" clause. * * @param \FluentCart\Framework\Database\Query\Builder $query * @param array $where * @return string */ protected function whereDate(\FluentCart\Framework\Database\Query\Builder $query, $where) { } /** * Compile a "where time" clause. * * @param \FluentCart\Framework\Database\Query\Builder $query * @param array $where * @return string */ protected function whereTime(\FluentCart\Framework\Database\Query\Builder $query, $where) { } /** * Compile a "where day" clause. * * @param \FluentCart\Framework\Database\Query\Builder $query * @param array $where * @return string */ protected function whereDay(\FluentCart\Framework\Database\Query\Builder $query, $where) { } /** * Compile a "where month" clause. * * @param \FluentCart\Framework\Database\Query\Builder $query * @param array $where * @return string */ protected function whereMonth(\FluentCart\Framework\Database\Query\Builder $query, $where) { } /** * Compile a "where year" clause. * * @param \FluentCart\Framework\Database\Query\Builder $query * @param array $where * @return string */ protected function whereYear(\FluentCart\Framework\Database\Query\Builder $query, $where) { } /** * Compile a date based where clause. * * @param string $type * @param \FluentCart\Framework\Database\Query\Builder $query * @param array $where * @return string */ protected function dateBasedWhere($type, \FluentCart\Framework\Database\Query\Builder $query, $where) { } /** * Compile a where clause comparing two columns. * * @param \FluentCart\Framework\Database\Query\Builder $query * @param array $where * @return string */ protected function whereColumn(\FluentCart\Framework\Database\Query\Builder $query, $where) { } /** * Compile a nested where clause. * * @param \FluentCart\Framework\Database\Query\Builder $query * @param array $where * @return string */ protected function whereNested(\FluentCart\Framework\Database\Query\Builder $query, $where) { } /** * Compile a where condition with a sub-select. * * @param \FluentCart\Framework\Database\Query\Builder $query * @param array $where * @return string */ protected function whereSub(\FluentCart\Framework\Database\Query\Builder $query, $where) { } /** * Compile a where exists clause. * * @param \FluentCart\Framework\Database\Query\Builder $query * @param array $where * @return string */ protected function whereExists(\FluentCart\Framework\Database\Query\Builder $query, $where) { } /** * Compile a where exists clause. * * @param \FluentCart\Framework\Database\Query\Builder $query * @param array $where * @return string */ protected function whereNotExists(\FluentCart\Framework\Database\Query\Builder $query, $where) { } /** * Compile a where row values condition. * * @param \FluentCart\Framework\Database\Query\Builder $query * @param array $where * @return string */ protected function whereRowValues(\FluentCart\Framework\Database\Query\Builder $query, $where) { } /** * Compile a "where JSON boolean" clause. * * @param \FluentCart\Framework\Database\Query\Builder $query * @param array $where * @return string */ protected function whereJsonBoolean(\FluentCart\Framework\Database\Query\Builder $query, $where) { } /** * Compile a "where JSON contains" clause. * * @param \FluentCart\Framework\Database\Query\Builder $query * @param array $where * @return string */ protected function whereJsonContains(\FluentCart\Framework\Database\Query\Builder $query, $where) { } /** * Compile a "JSON contains" statement into SQL. * * @param string $column * @param string $value * @return string * * @throws \RuntimeException */ protected function compileJsonContains($column, $value) { } /** * Compile a "where JSON overlaps" clause. * * @param \FluentCart\Framework\Database\Query\Builder $query * @param array $where * @return string */ protected function whereJsonOverlaps(\FluentCart\Framework\Database\Query\Builder $query, $where) { } /** * Compile a "JSON overlaps" statement into SQL. * * @param string $column * @param string $value * @return string * * @throws \RuntimeException */ protected function compileJsonOverlaps($column, $value) { } /** * Prepare the binding for a "JSON contains" statement. * * @param mixed $binding * @return string */ public function prepareBindingForJsonContains($binding) { } /** * Compile a "where JSON contains key" clause. * * @param \FluentCart\Framework\Database\Query\Builder $query * @param array $where * @return string */ protected function whereJsonContainsKey(\FluentCart\Framework\Database\Query\Builder $query, $where) { } /** * Compile a "JSON contains key" statement into SQL. * * @param string $column * @return string * * @throws \RuntimeException */ protected function compileJsonContainsKey($column) { } /** * Compile a "where JSON length" clause. * * @param \FluentCart\Framework\Database\Query\Builder $query * @param array $where * @return string */ protected function whereJsonLength(\FluentCart\Framework\Database\Query\Builder $query, $where) { } /** * Compile a "JSON length" statement into SQL. * * @param string $column * @param string $operator * @param string $value * @return string * * @throws \RuntimeException */ protected function compileJsonLength($column, $operator, $value) { } /** * Compile a "JSON value cast" statement into SQL. * * @param string $value * @return string */ public function compileJsonValueCast($value) { } /** * Compile a "where fulltext" clause. * * @param \FluentCart\Framework\Database\Query\Builder $query * @param array $where * @return string */ public function whereFullText(\FluentCart\Framework\Database\Query\Builder $query, $where) { } /** * Compile a clause based on an expression. * * @param \FluentCart\Framework\Database\Query\Builder $query * @param array $where * @return string */ public function whereExpression(\FluentCart\Framework\Database\Query\Builder $query, $where) { } /** * Compile the "group by" portions of the query. * * @param \FluentCart\Framework\Database\Query\Builder $query * @param array $groups * @return string */ protected function compileGroups(\FluentCart\Framework\Database\Query\Builder $query, $groups) { } /** * Compile the "having" portions of the query. * * @param \FluentCart\Framework\Database\Query\Builder $query * @return string */ protected function compileHavings(\FluentCart\Framework\Database\Query\Builder $query) { } /** * Compile a single having clause. * * @param array $having * @return string */ protected function compileHaving(array $having) { } /** * Compile a basic having clause. * * @param array $having * @return string */ protected function compileBasicHaving($having) { } /** * Compile a "between" having clause. * * @param array $having * @return string */ protected function compileHavingBetween($having) { } /** * Compile a having null clause. * * @param array $having * @return string */ protected function compileHavingNull($having) { } /** * Compile a having not null clause. * * @param array $having * @return string */ protected function compileHavingNotNull($having) { } /** * Compile a having clause involving a bit operator. * * @param array $having * @return string */ protected function compileHavingBit($having) { } /** * Compile a having clause involving an expression. * * @param array $having * @return string */ protected function compileHavingExpression($having) { } /** * Compile a nested having clause. * * @param array $having * @return string */ protected function compileNestedHavings($having) { } /** * Compile the "order by" portions of the query. * * @param \FluentCart\Framework\Database\Query\Builder $query * @param array $orders * @return string */ protected function compileOrders(\FluentCart\Framework\Database\Query\Builder $query, $orders) { } /** * Compile the query orders to an array. * * @param \FluentCart\Framework\Database\Query\Builder $query * @param array $orders * @return array */ protected function compileOrdersToArray(\FluentCart\Framework\Database\Query\Builder $query, $orders) { } /** * Compile the random statement into SQL. * * @param string|int $seed * @return string */ public function compileRandom($seed) { } /** * Compile the "limit" portions of the query. * * @param \FluentCart\Framework\Database\Query\Builder $query * @param int $limit * @param int|null $offset * @return string */ protected function compileLimit(\FluentCart\Framework\Database\Query\Builder $query, $limit, $offset = null) { } /** * Compile a group limit clause. * * @param \FluentCart\Framework\Database\Query\Builder $query * @return string */ protected function compileGroupLimit(\FluentCart\Framework\Database\Query\Builder $query) { } /** * Compile a row number clause. * * @param string $partition * @param string $orders * @return string */ protected function compileRowNumber($partition, $orders) { } /** * Compile the "offset" portions of the query. * * @param \FluentCart\Framework\Database\Query\Builder $query * @param int $offset * @return string */ protected function compileOffset(\FluentCart\Framework\Database\Query\Builder $query, $offset) { } /** * Compile the "union" queries attached to the main query. * * @param \FluentCart\Framework\Database\Query\Builder $query * @return string */ protected function compileUnions(\FluentCart\Framework\Database\Query\Builder $query) { } /** * Compile a single union statement. * * @param array $union * @return string */ protected function compileUnion(array $union) { } /** * Wrap a union subquery in parentheses. * * @param string $sql * @return string */ protected function wrapUnion($sql) { } /** * Compile a union aggregate query into SQL. * * @param \FluentCart\Framework\Database\Query\Builder $query * @return string */ protected function compileUnionAggregate(\FluentCart\Framework\Database\Query\Builder $query) { } /** * Compile an exists statement into SQL. * * @param \FluentCart\Framework\Database\Query\Builder $query * @return string */ public function compileExists(\FluentCart\Framework\Database\Query\Builder $query) { } /** * Compile an insert statement into SQL. * * @param \FluentCart\Framework\Database\Query\Builder $query * @param array $values * @return string */ public function compileInsert(\FluentCart\Framework\Database\Query\Builder $query, array $values) { } /** * Compile an insert ignore statement into SQL. * * @param \FluentCart\Framework\Database\Query\Builder $query * @param array $values * @return string * * @throws \RuntimeException */ public function compileInsertOrIgnore(\FluentCart\Framework\Database\Query\Builder $query, array $values) { } /** * Compile an insert and get ID statement into SQL. * * @param \FluentCart\Framework\Database\Query\Builder $query * @param array $values * @param string $sequence * @return string */ public function compileInsertGetId(\FluentCart\Framework\Database\Query\Builder $query, $values, $sequence) { } /** * Compile an insert statement using a subquery into SQL. * * @param \FluentCart\Framework\Database\Query\Builder $query * @param array $columns * @param string $sql * @return string */ public function compileInsertUsing(\FluentCart\Framework\Database\Query\Builder $query, array $columns, string $sql) { } /** * Compile an insert ignore statement using a subquery into SQL. * * @param \FluentCart\Framework\Database\Query\Builder $query * @param array $columns * @param string $sql * @return string * * @throws \RuntimeException */ public function compileInsertOrIgnoreUsing(\FluentCart\Framework\Database\Query\Builder $query, array $columns, string $sql) { } /** * Compile an update statement into SQL. * * @param \FluentCart\Framework\Database\Query\Builder $query * @param array $values * @return string */ public function compileUpdate(\FluentCart\Framework\Database\Query\Builder $query, array $values) { } /** * Compile the columns for an update statement. * * @param \FluentCart\Framework\Database\Query\Builder $query * @param array $values * @return string */ protected function compileUpdateColumns(\FluentCart\Framework\Database\Query\Builder $query, array $values) { } /** * Compile an update statement without joins into SQL. * * @param \FluentCart\Framework\Database\Query\Builder $query * @param string $table * @param string $columns * @param string $where * @return string */ protected function compileUpdateWithoutJoins(\FluentCart\Framework\Database\Query\Builder $query, $table, $columns, $where) { } /** * Compile an update statement with joins into SQL. * * @param \FluentCart\Framework\Database\Query\Builder $query * @param string $table * @param string $columns * @param string $where * @return string */ protected function compileUpdateWithJoins(\FluentCart\Framework\Database\Query\Builder $query, $table, $columns, $where) { } /** * Compile an "upsert" statement into SQL. * * @param \FluentCart\Framework\Database\Query\Builder $query * @param array $values * @param array $uniqueBy * @param array $update * @return string * * @throws \RuntimeException */ public function compileUpsert(\FluentCart\Framework\Database\Query\Builder $query, array $values, array $uniqueBy, array $update) { } /** * Prepare the bindings for an update statement. * * @param array $bindings * @param array $values * @return array */ public function prepareBindingsForUpdate(array $bindings, array $values) { } /** * Compile a delete statement into SQL. * * @param \FluentCart\Framework\Database\Query\Builder $query * @return string */ public function compileDelete(\FluentCart\Framework\Database\Query\Builder $query) { } /** * Compile a delete statement without joins into SQL. * * @param \FluentCart\Framework\Database\Query\Builder $query * @param string $table * @param string $where * @return string */ protected function compileDeleteWithoutJoins(\FluentCart\Framework\Database\Query\Builder $query, $table, $where) { } /** * Compile a delete statement with joins into SQL. * * @param \FluentCart\Framework\Database\Query\Builder $query * @param string $table * @param string $where * @return string */ protected function compileDeleteWithJoins(\FluentCart\Framework\Database\Query\Builder $query, $table, $where) { } /** * Prepare the bindings for a delete statement. * * @param array $bindings * @return array */ public function prepareBindingsForDelete(array $bindings) { } /** * Compile a truncate table statement into SQL. * * @param \FluentCart\Framework\Database\Query\Builder $query * @return array */ public function compileTruncate(\FluentCart\Framework\Database\Query\Builder $query) { } /** * Compile the lock into SQL. * * @param \FluentCart\Framework\Database\Query\Builder $query * @param bool|string $value * @return string */ protected function compileLock(\FluentCart\Framework\Database\Query\Builder $query, $value) { } /** * Compile a query to get the number of open connections for a database. * * @return string|null */ public function compileThreadCount() { } /** * Determine if the grammar supports savepoints. * * @return bool */ public function supportsSavepoints() { } /** * Compile the SQL statement to define a savepoint. * * @param string $name * @return string */ public function compileSavepoint($name) { } /** * Compile the SQL statement to execute a savepoint rollback. * * @param string $name * @return string */ public function compileSavepointRollBack($name) { } /** * Compile the SQL statement to release a savepoint. * * @param string $name * @return string */ public function compileSavepointRelease($name) { } /** * Wrap the given JSON selector for boolean values. * * @param string $value * @return string */ protected function wrapJsonBooleanSelector($value) { } /** * Wrap the given JSON boolean value. * * @param string $value * @return string */ protected function wrapJsonBooleanValue($value) { } /** * Concatenate an array of segments, removing empties. * * @param array $segments * @return string */ protected function concatenate($segments) { } /** * Remove the leading boolean from a statement. * * @param string $value * @return string */ protected function removeLeadingBoolean($value) { } /** * Substitute the given bindings into the given raw SQL query. * * @param string $sql * @param array $bindings * @return string */ public function substituteBindingsIntoRawSql($sql, $bindings) { } /** * Get the grammar specific operators. * * @return array */ public function getOperators() { } /** * Get the grammar specific bitwise operators. * * @return array */ public function getBitwiseOperators() { } } class MySqlGrammar extends \FluentCart\Framework\Database\Query\Grammars\Grammar { /** * The grammar specific operators. * * @var string[] */ protected $operators = ['sounds like']; /** * Compile a "where like" clause. * * @param \FluentCart\Framework\Database\Query\Builder $query * @param array $where * @return string */ protected function whereLike(\FluentCart\Framework\Database\Query\Builder $query, $where) { } /** * Add a "where null" clause to the query. * * @param \FluentCart\Framework\Database\Query\Builder $query * @param array $where * @return string */ protected function whereNull(\FluentCart\Framework\Database\Query\Builder $query, $where) { } /** * Add a "where not null" clause to the query. * * @param \FluentCart\Framework\Database\Query\Builder $query * @param array $where * @return string */ protected function whereNotNull(\FluentCart\Framework\Database\Query\Builder $query, $where) { } /** * Compile a "where fulltext" clause. * * @param \FluentCart\Framework\Database\Query\Builder $query * @param array $where * @return string */ public function whereFullText(\FluentCart\Framework\Database\Query\Builder $query, $where) { } /** * Compile the index hints for the query. * * @param \FluentCart\Framework\Database\Query\Builder $query * @param \FluentCart\Framework\Database\Query\IndexHint $indexHint * @return string */ protected function compileIndexHint(\FluentCart\Framework\Database\Query\Builder $query, $indexHint) { } /** * Compile a group limit clause. * * @param \FluentCart\Framework\Database\Query\Builder $query * @return string */ protected function compileGroupLimit(\FluentCart\Framework\Database\Query\Builder $query) { } /** * Determine whether to use a legacy group limit clause for MySQL < 8.0. * * @param \FluentCart\Framework\Database\Query\Builder $query * @return bool */ public function useLegacyGroupLimit(\FluentCart\Framework\Database\Query\Builder $query) { } /** * Compile a group limit clause for MySQL < 8.0. * * Derived from https://softonsofa.com/tweaking-eloquent-relations-how-to-get-n-related-models-per-parent/. * * @param \FluentCart\Framework\Database\Query\Builder $query * @return string */ protected function compileLegacyGroupLimit(\FluentCart\Framework\Database\Query\Builder $query) { } /** * Compile an insert ignore statement into SQL. * * @param \FluentCart\Framework\Database\Query\Builder $query * @param array $values * @return string */ public function compileInsertOrIgnore(\FluentCart\Framework\Database\Query\Builder $query, array $values) { } /** * Compile an insert ignore statement using a subquery into SQL. * * @param \FluentCart\Framework\Database\Query\Builder $query * @param array $columns * @param string $sql * @return string */ public function compileInsertOrIgnoreUsing(\FluentCart\Framework\Database\Query\Builder $query, array $columns, string $sql) { } /** * Compile a "JSON contains" statement into SQL. * * @param string $column * @param string $value * @return string */ protected function compileJsonContains($column, $value) { } /** * Compile a "JSON overlaps" statement into SQL. * * @param string $column * @param string $value * @return string */ protected function compileJsonOverlaps($column, $value) { } /** * Compile a "JSON contains key" statement into SQL. * * @param string $column * @return string */ protected function compileJsonContainsKey($column) { } /** * Compile a "JSON length" statement into SQL. * * @param string $column * @param string $operator * @param string $value * @return string */ protected function compileJsonLength($column, $operator, $value) { } /** * Compile a "JSON value cast" statement into SQL. * * @param string $value * @return string */ public function compileJsonValueCast($value) { } /** * Compile the random statement into SQL. * * @param string $seed * @return string */ public function compileRandom($seed) { } /** * Compile the lock into SQL. * * @param \FluentCart\Framework\Database\Query\Builder $query * @param bool|string $value * @return string */ protected function compileLock(\FluentCart\Framework\Database\Query\Builder $query, $value) { } /** * Compile an insert statement into SQL. * * @param \FluentCart\Framework\Database\Query\Builder $query * @param array $values * @return string */ public function compileInsert(\FluentCart\Framework\Database\Query\Builder $query, array $values) { } /** * Compile the columns for an update statement. * * @param \FluentCart\Framework\Database\Query\Builder $query * @param array $values * @return string */ protected function compileUpdateColumns(\FluentCart\Framework\Database\Query\Builder $query, array $values) { } /** * Compile an "upsert" statement into SQL. * * @param \FluentCart\Framework\Database\Query\Builder $query * @param array $values * @param array $uniqueBy * @param array $update * @return string */ public function compileUpsert(\FluentCart\Framework\Database\Query\Builder $query, array $values, array $uniqueBy, array $update) { } /** * Compile a "lateral join" clause. * * @param \FluentCart\Framework\Database\Query\JoinLateralClause $join * @param string $expression * @return string */ public function compileJoinLateral(\FluentCart\Framework\Database\Query\JoinLateralClause $join, string $expression) { } /** * Prepare a JSON column being updated using the JSON_SET function. * * @param string $key * @param mixed $value * @return string */ protected function compileJsonUpdateColumn($key, $value) { } /** * Compile an update statement without joins into SQL. * * @param \FluentCart\Framework\Database\Query\Builder $query * @param string $table * @param string $columns * @param string $where * @return string */ protected function compileUpdateWithoutJoins(\FluentCart\Framework\Database\Query\Builder $query, $table, $columns, $where) { } /** * Prepare the bindings for an update statement. * * Booleans, integers, and doubles are inserted into JSON updates as raw values. * * @param array $bindings * @param array $values * @return array */ public function prepareBindingsForUpdate(array $bindings, array $values) { } /** * Compile a delete query that does not use joins. * * @param \FluentCart\Framework\Database\Query\Builder $query * @param string $table * @param string $where * @return string */ protected function compileDeleteWithoutJoins(\FluentCart\Framework\Database\Query\Builder $query, $table, $where) { } /** * Compile a query to get the number of open connections for a database. * * @return string */ public function compileThreadCount() { } /** * Wrap a single string in keyword identifiers. * * @param string $value * @return string */ protected function wrapValue($value) { } /** * Wrap the given JSON selector. * * @param string $value * @return string */ protected function wrapJsonSelector($value) { } /** * Wrap the given JSON selector for boolean values. * * @param string $value * @return string */ protected function wrapJsonBooleanSelector($value) { } } class SQLiteGrammar extends \FluentCart\Framework\Database\Query\Grammars\Grammar { /** * All of the available clause operators. * * @var string[] */ protected $operators = ['=', '<', '>', '<=', '>=', '<>', '!=', 'like', 'not like', 'ilike', '&', '|', '<<', '>>']; /** * Compile the lock into SQL. * * @param \FluentCart\Framework\Database\Query\Builder $query * @param bool|string $value * @return string */ protected function compileLock(\FluentCart\Framework\Database\Query\Builder $query, $value) { } /** * Wrap a union subquery in parentheses. * * @param string $sql * @return string */ protected function wrapUnion($sql) { } /** * Compile a "where like" clause. * * @param \FluentCart\Framework\Database\Query\Builder $query * @param array $where * @return string */ protected function whereLike(\FluentCart\Framework\Database\Query\Builder $query, $where) { } /** * Convert a LIKE pattern to a GLOB pattern using simple string replacement. * * @param string $value * @param bool $caseSensitive * @return string */ public function prepareWhereLikeBinding($value, $caseSensitive) { } /** * Compile a "where date" clause. * * @param \FluentCart\Framework\Database\Query\Builder $query * @param array $where * @return string */ protected function whereDate(\FluentCart\Framework\Database\Query\Builder $query, $where) { } /** * Compile a "where day" clause. * * @param \FluentCart\Framework\Database\Query\Builder $query * @param array $where * @return string */ protected function whereDay(\FluentCart\Framework\Database\Query\Builder $query, $where) { } /** * Compile a "where month" clause. * * @param \FluentCart\Framework\Database\Query\Builder $query * @param array $where * @return string */ protected function whereMonth(\FluentCart\Framework\Database\Query\Builder $query, $where) { } /** * Compile a "where year" clause. * * @param \FluentCart\Framework\Database\Query\Builder $query * @param array $where * @return string */ protected function whereYear(\FluentCart\Framework\Database\Query\Builder $query, $where) { } /** * Compile a "where time" clause. * * @param \FluentCart\Framework\Database\Query\Builder $query * @param array $where * @return string */ protected function whereTime(\FluentCart\Framework\Database\Query\Builder $query, $where) { } /** * Compile a date based where clause. * * @param string $type * @param \FluentCart\Framework\Database\Query\Builder $query * @param array $where * @return string */ protected function dateBasedWhere($type, \FluentCart\Framework\Database\Query\Builder $query, $where) { } /** * Compile the index hints for the query. * * @param \FluentCart\Framework\Database\Query\Builder $query * @param \FluentCart\Framework\Database\Query\IndexHint $indexHint * @return string */ protected function compileIndexHint(\FluentCart\Framework\Database\Query\Builder $query, $indexHint) { } /** * Compile a "JSON length" statement into SQL. * * @param string $column * @param string $operator * @param string $value * @return string */ protected function compileJsonLength($column, $operator, $value) { } /** * Compile a "JSON contains" statement into SQL. * * @param string $column * @param mixed $value * @return string */ protected function compileJsonContains($column, $value) { } /** * Compile a "JSON overlaps" statement into SQL. * * SQLite has no native json_overlaps(), so we emulate it by checking * whether any element in the column's JSON array exists in the given array. * * @param string $column * @param string $value * @return string */ protected function compileJsonOverlaps($column, $value) { } /** * Prepare the binding for a "JSON contains" statement. * * @param mixed $binding * @return mixed */ public function prepareBindingForJsonContains($binding) { } /** * Compile a "JSON contains key" statement into SQL. * * @param string $column * @return string */ protected function compileJsonContainsKey($column) { } /** * Compile a group limit clause. * * @param \FluentCart\Framework\Database\Query\Builder $query * @return string */ protected function compileGroupLimit(\FluentCart\Framework\Database\Query\Builder $query) { } /** * Compile an update statement into SQL. * * @param \FluentCart\Framework\Database\Query\Builder $query * @param array $values * @return string */ public function compileUpdate(\FluentCart\Framework\Database\Query\Builder $query, array $values) { } /** * Compile an insert ignore statement into SQL. * * @param \FluentCart\Framework\Database\Query\Builder $query * @param array $values * @return string */ public function compileInsertOrIgnore(\FluentCart\Framework\Database\Query\Builder $query, array $values) { } /** * Compile an insert ignore statement using a subquery into SQL. * * @param \FluentCart\Framework\Database\Query\Builder $query * @param array $columns * @param string $sql * @return string */ public function compileInsertOrIgnoreUsing(\FluentCart\Framework\Database\Query\Builder $query, array $columns, string $sql) { } /** * Compile the columns for an update statement. * * @param \FluentCart\Framework\Database\Query\Builder $query * @param array $values * @return string */ protected function compileUpdateColumns(\FluentCart\Framework\Database\Query\Builder $query, array $values) { } /** * Compile an "upsert" statement into SQL. * * @param \FluentCart\Framework\Database\Query\Builder $query * @param array $values * @param array $uniqueBy * @param array $update * @return string */ public function compileUpsert(\FluentCart\Framework\Database\Query\Builder $query, array $values, array $uniqueBy, array $update) { } /** * Group the nested JSON columns. * * @param array $values * @return array */ protected function groupJsonColumnsForUpdate(array $values) { } /** * Compile a "JSON" patch statement into SQL. * * @param string $column * @param mixed $value * @return string */ protected function compileJsonPatch($column, $value) { } /** * Compile an update statement with joins or limit into SQL. * * @param \FluentCart\Framework\Database\Query\Builder $query * @param array $values * @return string */ protected function compileUpdateWithJoinsOrLimit(\FluentCart\Framework\Database\Query\Builder $query, array $values) { } /** * Prepare the bindings for an update statement. * * @param array $bindings * @param array $values * @return array */ public function prepareBindingsForUpdate(array $bindings, array $values) { } /** * Compile a delete statement into SQL. * * @param \FluentCart\Framework\Database\Query\Builder $query * @return string */ public function compileDelete(\FluentCart\Framework\Database\Query\Builder $query) { } /** * Compile a delete statement with joins or limit into SQL. * * @param \FluentCart\Framework\Database\Query\Builder $query * @return string */ protected function compileDeleteWithJoinsOrLimit(\FluentCart\Framework\Database\Query\Builder $query) { } /** * Compile a truncate table statement into SQL. * * @param \FluentCart\Framework\Database\Query\Builder $query * @return array */ public function compileTruncate(\FluentCart\Framework\Database\Query\Builder $query) { } /** * Wrap the given JSON selector. * * @param string $value * @return string */ protected function wrapJsonSelector($value) { } /** * SQLite under WordPress does not support SAVEPOINTs via the SQL * translation layer, so nested partial rollbacks are not available. * * @return bool */ public function supportsSavepoints() { } } } namespace FluentCart\Framework\Database\Query { class IndexHint { /** * The type of query hint. * * @var string */ public $type; /** * The name of the index. * * @var string */ public $index; /** * Create a new index hint instance. * * @param string $type * @param string $index * @return void */ public function __construct($type, $index) { } } class JoinClause extends \FluentCart\Framework\Database\Query\Builder { /** * The type of join being performed. * * @var string */ public $type; /** * The table the join clause is joining to. * * @var string */ public $table; /** * The connection of the parent query builder. * * @var \FluentCart\Framework\Database\ConnectionInterface */ protected $parentConnection; /** * The grammar of the parent query builder. * * @var \FluentCart\Framework\Database\Query\Grammars\Grammar */ protected $parentGrammar; /** * The processor of the parent query builder. * * @var \FluentCart\Framework\Database\Query\Processors\Processor */ protected $parentProcessor; /** * The class name of the parent query builder. * * @var string */ protected $parentClass; /** * Create a new join clause instance. * * @param \FluentCart\Framework\Database\Query\Builder $parentQuery * @param string $type * @param string $table * @return void */ public function __construct(\FluentCart\Framework\Database\Query\Builder $parentQuery, $type, $table) { } /** * Add an "on" clause to the join. * * On clauses can be chained, e.g. * * $join->on('contacts.user_id', '=', 'users.id') * ->on('contacts.info_id', '=', 'info.id') * * will produce the following SQL: * * on `contacts`.`user_id` = `users`.`id` and `contacts`.`info_id` = `info`.`id` * * @param \Closure|string $first * @param string|null $operator * @param \FluentCart\Framework\Database\Query\Expression|string|null $second * @param string $boolean * @return self * * @throws \InvalidArgumentException */ public function on($first, $operator = null, $second = null, $boolean = 'and') { } /** * Add an "or on" clause to the join. * * @param \Closure|string $first * @param string|null $operator * @param \FluentCart\Framework\Database\Query\Expression|string|null $second * @return \FluentCart\Framework\Database\Query\JoinClause */ public function orOn($first, $operator = null, $second = null) { } /** * Get a new instance of the join clause builder. * * @return \FluentCart\Framework\Database\Query\JoinClause */ public function newQuery() { } /** * Create a new query instance for sub-query. * * @return \FluentCart\Framework\Database\Query\Builder */ protected function forSubQuery() { } /** * Create a new parent query instance. * * @return \FluentCart\Framework\Database\Query\Builder */ protected function newParentQuery() { } } class JoinLateralClause extends \FluentCart\Framework\Database\Query\JoinClause { //... } } namespace FluentCart\Framework\Database\Query\Processors { class Processor { /** * Process the results of a "select" query. * * @param \FluentCart\Framework\Database\Query\Builder $query * @param array $results * @return array */ public function processSelect(\FluentCart\Framework\Database\Query\Builder $query, $results) { } /** * Process an "insert get ID" query. * * @param \FluentCart\Framework\Database\Query\Builder $query * @param string $sql * @param array $values * @param string|null $sequence * @return int */ public function processInsertGetId(\FluentCart\Framework\Database\Query\Builder $query, $sql, $values, $sequence = null) { } /** * Process the results of a tables query. * * @param array $results * @return array */ public function processTables($results) { } /** * Process the results of a views query. * * @param array $results * @return array */ public function processViews($results) { } /** * Process the results of a types query. * * @param array $results * @return array */ public function processTypes($results) { } /** * Process the results of a columns query. * * @param array $results * @return array */ public function processColumns($results) { } /** * Process the results of an indexes query. * * @param array $results * @return array */ public function processIndexes($results) { } /** * Process the results of a foreign keys query. * * @param array $results * @return array */ public function processForeignKeys($results) { } } class MySqlProcessor extends \FluentCart\Framework\Database\Query\Processors\Processor { /** * Process the results of a column listing query. * * @deprecated Will be removed in a future Laravel version. * * @param array $results * @return array */ public function processColumnListing($results) { } /** * Process the results of a columns query. * * @param array $results * @return array */ public function processColumns($results) { } /** * Process the results of an indexes query. * * @param array $results * @return array */ public function processIndexes($results) { } /** * Process the results of a foreign keys query. * * @param array $results * @return array */ public function processForeignKeys($results) { } } class SQLiteProcessor extends \FluentCart\Framework\Database\Query\Processors\Processor { /** * Process the results of a columns query. * * @param array $results * @param string $sql * @return array */ public function processColumns($results, $sql = '') { } /** * Process the results of an indexes query. * * @param array $results * @return array */ public function processIndexes($results) { } /** * Process the results of a foreign keys query. * * @param array $results * @return array */ public function processForeignKeys($results) { } } } namespace FluentCart\Framework\Database\Query { class WPDBConnection implements \FluentCart\Framework\Database\ConnectionInterface { use \FluentCart\Framework\Database\DetectsLostConnections, \FluentCart\Framework\Database\Concerns\ManagesTransactions; /** * $wpdb Global $wpdb instance * @var Object */ protected $wpdb; /** * The name of the connected database. * * @var string */ protected $database; /** * The table prefix for the connection. * * @var string */ protected $tablePrefix = ''; /** * The database connection configuration options. * * @var array */ protected $config = []; /** * The query grammar implementation. * * @var \FluentCart\Framework\Database\Query\Grammars\Grammar */ protected $queryGrammar; /** * The query post processor implementation. * * @var \FluentCart\Framework\Database\Query\Processors\Processor */ protected $postProcessor; /** * The number of active transactions. * * @var int */ protected $transactions = 0; /** * The transaction manager instance. * * @var \FluentCart\Framework\Database\DatabaseTransactionsManager|null */ protected $transactionsManager; /** * All of the callbacks that should be invoked before a transaction is started. * * @var \Closure[] */ protected $beforeStartingTransaction = []; /** * The event dispatcher. * * @var \FluentCart\Framework\Events\Dispatcher */ protected $event = null; /** * Create a new database connection instance. * * @param \wpdb $wpdb The WordPress database instance. * @return void */ public function __construct($wpdb) { } /** * Populate $wpdb instance & turn off db errors * * @param $wpdb Global $wpdb instance * @return Null */ protected function setupWpdbInstance($wpdb) { } /** * Determine if database errors should be shown. * * @return bool */ protected function shouldShowErrors() { } /** * Set the query grammar to the default implementation. * * @return void */ public function useDefaultQueryGrammar() { } /** * Get the default query grammar instance. * * @return \FluentCart\Framework\Database\Query\Grammars\Grammar */ protected function getDefaultQueryGrammar() { } /** * Set the query post processor to the default implementation. * * @return void */ public function useDefaultPostProcessor() { } /** * Get the default post processor instance. * * @return \FluentCart\Framework\Database\Query\Processors\Processor */ protected function getDefaultPostProcessor() { } /** * Begin a fluent query against a database table. * * @param \Closure|\FluentCart\Framework\Database\Query\Builder|string $table * @param string|null $as * @return \FluentCart\Framework\Database\Query\Builder */ public function table($table, $as = null) { } /** * Get a new query builder instance. * * @return \FluentCart\Framework\Database\Query\Builder */ public function query() { } /** * Run a select statement and return a single result. * * @param string $query * @param array $bindings * @return mixed */ public function selectOne($query, $bindings = []) { } /** * Run a select statement and return the first column of the first row. * * @param string $query * @param array $bindings * @return mixed * * @throws \FluentCart\Framework\Database\MultipleColumnsSelectedException */ public function scalar($query, $bindings = []) { } /** * Run a select statement against the database. * * @param string $query * @param array $bindings * @return array */ public function select($query, $bindings = []) { } /** * Bind the parameters into SQL query * * @param $query * @param $bindings * @return string */ protected function bindParams(string $query, array $bindings) { } /** * Replace placeholder occurrences whose binding is null with the * literal SQL keyword NULL, returning the rewritten query and the * remaining (non-null) bindings re-indexed. * * @param string $query * @param array $bindings * @param string $placeholder '%s' for wpdb->prepare path, '?' for mysqli native prepare * @return array{0:string,1:array} * * @phpstan-ignore-next-line */ protected function spliceNullBindings(string $query, array $bindings, string $placeholder): array { } /** * Run a select statement against the database and returns a generator. * * @param string $query * @param array $bindings * @return \Generator * @throws \FluentAccount\Framework\Database\QueryException */ public function cursor($query, $bindings = []) { } /** * Raw cursor query for MySQLi (non-prepared). * * @param string $query * @param array $bindings * @return \Generator * @throws \FluentAccount\Framework\Database\QueryException */ public function rawCursor($query, $bindings = []) { } /** * Run an insert statement against the database. * * @param string $query * @param array $bindings * @return bool */ public function insert($query, $bindings = []) { } /** * Run an update statement against the database. * * @param string $query * @param array $bindings * @return int */ public function update($query, $bindings = []) { } /** * Run a delete statement against the database. * * @param string $query * @param array $bindings * @return int */ public function delete($query, $bindings = []) { } /** * Execute an SQL statement and return the boolean result. * * @param string $query * @param array $bindings * @return bool */ public function statement($query, $bindings = []) { } /** * Run an SQL statement and get the number of rows affected. * * @param string $query * @param array $bindings * @return int */ public function affectingStatement($query, $bindings = []) { } /** * Run a raw, unprepared query against the PDO connection. * * @param string $query * @return bool */ public function unprepared($query) { } /** * Execute the given callback in "dry run" mode. * * @param \Closure $callback * @return array */ public function pretend(\Closure $callback) { } /** * Prepare the query bindings for execution. * * @param array $bindings * @return array */ public function prepareBindings(array $bindings) { } /** * Run a SQL statement and log its execution context. * * @param string $query * @param array $bindings * @param \Closure $callback * @return mixed */ public function run($query, $bindings, $callback) { } /** * Get a new raw query expression. * * @param mixed $value * @return \FluentCart\Framework\Database\Query\Expression */ public function raw($value) { } /** * Get the query grammar used by the connection. * * @return \FluentCart\Framework\Database\Query\Grammars\Grammar */ public function getQueryGrammar() { } /** * Set the query grammar used by the connection. * * @param \FluentCart\Framework\Database\Query\Grammars\Grammar $grammar * @return $this */ public function setQueryGrammar(\FluentCart\Framework\Database\Query\Grammars\Grammar $grammar) { } /** * Get the query post processor used by the connection. * * @return \FluentCart\Framework\Database\Query\Processors\Processor */ public function getPostProcessor() { } /** * Set the query post processor used by the connection. * * @param \FluentCart\Framework\Database\Query\Processors\Processor $processor * @return $this */ public function setPostProcessor(\FluentCart\Framework\Database\Query\Processors\Processor $processor) { } /** * Return the last insert id * * @param string $args * * @return int */ public function lastInsertId($args) { } /** * Return self as PDO, the Processor instance uses it. * * @return \FluentCart\Framework\Database\Query\WPDBConnection */ public function getPdo() { } /** * Returns the $wpdb object. * * @return Object $wpdb */ public function getWPDB() { } /** * Get the database connection name. * * @return string|null */ public function getName() { } /** * Get the name of the connected database. * * @return string */ public function getDatabaseName() { } /** * Get the server version for the connection. * * @return string * * @phpstan-ignore-next-line */ public function getServerVersion(): string { } /** * Get the column listing for a given table. * * @param string $table * @return array */ public function getColumnListing($table) { } /** * Alias for getColumnListing. * * @param string $t * @return array */ public function getColumns($t) { } /** * Determine if the connected database is a sqlite database. * * @return bool */ public function isSqlite() { } /** * Determine if the connected database is a mariadb database. * * @return bool */ public function isMaria() { } /** * Register a hook to be run just before a database transaction is started. * * @param \Closure $callback * @return $this */ public function beforeStartingTransaction(\Closure $callback) { } /** * Register a database query listener with the connection. * * @param \Closure $callback * @return void */ public function listen(\Closure $callback) { } /** * Fire an event for this connection. * * @param string $event * @return array|null */ protected function fireConnectionEvent($event) { } /** * Get the elapsed time since a given starting point. * * @param int $start * @return float */ protected function getElapsedTime($start) { } /** * Get the table prefix for the connection. * * @return [type] [description] */ public function getTablePrefix() { } /** * Get the table name with the table prefix. * * @param string $table * @return string */ public function getTableName($table) { } } } namespace FluentCart\Framework\Database { class QueryException extends \PDOException { /** * The SQL for the query. * * @var string */ protected $sql; /** * The bindings for the query. * * @var array */ protected $bindings; /** * Create a new query exception instance. * * @param string $sql * @param array $bindings * @param \Throwable $previous * @return void */ public function __construct($sql, array $bindings, \Throwable $previous) { } /** * Format the SQL error message. * * @param string $sql * @param array $bindings * @param \Exception $previous * @return string */ protected function formatMessage($sql, $bindings, $previous) { } /** * Get the SQL for the query. * * @return string */ public function getSql() { } /** * Get the bindings for the query. * * @return array */ public function getBindings() { } /** * Replace placeholders with bindings * * @param string $search * @param array $replace * @param string $subject * @return string $subject */ protected function strReplaceArray($search, array $replace, $subject) { } } class Schema { use \FluentCart\Framework\Database\Concerns\MaintainsDatabase; /** * Keep track of custom tables when unit testing * * @var array */ public static $customTempTables = []; /** * Get the global $wpdb instance * * @return \wpdb The global $wpdb */ public static function db() { } /** * Get schema/db information * * @return string|array */ public static function getInfo($key = null) { } /** * Migrates database table(s) * * @param string|array $table The table name without prefix * or an array where each key is table name and value is sql. * * @param string $sql Optional * @return mixed */ public static function migrate($table, $sql = null) { } /** * Creates a new table if doesn't exist using dbDelta function * * @param string $table The table name without the prefix * @param string $sql The sql to create table or an absolute path of a * .sql file containing the column definations for creating the new table. * * @return string Message */ public static function createTableIfNotExist($table, $sql) { } /** * Checks if a column exists in a table * * @param string $column The column name of the table * @param string $table The table name without prefix * @return boolean */ public static function hasColumn($column, $table) { } /** * Checks if a table exists * * @param string $table The table name without prefix * @return boolean */ public static function hasTable($table) { } /** * Resolves the table prefix and makes the table name with prefix * * @param string $table The table name without the prefix * @return string The resolved table name with the prefix */ public static function table($table) { } /** * Resolves the sql prefix * * @param string $sql The file name or the raw sql * @return string The resolved sql */ public static function sql($sql = '') { } /** * Clean the sql string by removing the comments. * * @param string $sql * @return string */ public static function cleanUp($sql) { } /** * Creates a new table using dbDelta function or alters the table if exists. * * @param string $table The table name without the prefix * @param string $sql The sql to create table or an absolute path of a * .sql file containing the column definations for creating the new table. * * @return string message */ public static function createTable($table, $sql) { } /** * Alters an existing table if exists * * @param string $table The table name without the prefix * @param string $sql The sql to create table or an absolute path of a * .sql file containing the column definations for creating the new table. * * @return string message */ public static function alterTableIfExists($table, $sql) { } /** * Alters an existing table * * @param string $table The table name without the prefix * @param string $sql The sql to create table or an absolute path of a * .sql file containing the column definations for creating the new table. * * @return string message */ public static function alterTable($table, $sql) { } /** * Split a comma-separated ALTER TABLE clause list, respecting parentheses * so that DECIMAL(10,2) and similar types are not split mid-definition. * * @param string $sql * @return string[] */ protected static function splitAlterClauses($sql) { } /** * Alters an existing table using dbDelta function if exists, otherwise creates * it. Alters an existing table but takes the table creation column defination. * This is because, the dbDelta functioin can create or update a table using * the table creation defination. In this, case, if a table exists and the * columns are matched then nothing happens but if there's any difference * in the new sql then the dbDelta alters the table using the new sql * defination but doesn't delete any columns. So, after the dbDelta * finishes it's job, any non-existing columns in the new sql * defination will be deleted from the existing table. if * table is not there then the table gets created. * * @param string $table The table name without the prefix * @param string $sql The sql to create table or an absolute path of a * .sql file containing the column definations for creating the new table. * * @return string message */ public static function updateTable($table, $sql) { } /** * Drops/deletes an existing table. * * @param string $table The table name without the prefix * @param bool $disableForeignKeyCheck Optional. * @return bool */ public static function dropTable($table, $disableForeignKeyCheck = true) { } /** * Drops/deletes an existing table if exists * * @param string $table The table name without the prefix * @param bool $disableForeignKeyCheck Optional. * @return bool */ public static function dropTableIfExists($table, $disableForeignKeyCheck = true) { } /** * Truncate a table. * * @param string $table * @return bool */ public static function truncate($table) { } /** * Truncate a table if exists. * * @param string $table * @return bool */ public static function truncateTableIfExists($table) { } /** * Adds a new index to a column of given table. * * @param string $table Table name * @param string $index Columns name * @return bool * @see https://developer.wordpress.org/reference/functions/add_clean_index */ public static function addIndex($table, $index) { } /** * Drops an index from a column of given table. * * @param string $table Table name * @param string $index Columns name * @return bool * @see https://developer.wordpress.org/reference/functions/drop_index */ public static function dropIndex($table, $index) { } /** * Makes raw query and can resolve the table name from the query * and can form a full table name including the table prefix if * the table name is wrapped like: %table_name% in the query. * * @param string $query * @return mixed */ public static function query($query) { } /** * Get a list of all columns from the given table name. * * @param string $table The table name without the prefix * @return array|null */ public static function getColumns($table) { } /** * Gets a list of all columns including column information * * @param string $table The table name without the prefix * @return array */ protected static function protectedGetColumnsWithTypes($table) { } public static function getColumnsWithTypes($table) { } /** * Gets a list of all columns including column information * * @param string $table The table name without the prefix * @return array */ public static function describeTable($table) { } /** * Gets a list of all foreign keys from the given table name. * * @param string $table * @return array */ public static function getTableForeignKeys($table) { } /** * Retrieves the list of all available built-in tables from * the database using WordPress' $wpdb->tables native method. * * @param string $scope * @param boolean $prefix * @param integer $blogId * @return string[] WP Table names. When a prefix is requested, * the key is the unprefixed table name. * @see https://developer.wordpress.org/reference/classes/wpdb/tables/ */ public static function tables($scope = 'all', $prefix = true, $blogId = 0) { } /** * Retrieves the list of all available tables from the database. * * @param string $dbname optional * @return array */ public static function getTables($dbname = null) { } /** * Retrieves the list of all available tables in the database. * * @param string $dbname optional * @return array */ public static function getTableList($dbname = null) { } /** * Retrieves the list of all available views in the database. * * @param string $dbname optional * @return array */ public static function getViews($dbname = null) { } /** * Retrieves the SQL definition of a specific view. * * @param string $name The view name * @param string $dbname optional * @return string|null */ public static function getView($name, $dbname = null) { } /** * Determine if the connected database is a sqlite database. * * @return bool */ public static function isSqlite() { } /** * Determine if the connected database is a mariadb database. * * @return bool */ public static function isMaria() { } /** * Retrieve the current database engine name. * * @param string $table * @return string */ public static function getEngine($table) { } /** * The wrapper for calling dbDelta function * * @param string $sql * @return mixed */ public static function callDBDelta($sql) { } /** * Helper to get the driver-specific JSON type. */ public static function jsonType() { } } class UniqueConstraintViolationException extends \FluentCart\Framework\Database\QueryException { // ... } } namespace FluentCart\Framework\Encryption { class DecryptException extends \RuntimeException { // ... } class EncryptException extends \RuntimeException { // ... } class Encrypter { /** * The encryption key. * * @var string */ protected $key; /** * The algorithm used for encryption. * * @var string */ protected $cipher; /** * The plugin slug key. * * @var string */ protected $slug; /** * The supported cipher algorithms and their properties. * * @var array */ private static $supportedCiphers = ['aes-128-cbc' => ['size' => 16, 'aead' => false], 'aes-256-cbc' => ['size' => 32, 'aead' => false], 'aes-128-gcm' => ['size' => 16, 'aead' => true], 'aes-256-gcm' => ['size' => 32, 'aead' => true]]; /** * Create a new encrypter instance. * * @param string $key * @param string $cipher * @return void * * @throws \RuntimeException */ public function __construct($key = null, $cipher = 'aes-128-cbc') { } /** * Determine if the given key and cipher combination is valid. * * @param string $key * @param string $cipher * @return bool */ public static function supported($key, $cipher) { } /** * Create a new encryption key for the given cipher. * * @param string $cipher * @return string * * @throws \RuntimeException If the cipher is not in the supported list. */ public static function generateKey($cipher) { } /** * Encrypt the given value. * * @param mixed $value * @param bool $serialize * @return string * * @throws \FluentCart\Framework\Encryption\EncryptException */ public function encrypt($value, $serialize = true) { } /** * Encrypt a string without serialization. * * @param string $value * @return string * * @throws \FluentCart\Framework\Encryption\EncryptException */ public function encryptString($value) { } /** * Decrypt the given value. * * @param string $payload * @param bool $unserialize * @return mixed * * @throws \FluentCart\Framework\Encryption\DecryptException */ public function decrypt($payload, $unserialize = true) { } /** * Decrypt the given string without unserialization. * * @param string $payload * @return string * * @throws \FluentCart\Framework\Encryption\DecryptException */ public function decryptString($payload) { } /** * Create a MAC for the given value. * * @param string $iv * @param mixed $value * @param string $key * @return string */ protected function hash($iv, $value, $key) { } /** * Get the JSON array from the given payload. * * @param string $payload * @return array * * @throws \FluentCart\Framework\Encryption\DecryptException */ protected function getJsonPayload($payload) { } /** * Verify that the encryption payload is valid. * * @param mixed $payload * @return bool */ protected function validPayload($payload) { } /** * Determine if the MAC for the given payload is valid for the primary key. * * @param array $payload * @return bool */ protected function validMac(array $payload) { } /** * Determine if the MAC is valid for the given payload and key. * * @param array $payload * @param string $key * @return bool */ protected function validMacForKey($payload, $key) { } /** * Ensure the given tag is a valid tag given the selected cipher. * * @param string $tag * @return void */ protected function ensureTagIsValid($tag) { } /** * Determine if we should validate the MAC while decrypting. * * @return bool */ protected function shouldValidateMac() { } /** * Get the application encryption key. * * Developers may override the database key name using the filter: * `{slug}.encryption.option_key` * * @return string */ public function getSlug() { } /** * Get the encryption key that the encrypter is currently using. * * @return string */ public function getKey() { } /** * Get the current encryption key and all previous encryption keys. * * This is useful for key rotation, allowing decryption of data * encrypted with older keys. * * @return array Array of binary encryption keys. */ public function getAllKeys() { } /** * Resolve the option name that stores rotated old keys. * Honors the {slug}.encryption.old_keys_option filter when the * framework App is bootstrapped; otherwise uses the default. * * @return string */ protected function oldKeysOptionName() { } /** * Rotate the encryption key. * * This method archives the current key in the old keys list, * generates a new encryption key, stores it in the database, * and updates the encrypter instance with the new key. * * @return void */ public function rotateKey() { } /** * Maximum number of rotated keys to retain. * * Honors the {slug}.encryption.old_keys_max filter when the framework * App is bootstrapped. Default is 10, which covers ~10 weeks of weekly * rotation or ~10 years of annual rotation; bump the filter to keep * more historical keys around. * * @return int */ protected function oldKeysMax() { } } } namespace FluentCart\Framework\Events { interface DispatcherInterface { /** * Register an event listener with the dispatcher. * * @param \Closure|string|array $events * @param \Closure|string|array|null $listener * @return void */ public function listen($events, $listener = null); /** * Determine if a given event has listeners. * * @param string $eventName * @return bool */ public function hasListeners($eventName); /** * Register an event subscriber with the dispatcher. * * @param object|string $subscriber * @return void */ public function subscribe($subscriber); /** * Dispatch an event until the first non-null response is returned. * * @param string|object $event * @param mixed $payload * @return array|null */ public function until($event, $payload = []); /** * Dispatch an event and call the listeners. * * @param string|object $event * @param mixed $payload * @param bool $halt * @return array|null */ public function dispatch($event, $payload = [], $halt = false); /** * Register an event and payload to be fired later. * * @param string $event * @param array $payload * @return void */ public function push($event, $payload = []); /** * Flush a set of pushed events. * * @param string $event * @return void */ public function flush($event); /** * Remove a set of listeners from the dispatcher. * * @param string $event * @return void */ public function forget($event); /** * Forget all of the queued listeners. * * @return void */ public function forgetPushed(); } } namespace FluentCart\Framework\Support { trait ReflectsClosures { /** * Get the class name of the first parameter of the given Closure. * * @param \Closure $closure * @return string * * @throws \ReflectionException * @throws \RuntimeException */ protected function firstClosureParameterType(\Closure $closure) { } /** * Get the class names of the first parameter of the given Closure, including union types. * * @param \Closure $closure * @return array * * @throws \ReflectionException * @throws \RuntimeException */ protected function firstClosureParameterTypes(\Closure $closure) { } /** * Get the class names / types of the parameters of the given Closure. * * @param \Closure $closure * @return array * * @throws \ReflectionException */ protected function closureParameterTypes(\Closure $closure) { } } } namespace FluentCart\Framework\Events { class Dispatcher implements \FluentCart\Framework\Events\DispatcherInterface { use \FluentCart\Framework\Support\MacroableTrait, \FluentCart\Framework\Support\ReflectsClosures; /** * The IoC container instance. * * @var \FluentCart\Framework\Container\Contracts\Container */ protected $container; /** * The registered event listeners. * * @var array */ protected $listeners = []; /** * The wildcard listeners. * * @var array */ protected $wildcards = []; /** * The cached wildcard listeners. * * @var array */ protected $wildcardsCache = []; /** * The stack of listeners being deferred. * * @var integer */ protected $deferDepth = 0; /** * The currently deferred events. * * @var array */ protected $deferredEvents = []; /** * Indicates if events should be deferred. * * @var bool */ protected $deferringEvents = false; /** * The specific events to defer (null means defer all events). * * @var array|null */ protected $eventsToDefer = null; /** * The transaction manager instance. * * @var \FluentCart\Framework\Database\DatabaseTransactionsManager|null */ protected $transactionManagerResolver = null; /** * Create a new event dispatcher instance. * * @param \FluentCart\Framework\Container\Contracts\Container|null $container * @return void */ public function __construct(?\FluentCart\Framework\Container\Contracts\Container $container = null) { } /** * Register an event listener with the dispatcher. * * @param \Closure|string|array $events * @param \Closure|string|array|null $listener * @return void */ public function listen($events, $listener = null) { } /** * Setup a wildcard listener callback. * * @param string $event * @param \Closure|string $listener * @return void */ protected function setupWildcardListen($event, $listener) { } /** * Determine if a given event has listeners. * * @param string $eventName * @return bool */ public function hasListeners($eventName) { } /** * Determine if the given event has any wildcard listeners. * * @param string $eventName * @return bool */ public function hasWildcardListeners($eventName) { } /** * Register an event and payload to be fired later. * * @param string $event * @param array $payload * @return void */ public function push($event, $payload = []) { } /** * Flush a set of pushed events. * * @param string $event * @return void */ public function flush($event) { } /** * Register an event subscriber with the dispatcher. * * @param object|string $subscriber * @return void */ public function subscribe($subscriber) { } /** * Resolve the subscriber instance. * * @param object|string $subscriber * @return mixed */ protected function resolveSubscriber($subscriber) { } /** * Execute the given callback while deferring events, * then dispatch all the deferred events. * * @param callable $callback * @param array|null $events * @return mixed */ public function defer(callable $callback, ?array $events = null) { } /** * Determine if the given event should be deferred. * * @param string $event * @return bool */ protected function shouldDeferEvent($event) { } /** * Fire an event until the first non-null response is returned. * * @param string|object $event * @param mixed $payload * @return array|null */ public function until($event, $payload = []) { } /** * Fire an event and call the listeners. * * @param string|object $event * @param mixed $payload * @param bool $halt * @return array|null */ public function dispatch($event, $payload = [], $halt = false) { } /** * Broadcast an event and call its listeners. * * @param string|object $event * @param mixed $payload * @param bool $halt * @return array|null */ protected function invokeListeners($event, $payload, $halt = false) { } /** * Parse the given event and payload and prepare them for dispatching. * * @param mixed $event * @param mixed $payload * @return array */ protected function parseEventAndPayload($event, $payload) { } /** * Get all of the listeners for a given event name. * * @param string $eventName * @return array */ public function getListeners($eventName) { } /** * Get the wildcard listeners for the event. * * @param string $eventName * @return array */ protected function getWildcardListeners($eventName) { } /** * Add the listeners for the event's interfaces to the given array. * * @param string $eventName * @param array $listeners * @return array */ protected function addInterfaceListeners($eventName, array $listeners = []) { } /** * Register an event listener with the dispatcher. * * @param \Closure|string|array $listener * @param bool $wildcard * @return \Closure */ public function makeListener($listener, $wildcard = false) { } /** * Create a class based listener using the IoC container. * * @param string $listener * @param bool $wildcard * @return \Closure */ public function createClassListener($listener, $wildcard = false) { } /** * Create the class based event callable. * * @param array|string $listener * @return callable */ protected function createClassCallable($listener) { } /** * Parse the class listener into class and method. * * @param string $listener * @return array */ protected function parseClassCallable($listener) { } /** * Determine if the given event handler should be dispatched after * all database transactions have committed. * * @param object|mixed $listener * @return bool */ protected function ShouldBeDispatchedAfterTransactions($listener) { } /** * Create a callable for dispatching a listener after database transactions. * * @param mixed $listener * @param string $method * @return \Closure */ protected function createCallbackToRunAfterCommits($listener, $method) { } /** * Remove a set of listeners from the dispatcher. * * @param string $event * @return void */ public function forget($event) { } /** * Forget all of the pushed listeners. * * @return void */ public function forgetPushed() { } /** * Resolve the transaction manager instance. * * @return \FluentCart\Framework\Database\DatabaseTransactionsManager */ protected function resolveTransactionManager() { } /** * * Set the transaction manager resolver. * * @param callable $resolver */ public function setTransactionManagerResolver(callable $resolver) { } } class NullDispatcher implements \FluentCart\Framework\Events\DispatcherInterface { use \FluentCart\Framework\Support\ForwardsCalls; /** * The underlying event dispatcher instance. * * @var \FluentCart\Framework\Events\DispatcherInterface */ protected $dispatcher; /** * Create a new event dispatcher instance that does not fire. * * @param \FluentCart\Framework\Events\DispatcherInterface $dispatcher * @return void */ public function __construct(\FluentCart\Framework\Events\DispatcherInterface $dispatcher) { } /** * Don't fire an event. * * @param string|object $event * @param mixed $payload * @param bool $halt * @return void */ public function dispatch($event, $payload = [], $halt = false) { } /** * Don't register an event and payload to be fired later. * * @param string $event * @param array $payload * @return void */ public function push($event, $payload = []) { } /** * Don't dispatch an event. * * @param string|object $event * @param mixed $payload * @return array|null */ public function until($event, $payload = []) { } /** * Register an event listener with the dispatcher. * * @param \Closure|string|array $events * @param \Closure|string|array|null $listener * @return void */ public function listen($events, $listener = null) { } /** * Determine if a given event has listeners. * * @param string $eventName * @return bool */ public function hasListeners($eventName) { } /** * Register an event subscriber with the dispatcher. * * @param object|string $subscriber * @return void */ public function subscribe($subscriber) { } /** * Flush a set of pushed events. * * @param string $event * @return void */ public function flush($event) { } /** * Remove a set of listeners from the dispatcher. * * @param string $event * @return void */ public function forget($event) { } /** * Forget all of the queued listeners. * * @return void */ public function forgetPushed() { } /** * Dynamically pass method calls to the underlying dispatcher. * * @param string $method * @param array $parameters * @return mixed */ public function __call($method, $parameters) { } } interface ShouldDispatchAfterCommit { //... } interface ShouldHandleEventsAfterCommit { //... } } namespace FluentCart\Framework\Foundation\Concerns { trait AjaxTrait { /** * Add ajax action * * @param string $action * @param string|\Closure $handler * @param int $priority * @param string $scope * @return void */ private function addAjaxAction($action, $handler, $priority, $scope) { } /** * Add ajax actions including non_prive * @param string $action * @param string|\Closure $handler * @param int $priority * @return void */ public function addAjaxActions($action, $handler, $priority = 10) { } /** * Add ajax action for privilaged user * @param string $action * @param string|\Closure $handler * @param int $priority * @return void */ public function addAdminAjaxAction($action, $handler, $priority = 10) { } /** * Add ajax action for non-privilaged user * @param string $action * @param string|\Closure $handler * @param int $priority * @return void */ public function addPublicAjaxAction($action, $handler, $priority = 10) { } } trait HooksRemovalTrait { /** * Remove filters/Actions * * @param string $action * @param string $class * @param string $method * @param integer $priority * @return bool */ public function removeFilter($action, $class = '', $method = '', $priority = 10) { } /** * Remove filters/Actions * * @param string $action * @param string $class * @param string $method * @param integer $priority * @return bool */ public function removeAction($action, $class = '', $method = '', $priority = 10) { } /** * Remove filters/Actions * * @param string $action * @param string $class * @param string $method * @param integer $priority * @return bool */ public function removeCustomFilter($action, $class = '', $method = '', $priority = 10) { } /** * Remove filters/Actions * * @param string $action * @param string $class * @param string $method * @param integer $priority * @return bool */ public function removeCustomAction($action, $class = '', $method = '', $priority = 10) { } /** * Remove filters/Actions * * @param string $action * @param string $class * @param string $method * @param integer $priority * @return bool */ private function removeHook($action, $class, $method, $priority) { } } trait FoundationTrait { use \FluentCart\Framework\Foundation\Concerns\AjaxTrait, \FluentCart\Framework\Foundation\Concerns\HooksRemovalTrait; /** * Check if wp debug mode is on. * * @return boolean */ public function isDebugOn() { } /** * Check whether multi-site or not. * * @return boolean */ public function isMultiSite() { } /** * Determine the environment. * * @return string */ public function env() { } /** * Get current namespace for the plugin. * * @return string */ public function getCurrentNamespace() { } /** * Make the custom hook name for the plugin. * @param string $prefix * @param string $hook * @return string */ public function hook($prefix, $hook) { } /** * Parse the handler for the rest request * @param string|\Closure $handler * @param string $ns * @return mixed */ public function parseRestHandler($handler, $ns = '') { } /** * Parse the policy handler * @param string|array $handler * @return mixed */ public function parsePolicyHandler($handler) { } /** * Register an action hook * @param string $action * @param mixed $handler * @param integer $priority * @param integer $numOfArgs */ public function addAction($action, $handler, $priority = 10, $numOfArgs = 1) { } /** * Register a custom action hook * @param string $action * @param mixed $handler * @param integer $priority * @param integer $numOfArgs */ public function addCustomAction($action, $handler, $priority = 10, $numOfArgs = 1) { } /** * Dispatch an action * @return null */ public function doAction() { } /** * Dispatch a custom action * @return null */ public function doCustomAction() { } /** * Register a filter hook * @param string $action * @param mixed $handler * @param integer $priority * @param integer $numOfArgs */ public function addFilter($action, $handler, $priority = 10, $numOfArgs = 1) { } /** * Register a custom filter hook * @param string $action * @param mixed $handler * @param integer $priority * @param integer $numOfArgs */ public function addCustomFilter($action, $handler, $priority = 10, $numOfArgs = 1) { } /** * Dispatc a filter * @return mixed */ public function applyFilters() { } /** * Dispatch a custom filter * @return mixed */ public function applyCustomFilters() { } /** * Checks if any action has been fired. * * @param string $action * @return int Number of times the action was fired */ public function didAction($action) { } /** * Checks if any action has been registered. * * @param string $action * @param mixed $callback * @return bool */ public function hasAction($action, $callback = false) { } /** * Checks if any custom action has been fired. * * @param string $action * @return int Number of times the action was fired */ public function didCustomAction($action) { } /** * Checks if any custom action has been registered. * * @param string $action * @param mixed $callback * @return bool */ public function hasCustomAction($action, $callback = false) { } /** * Checks if any action has been fired. * * @param string $action * @return int Number of times the action was fired */ public function didFilter($action) { } /** * Checks if any action has been registered. * * @param string $action * @param mixed $callback * @return bool */ public function hasFilter($action, $callback = false) { } /** * Checks if any custom action has been fired. * * @param string $action * @return int Number of times the action was fired */ public function didCustomFilter($action) { } /** * Checks if any custom action has been registered. * * @param string $action * @param mixed $callback * @return bool */ public function hasCustomFilter($action, $callback = false) { } /** * Register a short code * @param string $action * @param string|\Closure $handler * @return void */ public function addShortcode($action, $handler) { } /** * Execute a shortcode * @param mixed $content * @param boolean $ignore_html * @return mixed */ public function doShortcode($content, $ignore_html = false) { } /** * Parse a hookm handler * @param mixed $handler * @return mixed */ public function parseHookHandler($handler) { } /** * Chdeck if handler has FQCN. * * @param string|\Closure $handler * @return boolean */ public function hasNamespace($handler) { } /** * Resolve the namespace for a controller * @param string $handler * @return mixed */ public function getControllerNamespace($handler) { } /** * Resolve the namespace for a policy * @param string $handler * @return mixed */ public function getPolicyNamespace($handler) { } /** * Make an instance by the container * @param string $class * @return mixed */ public function makeInstance($class) { } /** * Retrieve the base url * @param string $url * @return string */ public function url($url = '') { } /** * Get the current authenticated user. * * Returns a WPUserProxy instance if the 'init' action has fired, * otherwise logs a warning in debug mode and returns null. * * @return mixed */ public function user() { } public function enableApplicationPassword() { } } } namespace FluentCart\Framework\Foundation { /** * Application — service container with magic property access via __get. * * Properties below are bound in {@see ComponentBinder::bindComponents()} and * {@see Application::init()}/{@see Application::setAppLevelNamespace()}. Each * `@property` declaration teaches PHPStan about a runtime container binding so * `$app->view->render(...)` and similar access can be type-checked. * * @property \FluentCart\Framework\Foundation\Config $config * @property \FluentCart\Framework\View\View $view * @property \FluentCart\Framework\Cache\Cache $cache * @property \FluentCart\Framework\Http\Router\Router $router * @property \FluentCart\Framework\Http\Request\Request $request * @property \FluentCart\Framework\Http\Response\Response $response * @property \FluentCart\Framework\Validator\Validator $validator * @property \FluentCart\Framework\Events\Dispatcher $events * @property \FluentCart\Framework\Encryption\Encrypter $encrypter * @property \FluentCart\Framework\Encryption\Encrypter $crypt * @property \FluentCart\Framework\Database\DatabaseManager $db * @property \FluentCart\Framework\Http\URL $url * @property \FluentCart\Framework\Support\Mail $mail * @property \FluentCart\Framework\Support\Pipeline $pipeline * @property string $__pluginfile__ * @property string $__namespace__ */ class Application extends \FluentCart\Framework\Container\Container { use \FluentCart\Framework\Foundation\Concerns\FoundationTrait; /** * Main plugin file's absolute path * * @var string */ protected $file = null; /** * Plugin's base url * * @var string */ protected $baseUrl = null; /** * Plugin's base path * * @var string */ protected $basePath = null; /** * Default namespace for hook's handlers * * @var string */ protected $handlerNamespace = null; /** * Default namespace for controllers * * @var string */ protected $controllerNamespace = null; /** * Default namespace for policy handlers * * @var string */ protected $policyNamespace = null; /** * Composer JSON * * @var null|array */ protected static $composer = null; /** * Ready event handlers * * @var array */ protected $onReady = []; /** * Flag to check if components are bound. * * @var boolean */ protected $componentsBound = false; /** * Construct the application instance * * @param string $file The main plugin file's absolute path * @return null */ public function __construct($file = null) { } /** * Init the application instance * * @param string $file The main plugin file's absolute path * * @return null */ protected function init($file) { } /** * Load the environment bariables from .env file. * * @param string $path * @return void */ protected function loadEnvironmentVars($path = null) { } /** * Set the default application level namespaces to resolve * the controllers, policies and various hook handlers. * * @return null */ protected function setAppLevelNamespace() { } /** * Get the composer data as an array * * @param string $section Specific key * * @return array partial or full composer data array */ public function getComposer($section = null) { } /** * Bootstrap the application. * * @return null */ protected function bootstrapApplication() { } /** * Bind application instance in the container. * * @return null */ protected function bindAppInstance() { } /** * Bind the paths and urls * * @return null */ protected function bindPathsAndUrls() { } /** * Bind urls * * @return null */ protected function bindUrls() { } /** * Bind paths * * @return null */ protected function basePaths() { } /** * Load application's config and set * the data in the Config instance. * * @return null */ protected function loadConfigIfExists() { } /** * Register the HTTP middleware stack as a lazy container binding. * * Resolves from `app/Http/middleware.php` (canonical). Falls back to * `config/middleware.php` so un-migrated plugins keep working. * * @return void */ protected function registerMiddleware() { } /** * Resolve the given type from the container. * This method is required for unit testing. * * @param string $abstract * @param array $parameters * @return mixed */ public function make($abstract, $parameters = []) { } /** * Register plugin's text domain * * @return null */ protected function registerTextdomain() { } /** * Resolve the text domain path. * * @return null */ protected function textDomainPath() { } /** * Bind the components of the framework into the container so * they'll be available throughout the application life cycle. * * @return null */ protected function bindCoreComponents() { } /** * Load (include) the files where hooks are registered. * * @param self $app * * @return null */ protected function requireCommonFiles($app) { } /** * Handler for rest_pre_serve_request filter. * * @param bool $served (default: false) * @param \WP_REST_Response $result * @param \WP_REST_Request $request * @param \WP_REST_Server $server * @return bool (false to intercept, otherwise true) */ public function preServeRequest($served, $result, $request, $server) { } /** * Determines whether the request is madse by plugin. * * @param string $route (Rest route|Full URL) * @param string $slug (Plugin's slug) * @return bool */ public function isRequestOfPlugin($route = '', $slug = '') { } /** * Determines if the request is made for endpoints. * * @param string $route (Rest route|Full URL) * @return bool */ protected function isRequestForEndpoints($route) { } /** * Prepare a custom not found response. * * @param \WP_REST_Response $result * @param \WP_REST_Request $request * * @return array */ public function customizeNotFoundResponse($result, $request) { } /** * Check if running unit test. * * @return boolean */ public function isUnitTesting() { } /** * Register the rest api init actions and routes * * @param self $app */ protected function addRestApiInitAction($app) { } /** * Register rest routes. * * @param \FluentCart\Framework\Http\Router $router * * @return void */ protected function registerRestRoutes($router) { } /** * Load (include) routes * * @param \FluentCart\Framework\Http\Router $router * @return null */ protected function requireRouteFile($router) { } /** * Register plugin ready (booted) callbacks. * * @param callable $callback * @return void */ public function ready(callable $callback) { } /** * Execute plugin booted callbacks. * * @return void */ protected function callPluginReadyCallbacks() { } } /** * @property \FluentCart\Framework\Foundation\Config $config */ class Async { /** * The dispatched handlers to stop recursion. * * @var array */ private $dispatched = []; /** * The application instance * * @var \FluentCart\Framework\Foundation\Application */ private static $app = null; /** * Self instance * * @var self */ private static $instance = null; /** * The array of async action handlers * * @var array */ private static $handlers = []; /** * The array of async action handlers in queue * * @var array */ private static $queue = ['default' => []]; /** * Creates the instance * * @return self */ public static function init($app = null) { } /** * Makes the async hook action name * * @return string */ public function makeAsyncHookAction() { } /** * Handles the incoming async request * * @return void */ public function handle() { } /** * Verify the request by checking the nonce. * * @param \FluentCart\Framework\Foundation\Application $app * @param array $data * @return void */ protected function verifyRequest($app, $data) { } /** * Resolve the action handler. * * @param array $action * @return array */ protected function resolveHandler($action) { } /** * Execute the action handler. * * @param \FluentCart\Framework\Foundation\Application $app * @param string $class * @param array $params * @return void */ protected function execute($app, $class, $params = []) { } /** * Add the async handler and register the shutdown handler * All the handlers will be dispatched in a separate request * * @param string $handler (Class@handler or with __invoke method) $handler * @return self * @throws \InvalidArgumentException */ public static function call($handler, array $params = []) { } /** * Queue an async handler to be executed during shutdown. * * Queued handlers are grouped by queue name and dispatched * together in a single async HTTP request. * * @param string $handler The handler 'Class@method'|invokable class. * @param array|string $params Array of args or the queue name if a string. * @param string $name The name of the queue (default is 'default'). * @return self * * @throws \InvalidArgumentException */ public static function queue($handler, $params = [], $name = 'default') { } /** * Sign the handler to mark as dispatched. * * @param array $handler * @return string */ protected static function sign($handler) { } /** * Validate the handler and add a sign to mark as dispatched. * * @param string $handler (Class@handler or with __invoke method) $handler * @return array * @throws \InvalidArgumentException */ public function validate($handler, $params, $sign) { } /** * Register the shutdown handler * * @return self */ protected function maybeRegisterShutDownHandler() { } /** * Dispatches the async request * * @return void */ public function dispatch() { } /** * Filter the handlers to be dispatched. * * @param array $stack * @return array|null */ protected function getDispatchables($stack) { } /** * Wrap with an array if necessary. Only used for separate * handlers because queued handlers will be an array of * associative arrays and we treat all the stacks same. * * @param array $handlers * @return array of array(s) */ protected function wrap($handlers) { } /** * Send the real async request * * @param array $handler * @return mixed */ public function sendAsyncRequest(array $handler) { } /** * Prepare the request body/POST data. * * @param string|array $handler * @return array */ protected function data($handler) { } /** * Build the request url. * * @return string */ protected function url() { } /** * Send the non-blocking request. * * @param string $url * @param array $body * @param array $headers * @return mixed */ protected function sendRequest($url, $body = [], $headers = []) { } /** * Get the cookie to send with the request * @return string Cookie string */ protected function getCookie() { } } } namespace FluentCart\Framework\Foundation\Concerns { trait DynamicFacadeTrait { /** * Register the dynamic facade resolver. * * Registers an SPL autoloader to intercept facade class requests within * the current namespace's Facade sub-namespace. Dynamically * creates facade classes on-demand. * * @param \FluentCart\Framework\Foundation\Application $app * @return void */ protected function registerFacadeResolver($app) { } /** * Resolve the binding name for the facade. * * Transforms the fully qualified facade class name to a service container * binding key (accessor) by stripping the facade namespace * and normalizing names. * * Special cases (e.g. 'route' to 'router') are handled here. * * @param string $facade Facade namespace prefix (e.g., FluentCart\Framework\Facade) * @param string $class Fully qualified facade class name * @param \FluentCart\Framework\Foundation\Application $app * @return string|null The resolved accessor name if bound in the container. */ protected function resolveFacadeAccessor($facade, $class, $app) { } /** * Create a facade resolver class dynamically. * * Generates a PHP facade class file under the uploads directory and loads it. * This enables real-time facade creation for any requested class. * * @param string $facade Facade namespace prefix * @param string $class Fully qualified class name of the facade to generate * @param \FluentCart\Framework\Foundation\Application $app * @return void * @throws \RuntimeException If the facade stub file is missing */ protected function createFacadeFor($facade, $class, $app) { } /** * Extract the namespace and base class name from a * fully qualified class name (FQCN). * * @param string $fqcn Fully qualified class name * @return array{string, string} Tuple of namespace and base class name */ protected function extractNamespaceAndClass($fqcn) { } /** * Get the directory path where facade classes are stored based on app.slug. * * @param string $slug Plugin slug used for folder naming inside uploads * @return string The absolute directory path where facade classes are saved */ protected function getFacadeDirectory($slug) { } /** * Ensure that the given directory exists; create it recursively if not. * * @param string $dir Directory path * @return void */ protected function ensureDirectoryExists($dir) { } /** * Get the full path for the generated facade PHP file based on class name. * * Converts namespace separators to underscores for safe file names. * * @param string $facadesDir Directory where facades are stored * @param string $class Fully qualified class name * @return string Full file path for the facade class file */ protected function getFacadeFilePath($facadesDir, $class) { } /** * Populate the facade stub template placeholders with real values. * * Replaces `{{ namespace }}`, `{{ $stub }}`, `{{ class }}` and * `{{ accessor }}` placeholders with corresponding values. * * @param string $namespace The namespace for the facade class * @param string $class The base class name for the facade class * @param string $accessor The accessor name returned by getFacadeAccessor() * @return string The populated PHP class code */ protected function populateFacadeStub($namespace, $class, $accessor) { } /** * Retrieve the content of the facade stub file. * * Throws a RuntimeException if the stub file is missing. * * @param string $stubPath Absolute path to the stub file * @return string The stub file content * @throws \RuntimeException If stub file does not exist */ protected function getFacadeStub($stubPath) { } /** * Load the generated facade class file if the class is not already loaded. * * @param string $class Fully qualified class name * @param string $facadeFile Absolute path to the generated facade PHP file * @return void */ protected function loadFacadeClass($class, $facadeFile) { } } } namespace FluentCart\Framework\Foundation { class ComponentBinder { use \FluentCart\Framework\Foundation\Concerns\DynamicFacadeTrait; /** * The application instance * @var \FluentCart\Framework\Foundation\Application */ protected $app = null; /** * List of bindings * @var array */ protected $bindables = ['Cache', 'Request', 'Response', 'Validator', 'View', 'Events', 'Encrypter', 'DB', 'URL', 'Router', 'Mail', 'Paginator', 'Pipeline', 'ExceptionHandler']; /** * Construct the binder * @param \FluentCart\Framework\Foundation\Application $app */ public function __construct($app) { } /** * Bind all the components in to the container. * @return null */ public function bindComponents() { } public function resolveDatabaseTransactionsManager() { } /** * Register resolving event into the container. * @param \FluentCart\Framework\Foundation\Application $app * @return null */ protected function registerResolvingEvent($app) { } /** * Bind the cache instance into the container. * @return null */ protected function bindCache() { } /** * Bind the request instance into the container. * @return null */ protected function bindRequest() { } /** * Bind the reesponse instance into the container. * @return null */ protected function bindResponse() { } /** * Get the binding method to bind a component. * In the testing environment, we use bind * method instead of singleton method. * * @param string $original * @return string */ protected function getBindingMethod($original) { } /** * Bind the request validator into the container. * @return null */ protected function bindValidator() { } /** * Bind the view instance into the container. * @return null */ protected function bindView() { } /** * Bind the event dispatcher instance into the container. * @return null */ protected function bindEvents() { } /** * Bind the encrypter instance into the container. * @return null */ protected function bindEncrypter() { } /** * Bind the db (query builder) instance into the container. * @return null */ protected function bindDB() { } /** * Bind the Url instance into the container. * @return null */ protected function bindUrl() { } /** * Bind the router instance into the container. * @return null */ protected function bindRouter() { } /** * Bind the mail instance into the container. * @return null */ protected function bindMail() { } /** * Bind the paginator instance into the container. * @return null */ protected function bindPaginator() { } /** * Bind the pipeline instance into the container. * @return null */ protected function bindPipeline() { } /** * Bind the exception-handler registry into the container. * * Default is the bare `Foundation\Exceptions\ExceptionHandler` (no * renderables registered). Plugins override by re-binding their own * subclass to the same key from `boot/bindings.php` BEFORE the first * request hits Route. * * @return null */ protected function bindExceptionHandler() { } /** * Load other bindings the developers might * have added in the application level. * * @param \FluentCart\Framework\Foundation\Application $app * @return null */ protected function extendBindings($app) { } /** * Load the plugin's global functions * @param \FluentCart\Framework\Foundation\Application $app * @return null */ protected function loadGlobalFunctions($app) { } /** * Adds new alias to maintain the backward compatibility. * * @param string $class * @return void */ protected function addBackwardCompatibleAlias($class) { } /** * Resolves the backward compatible alias. * * @param string $class * @return string New alias */ protected function getAlias($class) { } /** * Resolve the appropriate request instance. * * @param $app * @return \FluentCart\Framework\Http\Request\Request|object (Anonymous Class) */ protected function resolveRequest($app) { } /** * Check if the request is of the plugin. * * @return boolean */ protected function isRequestOfPlugin() { } } class Config { /** * Eagerly-set or lazily-loaded config data, keyed by top-level config name. * @var array */ protected $data = []; /** * Map of top-level key (e.g. 'i18n', 'app') → absolute file path. * Files are required on first access to their top-level key. Defers * any side-effecting code in config files (notably `__()` calls in * config/i18n.php) until consumers actually read them — which always * happens after `init`, so WP 6.7+'s `_doing_it_wrong` notice on * early textdomain load is no longer triggered by the framework. * * Eagerly-supplied $data still works (back-compat for tests / direct * construction without a file map). * * @var array */ protected $files = []; /** * Top-level keys whose backing file has been required. Tracks loaded * state separately from $data because a config file may legitimately * `return null` / `return []`, and we must not re-require those. * * @var array */ protected $loaded = []; /** * Construct the Config instance. * * @param array $data Eagerly-populated data (keyed by top-level name). * @param array $files Map of top-level name → file path for lazy load. */ public function __construct($data, $files = []) { } /** * Retrieve all config data. Force-loads every lazy file. * * @return array */ public function all() { } /** * Retrieve specific item from config array. * * @param string $key * @param mixed $default * @return mixed */ public function get($key = null, $default = null) { } /** * Get only specific items from the config array. * * @param string|array $key ($key1, $key2 or [$key1, $key2]) * @return array */ public function only($key) { } /** * Set an item into the config array on the fly. Forces the underlying * file to load first, so the write isn't clobbered by a later lazy load. * * @param string $key * @param mixed $value */ public function set($key, $value) { } /** * Lazy-load a config file the first time its top-level key is touched. * Idempotent: subsequent calls are no-ops. * * @param string $topKey * @return void */ protected function ensureLoaded($topKey) { } /** * Extract the top-level key from a dotted path. 'app.text_domain' → 'app'. * * @param string $key * @return string */ protected function topKey($key) { } /** * Resolve the config key, add `app.` prefix when the key is short and * not a known top-level config name (matches eagerly-loaded data OR a * deferred file). Without the file lookup, `get('i18n')` would resolve * to `app.i18n` before the i18n config file had been touched. * * @param string $key * @return string */ protected function resolveKey($key) { } } } namespace FluentCart\Framework\Foundation\Exceptions { /** * Base class for exceptions that represent an intentional, user-safe * HTTP response. Carries an HTTP status code, a machine-readable error * code, optional structured data, and optional response headers. * * Subclasses pin the status code (NotFoundHttpException = 404, etc.) so * call sites read as `throw new ForbiddenHttpException($why)` — the * status is implicit in the type. * * Route::callback() catches HttpException before its handleUnknownException * sanitizer, so the message and status reach the client verbatim. This is * the opt-in escape hatch from the production message sanitization that * protects against leaking PDO / file-system / transport internals. */ class HttpException extends \Exception { /** * HTTP status code to report. * * @var int */ protected $statusCode; /** * Machine-readable error code, stable across versions * (e.g. 'widgeteer_token_rejected') for frontend branching. * * @var string */ protected $errorCode; /** * Optional structured data emitted in the response body. * * @var array */ protected $data; /** * Optional response headers (e.g. Retry-After, WWW-Authenticate). * * @var array */ protected $headers; /** * @param int $statusCode * @param string $message * @param string $errorCode * @param array $data * @param array $headers * @param \Throwable|null $previous */ public function __construct($statusCode, $message = '', $errorCode = 'http_exception', array $data = [], array $headers = [], ?\Throwable $previous = null) { } /** * @return int */ public function getStatusCode() { } /** * @return string */ public function getErrorCode() { } /** * @return array */ public function getData() { } /** * @return array */ public function getHeaders() { } } /** * 502 Bad Gateway — an upstream service the plugin depends on returned * an unexpected response or could not be reached. */ class BadGatewayHttpException extends \FluentCart\Framework\Foundation\Exceptions\HttpException { /** * @param string $message * @param string $errorCode * @param array $data * @param array $headers * @param \Throwable|null $previous */ public function __construct($message = 'Bad Gateway', $errorCode = 'bad_gateway', array $data = [], array $headers = [], ?\Throwable $previous = null) { } } /** * 400 Bad Request — the request itself is malformed or missing required * inputs that the caller can fix and retry. */ class BadRequestHttpException extends \FluentCart\Framework\Foundation\Exceptions\HttpException { /** * @param string $message * @param string $errorCode * @param array $data * @param array $headers * @param \Throwable|null $previous */ public function __construct($message = 'Bad Request', $errorCode = 'bad_request', array $data = [], array $headers = [], ?\Throwable $previous = null) { } } /** * Pluggable exception renderer registry. * * Plugins extend this class, override `register()`, and map third-party / * domain exceptions to `HttpException` instances (or directly to a * `WP_REST_Response`). `Route::callback()` consults the bound handler * AFTER its own `HttpException` catch and BEFORE the production sanitizer. * Unmapped exceptions still fall through to `handleUnknownException` and * get their messages scrubbed — the registry is opt-in for "I've * authored a user-safe response for this exception class". * * Plugin example: * * namespace Acme\App\Hooks\Handlers; * * use FluentCart\Framework\Foundation\Exceptions\ExceptionHandler as BaseHandler; * use FluentCart\Framework\Foundation\Exceptions\ServiceUnavailableHttpException; * use FluentCart\Framework\Foundation\Exceptions\TooManyRequestsHttpException; * * class ExceptionHandler extends BaseHandler * { * public function register() * { * $this->renderable(\PDOException::class, function ($e, $app) { * return new ServiceUnavailableHttpException( * 'Database temporarily unavailable.', * 'db_unavailable' * ); * }); * * $this->renderable(\Acme\Domain\RateLimitException::class, * function ($e, $app) { * return new TooManyRequestsHttpException( * $e->getMessage(), * 'rate_limited', * [], * ['Retry-After' => (string) $e->retryAfter()] * ); * }); * } * } * * Plugins bind their subclass over the default during boot in * `boot/bindings.php`: * * $app->singleton( * \FluentCart\Framework\Foundation\Exceptions\ExceptionHandler::class, * \Acme\App\Hooks\Handlers\ExceptionHandler::class * ); * * Renderer return contract — closures may return any of: * - `HttpException` (rendered via `Route::renderHttpException()`) * - `WP_REST_Response` (returned to the client as-is) * - `null` (skip this entry; try the next match) * - any other value (treated as `null` — invalid return ignored) * * A renderer that throws is caught internally and treated as `null` — * a buggy renderer never crashes the request. * * Matching — `render()` walks the registry in **registration order** and * returns the first `instanceof` match. The conventional registration * order is therefore "specific classes first, broader classes last". The * framework default registers nothing; plugins fully control the * registry. Re-registering an existing class name overwrites the closure * but keeps its registration position. */ class ExceptionHandler { /** * Registered renderers, keyed by exception class name. Walked in * insertion order; PHP associative arrays preserve insertion order * and `$arr[$key] = $value` to an existing key updates in place. * * @var array */ protected $renderables = []; /** * Construct the handler. Calls `register()` so subclasses can declare * their renderables in one place without remembering to call it. */ public function __construct() { } /** * Override in a subclass to declare renderables. The base * implementation is a no-op so the framework default acts as a * bare registry plugins can add to. * * @return void */ public function register() { } /** * Map an exception class to a renderer closure. * * @param string $class * @param callable $renderer signature: function ($exception, $app) * @return $this * * @throws \InvalidArgumentException when `$class` is not a non-empty string */ public function renderable($class, callable $renderer) { } /** * Remove a previously-registered renderer. No-op if the class * wasn't registered. Useful for plugins that want to opt out of a * default registered by a parent handler. * * @param string $class * @return $this */ public function forget($class) { } /** * Consult the registry for a thrown exception. * * Walks `$renderables` in registration order. The first entry whose * key the exception is `instanceof` invokes its renderer. The * renderer may return an `HttpException`, a `WP_REST_Response`, or * `null` (to fall through to the next match). Any thrown exception * from the renderer is caught and treated as `null` so a buggy * renderer never crashes the request. * * @param \Throwable $e * @param mixed $app the framework App instance (or null in tests) * @return \FluentCart\Framework\Foundation\Exceptions\HttpException|\WP_REST_Response|null */ public function render(\Throwable $e, $app = null) { } /** * List the class names this handler has renderables registered for. * Useful for introspection, debugging, and AI tooling that wants to * know which exception types are mapped to safe responses. * * @return string[] */ public function registeredFor() { } /** * Whether the handler has a renderer registered for `$class`. Does * NOT walk the inheritance chain — exact key match only. Use this * for "is THIS specific class registered" checks; use `render()` * for "does any registration handle this exception". * * @param string $class * @return bool */ public function hasRenderable($class) { } } /** * 403 Forbidden — the request is authenticated but the caller is not * permitted to perform the action. */ class ForbiddenHttpException extends \FluentCart\Framework\Foundation\Exceptions\HttpException { /** * @param string $message * @param string $errorCode * @param array $data * @param array $headers * @param \Throwable|null $previous */ public function __construct($message = 'Forbidden', $errorCode = 'forbidden', array $data = [], array $headers = [], ?\Throwable $previous = null) { } } /** * 404 Not Found — the requested resource does not exist. * * Note: ORM lookups continue to use FluentCart\Framework\Database\Orm\ModelNotFoundException * which has its own dedicated catch in Route::callback(). Use this class for * non-ORM 404s (custom lookups, file-not-found surfaced to the client, etc.). */ class NotFoundHttpException extends \FluentCart\Framework\Foundation\Exceptions\HttpException { /** * @param string $message * @param string $errorCode * @param array $data * @param array $headers * @param \Throwable|null $previous */ public function __construct($message = 'Not Found', $errorCode = 'not_found', array $data = [], array $headers = [], ?\Throwable $previous = null) { } } /** * 503 Service Unavailable — the plugin is intentionally unavailable * (maintenance, missing configuration, dependency down). * * Often paired with a Retry-After header. */ class ServiceUnavailableHttpException extends \FluentCart\Framework\Foundation\Exceptions\HttpException { /** * @param string $message * @param string $errorCode * @param array $data * @param array $headers * @param \Throwable|null $previous */ public function __construct($message = 'Service Unavailable', $errorCode = 'service_unavailable', array $data = [], array $headers = [], ?\Throwable $previous = null) { } } /** * 429 Too Many Requests — the caller has exceeded a rate limit. * * Typically paired with a Retry-After header. Example: * * throw new TooManyRequestsHttpException( * 'Slow down.', 'rate_limited', [], ['Retry-After' => 60] * ); */ class TooManyRequestsHttpException extends \FluentCart\Framework\Foundation\Exceptions\HttpException { /** * @param string $message * @param string $errorCode * @param array $data * @param array $headers * @param \Throwable|null $previous */ public function __construct($message = 'Too Many Requests', $errorCode = 'too_many_requests', array $data = [], array $headers = [], ?\Throwable $previous = null) { } } /** * 401 Unauthorized — the request lacks valid authentication credentials. * * Pair with a WWW-Authenticate header when appropriate by passing it * via the $headers argument. */ class UnauthorizedHttpException extends \FluentCart\Framework\Foundation\Exceptions\HttpException { /** * @param string $message * @param string $errorCode * @param array $data * @param array $headers * @param \Throwable|null $previous */ public function __construct($message = 'Unauthorized', $errorCode = 'unauthorized', array $data = [], array $headers = [], ?\Throwable $previous = null) { } } /** * 422 Unprocessable Entity — the request is syntactically valid but * semantically rejected (business-rule violation, etc.). * * For framework validation failures, the existing * FluentCart\Framework\Validator\ValidationException retains its dedicated catch in * Route::callback(). Use this class for application-level semantic errors. */ class UnprocessableEntityHttpException extends \FluentCart\Framework\Foundation\Exceptions\HttpException { /** * @param string $message * @param string $errorCode * @param array $data * @param array $headers * @param \Throwable|null $previous */ public function __construct($message = 'Unprocessable Entity', $errorCode = 'unprocessable_entity', array $data = [], array $headers = [], ?\Throwable $previous = null) { } } } namespace FluentCart\Framework\Foundation { /** * @deprecated 2.12.0 Use \FluentCart\Framework\Foundation\Exceptions\ForbiddenHttpException * instead. This shim remains so existing throw/catch sites keep * working; it produces the same 403 response via Route.php's * HttpException branch. */ class ForbiddenException extends \FluentCart\Framework\Foundation\Exceptions\ForbiddenHttpException { // } /** * @deprecated 2.12.0 Use \FluentCart\Framework\Foundation\Exceptions\UnauthorizedHttpException * instead. This shim retains the non-PSR class name (note the * second capital A) so existing throw/catch sites keep working; * it produces the same 401 response via Route.php's HttpException * branch. */ class UnAuthorizedException extends \FluentCart\Framework\Foundation\Exceptions\UnauthorizedHttpException { // } /** * Exception Class. */ class WPException extends \Exception { /** * Http code * @var integer */ protected $code = 400; /** * Exception message. * @var string */ protected $message = ''; /** * Error messages * @var array */ protected $errorData = []; /** * WPError object * @var \WP_Error */ protected $wpError = null; /** * Construct the WPException instance * @param \WP_Error $wpError */ public function __construct(\WP_Error $wpError) { } /** * Get the error messages * @return array */ public function errors() { } /** * Retrive the full formatted error messages. * @return array */ protected function toArray() { } } } namespace FluentCart\Framework\Http { /** * Register AJAX handlers using HTTP-like method names. * * $action should start with config.app.hook_prefix, * e.g. `wpfluent_my_action`. * * The $handler can be a callable or "Class@method" string. * These dynamic methods delegate to the register() method. * * @method $this get(string $action, callable|string $handler, int|string|array $priority = 10, string $scope = "both") * @method $this post(string $action, callable|string $handler, int|string|array $priority = 10, string $scope = "both") * @method $this put(string $action, callable|string $handler, int|string|array $priority = 10, string $scope = "both") * @method $this patch(string $action, callable|string $handler, int|string|array $priority = 10, string $scope = "both") * @method $this delete(string $action, callable|string $handler, int|string|array $priority = 10, string $scope = "both") * * @method static get(string $action, callable|string $handler, int|string|array $priority = 10, string $scope = "both") * @method static post(string $action, callable|string $handler, int|string|array $priority = 10, string $scope = "both") * @method static put(string $action, callable|string $handler, int|string|array $priority = 10, string $scope = "both") * @method static patch(string $action, callable|string $handler, int|string|array $priority = 10, string $scope = "both") * @method static delete(string $action, callable|string $handler, int|string|array $priority = 10, string $scope = "both") * * Usage Examples: * * Ajax::post('action', 'MyController@handle'); // priority 10, admin & public * Ajax::post('action', 'MyController@handle', 5); // priority 5, admin & public * Ajax::post('action', 'MyController@handle', 'admin'); // priority 10, admin * Ajax::post('action', 'MyController@handle', 5, 'public'); // priority 5, public * * Ajax::post('action', 'MyController@handle', [ * 'priority' => 5, * 'scope' => 'public' * ]); */ class Ajax { /** * @var \FluentCart\Framework\Foundation\Application */ protected $app = null; /** * $passthru allowed methods * @var array */ protected $passthru = ['get', 'post', 'put', 'patch', 'delete']; /** * Consruct the Instance. * * @param \FluentCart\Framework\Foundation\Application $app */ public function __construct($app = null) { } /** * Alternative constructor. * * @return $this */ public static function getInstance() { } /** * Register the ajax hook using appropriate method. * * @param string $method * @param string $action * @param callable|string $handler * @param integer $priority * @param string $scope * @return void */ public function register($method, $action, $handler, $priority = 10, $scope = 'both') { } /** * Handle an AJAX request. * * @param string $method * @param mixed $handler * @return mixed */ public function handle($method, $handler) { } /** * Overload magic method. * * @param string $method * @param array $args * @return void */ public function __call($method, $args) { } /** * Overload static magic method. * * @param string $method * @param array $args * @return void */ public static function __callStatic($method, $args) { } } /** * @method mixed get(string $url, array $params = []) Send a GET request. * @method mixed post(string $url, array $params = []) Send a POST request. * @method mixed put(string $url, array $params = []) Send a PUT request. * @method mixed patch(string $url, array $params = []) Send a PATCH request. * @method mixed delete(string $url, array $params = []) Send a DELETE request. * @method mixed head(string $url, array $params = []) Send a HEAD request. * @method mixed options(string $url, array $params = []) Send an OPTIONS request. * @method File download(string|File $url) Download a remote file. * @method mixed upload(string $url, string $path, array $fields = [], string $name = 'file') Upload a file to a remote server. */ /** * Some examples: * * // Using an instance: * $client = Client::make('https://example.com'); * * $response1 = $client->get('/users'); * $response2 = $client->post('/users', ['body' => ['name' => 'Heera']]); * $response3 = $client->put('/users/1', ['body' => ['name' => 'Updated']]); * $response4 = $client->patch('/users/1', [ * 'body' => ['email' => 'updated@example.com']] * ); * $response5 = $client->delete('/users/1'); * $response6 = $client->head('/users'); * $response7 = $client->options('/users'); * * // Using statically (default base URL is empty): * $response8 = Client::get('https://example.com/users'); * $response9 = Client::post('https://example.com/users', [ * 'body' => ['name' => 'Static']] * ); */ class Client { /** * Base URl for the request. * * @var string */ protected $baseUrl = ''; /** * Cookies to send with the request. * * @var array */ protected $cookies = []; /** * Headers to send with the request. * * @var array */ protected $headers = []; /** * Options to set for the request. * * @var array */ protected $options = []; /** * Request body|Data|params to set in the request. * * @var array */ protected $body = []; /** * Request query params to pass with the url. * * @var array */ protected $query = []; /** * Whether to reject unsafe URLs via wp_safe_remote_request. * When true, dispatch() uses wp_safe_remote_request() instead of * wp_remote_request(), which runs the URL through wp_http_validate_url() * and refuses loopback addresses, private IP ranges, and non-standard * ports. Off by default for backwards compatibility with internal calls. * * @var bool */ protected $useSafeRemote = false; /** * Stores args temporarily for then(). * * @var null|array */ private $args = null; /** * Create a new HTTP client. * * @param string $baseUrl * @param array $args */ public function __construct($baseUrl = '', $args = []) { } /** * Create a new HTTP client. * * @param string $baseUrl * @param array $args */ public static function make($baseUrl = '', $args = []) { } /** * Sets one or more options. * * @return self */ public function withOption($key, $value = null) { } /** * Sets the blocking option to false (non-blocking). * * @return self */ public function async() { } /** * Sets the sslverify option. * * @return self */ public function secure($verify = true) { } /** * Route dispatch through wp_safe_remote_request() instead of * wp_remote_request() — mirrors WordPress's wp_safe_remote_* family. * * Runs the URL through wp_http_validate_url() first, which refuses * loopback addresses, private IP ranges, and non-standard ports. Use * when the target URL is user/admin-configurable and you need SSRF * protection. Standard external HTTPS endpoints on ports 80/443/8080 * are unaffected. * * @param bool $enabled * @return self */ public function safe($enabled = true) { } /** * Sets one or more headers. * * @return self */ public function withHeader($key, $value = null) { } /** * Sets one or more headers. * * @param array $headers * @return self */ public function withHeaders(array $headers) { } /** * Sets the Authorization header. * * @param string $token * @param string $type * @return self */ public function withToken($token, $type = 'Bearer') { } /** * Sets one or more cookies. * * @return self */ public function withCookie($key, $value = null) { } /** * Sets one or more request body param. * * @return self */ public function withData($key, $value = null) { } /** * Sets one or more request body param. * * @return self */ public function withBody($key, $value = null) { } /** * Sets one or more request body param. * * @return self */ public function withParam($key, $value = null) { } /** * Sets one or more request body param. * * @return self */ public function withQuery($key, $value = null) { } /** * Allows users to enable streaming on their requests. * * @return self */ public function withStreaming($callback = null) { } /** * Build the request arguments. * * @param array $params * @param string $method * @return array */ protected function buildRequestArgs($params, $method) { } /** * Send the request. * * @param string $url * @param array $args * @return \FluentCart\Framework\Http\Response */ protected function request($url, $args = []) { } /** * Build the URL. * * @param string $url * @return string */ protected function resolveUrl($url) { } /** * Filter the args before sending the request. * * @param array $args * @return array */ protected function filterArgs($args) { } /** * Encode the body if Content-Type is JSON. * * @param array $params * @return bool */ protected function shouldBeJson($params) { } /** * Dispatch the request. * * @param string $url * @param array $args * @return array (response) */ protected function dispatch($url, $args) { } /** * Merge the coolkies (useful for stateful request). * * @return void */ protected function mergeCookies($response) { } /** * Check if the stream is enabled. * @return boolean */ protected function isStreamEnabled($args) { } /** * Build a response object from an anonymous class. * * @param array $response * @return \FluentCart\Framework\Http\Response */ protected function makeResponse($response) { } /** * Handle the streaming response and process chunks. * * @param array $response * @return \FluentCart\Framework\Http\Response|null */ protected function makeStreamResponse($response) { } /** * Download a remote file. * * @param string $url * @return \FluentCart\Framework\Http\Request\File * @throws \Exception */ public function downloadFile($url) { } /** * Upload a file to a remote server. * * @param string $url * @param string $path * @param array $fields * @param string $name * @return \FluentCart\Framework\Http\Response */ public function uploadFile($url, $path, $fields = [], $name = 'file') { } protected function checkIfValidHttpMethod($method) { } /** * Handles the dynamic calls. * * @param string $method * @param array $args * @return mixed */ public function __call($method, $args) { } /** * Handle the static dynamic calls. * * @param string $method * @param array $args * @return self */ public static function __callStatic($method, $args) { } } class Cookie { /** * Cookie queue * * @var array */ protected static $queue = []; /** * Action registered indicator. * * @var bool */ protected static $actionRegistered = false; /** * Set a cookie immediately. * * @param string $name * @param mixed $value * @param int|\DateTimeInterface $minutes * @param string $path * @param string $domain * @param bool $secure * @param bool $httponly * @param string $samesite * * @return void */ public static function set($name, $value, $minutes = 0, $path = '/', $domain = '', $secure = false, $httponly = false, $samesite = 'Lax') { } /** * Set a cookie whose value is base64(json($value)). * * Pairs with Request::cookie(), which auto-detects this exact format * and decodes back to the original value on read. Use this when you * need to store arrays/objects in a cookie — strings, numbers, and * scalars work just fine through plain set() and don't need encoding. * * @param string $name * @param mixed $value Anything json_encode can serialize * @param int|\DateTimeInterface $minutes * @param string $path * @param string $domain * @param bool $secure * @param bool $httponly * @param string $samesite * * @return void */ public static function setEncoded($name, $value, $minutes = 0, $path = '/', $domain = '', $secure = false, $httponly = false, $samesite = 'Lax') { } /** * Queue a cookie whose value is base64(json($value)) for send_headers. * * Same encoding contract as setEncoded() — pairs with Request::cookie() * auto-decode on the read side. * * @param string $name * @param mixed $value * @param int|\DateTimeInterface $minutes * @param string $path * @param string $domain * @param bool $secure * @param bool $httponly * @param string $samesite * * @return void */ public static function queueEncoded($name, $value, $minutes = 0, $path = '/', $domain = '', $secure = false, $httponly = false, $samesite = 'Lax') { } /** * Set a cookie that lasts 5 years. * * @param string $name * @param mixed $value * @param string $path = '/' * @param string $domain * @param bool $secure * @param bool $httponly * @param string $samesite * * @return void */ public static function setForever($name, $value, $path = '/', $domain = '', $secure = false, $httponly = false, $samesite = 'Lax') { } /** * Queue a cookie to be sent with headers. * * @param string $name * @param mixed $value * @param int|\DateTimeInterface $minutes * @param string $path * @param string $domain * @param bool $secure * @param bool $httponly * @param string $samesite * * @return void */ public static function queue($name, $value, $minutes = 0, $path = '/', $domain = '', $secure = false, $httponly = false, $samesite = 'Lax') { } /** * Handle WordPress's send_headers action. * * @param mixed $wp * * @return void */ public static function sendHeaders($wp) { } /** * Get a cookie value. * * @param string $name * @param mixed $default * * @return mixed */ public static function get($name, $default = null) { } /** * Delete a cookie. * * @param string $name * @param string $path * @param string $domain * @param string $samesite * * @return void */ public static function delete($name, $path = '/', $domain = '', $samesite = 'Lax') { } /** * Create a cookie array for setcookie(). * * @param string $name * @param mixed $value * @param int|\DateTimeInterface $minutes * @param string $path * @param string $domain * @param bool $secure * @param bool $httponly * @param string $samesite * * @return array */ public static function make($name, $value, $minutes = 0, $path = '/', $domain = '', $secure = false, $httponly = false, $samesite = 'Lax') { } /** * Convert minutes to expiration timestamp. * * @param int|\DateTimeInterface $minutes * * @return int * * @throws \InvalidArgumentException */ protected static function expiresAt($minutes = 0) { } /** * Register the send_headers action if not already registered. * * @return void */ protected static function maybeAddSendHeadersAction() { } /** * Set cookie in Response when in rest context. * * @param array $cookie */ protected static function setCookieInResponse($cookie) { } } class Group { protected $router = null; protected $callback = null; public function __construct($router, $callback) { } public function __call($method, $params) { } public function __destruct() { } } } namespace FluentCart\Framework\Http\Middleware { /** * Class RateLimiter * * Handles per-IP and per-endpoint rate limiting for REST requests. * * Features: * - IP + endpoint aware * - Retry-After header for 429 responses * - X-RateLimit-Limit and X-RateLimit-Remaining headers * - Optional bypass for admin users * - Transient-based storage, safe for PHP 7.4+ */ class RateLimiter { /** * Maximum requests allowed per interval. * * @var int */ protected $limit; /** * Interval in seconds for rate limiting. * * @var int */ protected $interval; /** * Constructor. * * @param int $limit * @param int $interval */ public function __construct($limit, $interval) { } /** * Handle incoming request. * * @param \FluentCart\Framework\Http\Request\Request $request * @param callable $next * @return mixed */ public function handle($request, $next) { } /** * Determine if request should bypass rate limiting. * * @param \FluentCart\Framework\Http\Request\Request $request * @return bool */ protected function shouldAllow($request) { } /** * Check if user is authenticated in admin (optional bypass). * * @return bool */ protected function isCookieAuthenticated() { } /** * Get current rate limit settings from transient. * * @param \FluentCart\Framework\Http\Request\Request $request * @param int $currentTime * @return array */ protected function getSettings($request, $currentTime) { } /** * Check if interval expired. * * @param array $settings * @param int $currentTime * @return bool */ protected function isIntervalExpired($settings, $currentTime) { } /** * Reset rate limit for a new interval. * * @param int $currentTime * @return array */ protected function resetRateLimit($currentTime) { } /** * Check if limit exceeded. * * @param array $settings * @return bool */ protected function isRateLimitExceeded($settings) { } /** * Update transient with proper TTL. * * @param \FluentCart\Framework\Http\Request\Request $request * @param array $settings * @param int $currentTime */ protected function updateSettings($request, $settings, $currentTime) { } /** * Generate a unique transient key per IP + endpoint. * * @param \FluentCart\Framework\Http\Request\Request $request * @return string */ protected function makeTransientKey($request) { } } } namespace FluentCart\Framework\Validator\Contracts { interface File { /** * Returns whether the file was uploaded successfully. * * @return bool */ public function isValid(); /** * Gets the path without filename * * @return string */ public function getPath(); /** * Take an educated guess of the file's extension. * * @return mixed|null */ public function guessExtension(); /** * Returns the original file extension. * * @return string */ public function getClientOriginalExtension(); } } namespace FluentCart\Framework\Http\Request { class File extends \SplFileInfo implements \FluentCart\Framework\Validator\Contracts\File, \JsonSerializable, \ArrayAccess { /** * Original file name. * * @var string $originalName */ private $originalName; /** * Mime type of the file. * * @var string $mimeType */ private $mimeType; /** * File size in bytes. * * @var int|null $size */ private $size; /** * File upload error. * * @var int $error */ private $error; /** * HTTP File instantiator. * * @param $path * @param $originalName * @param null $mimeType * @param null $size * @param null $error */ public function __construct($path, $originalName, $mimeType = null, $size = null, $error = null) { } /** * Init the file object with size and error. * * @param string $path * @param int|null $size * @param string|null $error * @return void */ protected function init($path, $size, $error) { } /** * @taken from \Symfony\Component\HttpFoundation\File\File * * Returns locale independent base name of the given path. * * @param string $name The new file name * * @return string containing */ public function getName($name) { } public function getFileMimeType($mimeType) { } /** * Get the file upload error. * * @return int */ public function getError() { } /** * Returns whether the file was uploaded successfully. * * @return bool True if the file has been uploaded with HTTP and no error occurred */ public function isValid() { } /** * Returns the original file name. * * @return string The Name Of the file */ public function getClientOriginalName() { } /** * Returns the original file extension. * * It is extracted from the original file name that was uploaded. * Then it should not be considered as a safe value. * * @return string The extension */ public function getClientOriginalExtension() { } /** * Take an educated guess of the file's extension. * * @return mixed|null */ public function guessExtension() { } /** * Take an educated guess of the file's mime type. * * @return string */ public function getMimeType() { } /** * Take an educated guess of the file's mime type and ext * based on the WordsPress' get_allowed_mime_types. * * @return array * @see https://developer.wordpress.org/reference/functions/get_allowed_mime_types * @see https://developer.wordpress.org/reference/functions/wp_get_mime_types */ public function getMimeTypeAndExtension() { } /** * Get the file name. * * @return string */ public function getSavedFileName() { } /** * Get the url from path. * * @return string */ public function getUrl() { } /** * Returns the contents of the file. * * @return string the contents of the file * * @throws \RuntimeException */ public function getContents() { } /** * Move the file to a new location. * * @param string $directory Target Path * @param string $name Target file name (optional) * @return self * @throws \RuntimeException */ public function move($directory, $name = null) { } /** * Save the uploaded file. * * @param string $path * @return self (File Object) * @throws \RuntimeException */ public function save($path = null) { } /** * Save the uploaded file with a given name. * * @param string $name * @param string $path * @return self (File Object) * @throws \RuntimeException */ public function saveAs($name, $path = null) { } /** * Check that the given path exists. * * @param string $path * @return string * @throws \RuntimeException */ protected function resolveTargetPath($path) { } /** * Check if given path is absolute. * * @param string $path * @return boolean */ function isAbsolutePath($path) { } /** * Get the URL from the file path. * * @param string $path * @return string */ public function url($path = '') { } /** * Get the target file name to move (full path). * * @param string $directory Target Path * @param string $name Target file name (optional) * @return string * @throws \RuntimeException */ protected function getTargetFile($directory, $name = null) { } /** * Resolves the absolute path for saving. * * @param string $dir * @param string $name * @return string */ protected function makeTargetPath($dir, $name) { } /** * Resolves the file name for saving. * * @param string|null $name * @return string */ protected function resolveFileName($name = null) { } /** * Retrieve the extension of the uploaded file. * * @return string */ public function extension() { } /** * Get the temporary file path. * * @return string */ public function path() { } /** * Check if the given filename has an extension. * * @param string $filename * @return boolean */ protected function hasExtension($filename) { } /** * Get original HTTP file array * * @return array */ public function toArray() { } /** * JsonSerialize implementation * @return array */ #[\ReturnTypeWillChange] public function jsonSerialize() { } /* ArrayAccess methods */ /** * Check if the property exists. * @param string $offset * @return bool */ #[\ReturnTypeWillChange] public function offsetExists($offset) { } /** * Get the property. * * @param string $offset * @return string */ #[\ReturnTypeWillChange] public function offsetGet($offset) { } #[\ReturnTypeWillChange] public function offsetSet($offset, $value) { } #[\ReturnTypeWillChange] public function offsetUnset($offset) { } } trait InputHelperMethodsTrait { /** * Get an item from the request filtering by the callback(s). * * @param string|array|null $key * @param callable|array|string|null $callback * @param mixed $default * @return mixed */ public function getSafe($key, $callback = null, $default = null) { } protected function sanitizeByType($value) { } /** * Pick only the given keys from data. * * @param array $keys * @param array $allData * @return array */ public function pickKeys($keys, $allData, $default = null) { } /** * Returns a sanitized integer. * * @param string $key * @param string $default * @return int */ public function getInt($key, $default = null) { } /** * Retrieve input as a float value. * * @param string|null $key * @param float $default * @return float */ public function getFloat($key, $default = null) { } /** * Returns a sanitized string. * * @param string $key * @param string $default * @return string */ public function getText($key, $default = null) { } /** * Returns a string as title. * * @param string $key * @param string $default * @return string */ public function getTitle($key, $default = null) { } /** * Returns sanitized email. * * @param string $key * @param string $default * @return string */ public function getEmail($key, $default = null) { } /** * Returns boolean value. * * @param string $key * @param string $default * @return bool|null TRUE for "1", "true", "on", "yes"; FALSE for "0", "false", "off", "no"; NULL otherwise */ public function getBool($key, $default = null) { } /** * Returns a DateTime object. * * @param string $key * @param string|null $format * @param string|null $tz * @return \FluentCart\Framework\Support\DateTime|null */ public function getDate($key, $format = null, $tz = null) { } } trait InteractsWithCleaningTrait { /** * Clean up the request data. * * @param array $data * @return array */ public function clean($data) { } /** * Clean the data in the given array. * * @param array $data * @return array */ protected function cleanArray(array $data) { } /** * Clean the given value. * * @param mixed $value * @return mixed */ protected function cleanValue($value) { } /** * Transform the given value. * * @param mixed $value * @return mixed */ protected function transform($value) { } } trait InteractsWithFilesTrait { /** * Processed $_FILES array * @var array */ protected $files = []; /** * Prepares HTTP files for Request * * @param array $files * * @return array */ public function prepareFiles($files = []) { } /** * @taken from \Symfony\Component\HttpFoundation\FileBag * * Converts uploaded files to UploadedFile instances. * * @param array|\FluentCart\Framework\Http\Request\File $file A (multi-dimensional) array of uploaded file information * * @return \FluentCart\Framework\Http\Request\File[]|\FluentCart\Framework\Http\Request\File|null A (multi-dimensional) array of File instances */ protected function convertFileInformation($file) { } /** * @taken from \Symfony\Component\HttpFoundation\FileBag * * Fixes a malformed PHP $_FILES array. * * PHP has a bug that the format of the $_FILES array differs, depending on * whether the uploaded file fields had normal field names or array-like * field names ("normal" vs. "parent[child]"). * * This method fixes the array to look like the "normal" $_FILES array. * * It's safe to pass an already converted array, in which case this method * just returns the original array unmodified. * * @return array */ protected function fixPhpFilesArray($data) { } /** * Retrieve a file from the request. * * @param string|null $key * @param mixed $default * @return \FluentCart\Framework\Http\Request\File|array|null */ public function file($key = null, $default = null) { } /** * Get the files array from the request. * * @return array */ public function files($key = null) { } /** * Get the files as collection from the request. * * @return array */ public function fileCollection($key = null) { } /** * Add a save method on the runtime. * * @param \FluentCart\Framework\Support\Collection &$files * @return void */ protected function addSaveMethod(\FluentCart\Framework\Support\Collection &$files) { } /** * Determine if the request contains a valid uploaded file for the given key. * * @param string $key * @return bool */ public function hasFile($key) { } /** * Alias for hasFile(). * * @param string $key * @return bool */ public function isValidFile($key) { } } trait InteractsWithHeadersTrait { /** * Retrieve an item from the PHP headers * @param string $key * @param string $default * @return mixed */ public function header($key = null, $default = null) { } /** * Sets the headers for the request. * * Note: Taken from Symfony and modified. */ public function setHeaders() { } /** * Set a header on the request. * * @param string $key * @param string $value */ public function setHeader($key, $value) { } } /** * Trait InteractsWithIPTrait * * Resolves the real client IP address securely. * * SECURITY: * - By default, NO proxies are trusted. * - Forwarded headers are only trusted if REMOTE_ADDR belongs to a trusted proxy. * - Safe for normal hosting, Cloudflare (configured), and explicit proxy setups. * * EXTENSIBILITY: * - Developers can add trusted proxies using the 'trusted_proxies' filter. */ trait InteractsWithIPTrait { /** * Cached resolved IP for the current request. * * Instance property (not static) so each Request instance gets its own * cache. This is equivalent in production (one instance per HTTP request) * but avoids cross-request contamination in tests where multiple dispatches * share the same PHP process. * * @var string|null */ protected $resolvedIp = null; /** * Get client IP. * * @param bool $anonymize Return anonymized IP if true. * @return string */ public function getIp($anonymize = false) { } /** * Resolve the real client IP. * * @return string */ protected function resolveIp() { } /** * Determine if REMOTE_ADDR belongs to a trusted proxy. * * @param string $ip * @return bool */ protected function isTrustedProxy($ip) { } /** * Get an array of trusted proxy CIDR ranges. * * Reads from config/trustedproxy.php (proxies key) by default. * Can be overridden or extended using the filter: * add_filter('trusted_proxies', fn($proxies) => [...$proxies, '10.0.0.1']); * * @return array */ protected function getTrustedProxies() { } /** * Validate IPv4 or IPv6 address. * * @param string $ip * @return bool */ protected function isValidIp($ip) { } /** * Sanitize server values (WordPress compatible). * * @param string $value * @return string */ protected function sanitize($value) { } /** * Check if an IPv4 address is within a CIDR range. * * @param string $ip IP address to check (e.g., "173.245.50.10") * @param string $cidr CIDR range (e.g., "173.245.48.0/20") * @return bool True if IP is inside the range, false otherwise */ protected function ipInRange($ip, $cidr) { } } class Request { use \FluentCart\Framework\Http\Request\InteractsWithCleaningTrait, \FluentCart\Framework\Http\Request\InteractsWithHeadersTrait, \FluentCart\Framework\Http\Request\InputHelperMethodsTrait, \FluentCart\Framework\Http\Request\InteractsWithFilesTrait, \FluentCart\Framework\Http\Request\InteractsWithIPTrait, \FluentCart\Framework\Support\MacroableTrait { __call as macroCall; } /** * The application instance * @var \FluentCart\Framework\Foundation\Application */ protected $app = null; /** * Validator instance. * * @var \FluentCart\Framework\Validator\Validator */ protected $validator = null; /** * PHP header variables * @var array */ protected $headers = []; /** * PHP server variables * @var array */ protected $server = []; /** * PHP cookie variables * @var array */ protected $cookie = []; /** * The content of the request * @var mixed */ protected $content = null; /** * The JSON payload of the request * @var array */ protected $json = []; /** * PHP $_GET Superglobal * @var array */ protected $get = []; /** * PHP $_POST Superglobal * @var array */ protected $post = []; /** * PHP $_GET and $_POST Superglobals * @var array */ protected $request = []; /** * WP_REST_Request instance * @var \WP_REST_Request */ protected $wpRestRequest = false; /** * Validated data after validation has been passed * @var array */ protected $validated = []; /** * $safe Determines the input source when data retrieval methods get called. * If true, the data will be returned from the $validated array. * If false, the data will be returned from the $request array. * * @var boolean */ protected $safe = false; /** * Construct the request instance * @param \FluentCart\Framework\Foundation\Application $app * @param $_GET $get * @param $_POST $post */ public function __construct(\FluentCart\Framework\Foundation\Application $app, $get, $post) { } /** * Variable exists * @param string $key * @return bool */ public function exists($key) { } /** * Variable exists and has truthy value * @param string $key * @return bool */ public function has($key) { } /** * Any variable exists and has truthy value * @param array|string $keys * @return bool */ public function hasAny($keys) { } /** * Calls a callback if has value, otherwise * calls another/second callback if given. * * @param string $key * @param \Closure $has * @param \Closure|null $hasnot * @return mixed */ public function whenHas($key, \Closure $has, ?\Closure $hasnot = null) { } /** * Checks if a key is missing in the request. * * @param string $key * @return bool */ public function missing($key) { } /** * Calls the given callback if the provided key is missing. * * @param string $key * @param \Closure $callback * @return mixed */ public function whenMissing($key, \Closure $callback) { } /** * Set an item into the request inputs * @param string $key * @param mixed $value * @return self */ public function set($key, $value) { } /** * Retrive all the items from the request inputs * @return array */ public function all() { } /** * Retrieve an item from the request inputs * @param string|null $key * @param mixed $default * @return mixed */ public function get($key = null, $default = null) { } /** * Check the content-type for JSON * * @return boolean */ public function isJson() { } /** * Check if current request wants JSON response. * * @return boolean */ public function wantsJson() { } /** * Check if current request is a Rest request * * @return boolean */ public function isRest() { } /** * Determine if the request is initiated by WordPress. * * @return boolean */ public function isInternal() { } /** * Retrieve an item from the json payload of the request. * * @param string $key * @param string $default * @return mixed */ public function json($key = null, $default = null) { } /** * Retrieve an item from the PHP $_SERVER array * @param string $key * @param string $default * @return mixed */ public function server($key = null, $default = null) { } /** * Retrieve an item from the cookie jar. * * Returns the raw cookie value, with one exception: if the value is a * valid strict-base64 string AND the decoded bytes parse as JSON, the * decoded value is returned instead. This keeps backwards compatibility * with callers that stored base64(json(...)) payloads, while normal * cookies (utm_*, UUIDs, hex hashes, JWTs, plain strings) pass through * unchanged because they fail one of the two gates. * * @param string|null $key Cookie name, or null for the full array * @param mixed $default Returned when $key is set but absent * @return mixed */ public function cookie($key = null, $default = null) { } /** * Get an item from the PHP $_GET array * @param string $key * @param mixed $default * @return mixed */ public function query($key = null, $default = null) { } /** * Get an item from the PHP $_POST array * @param string $key * @param mixed $default * @return mixed */ public function post($key = null, $default = null) { } /** * Return the only items given in the args * @param array $keys * @return array */ public function only($keys) { } /** * Return a subset of the request inputs except the given keys * @param array $keys * @return array */ public function except($keys) { } /** * Merge array with the request inputs * @param array $data * @return self */ public function merge(array $data = []) { } /** * Merge array with the request inputs if the * key(s) is missing from the request. * * @param array $data * @return self */ public function mergeIfMissing(array $data = []) { } /** * Merge new input into the request's input, but only when * that key is present in the request but value is missing. * * @param array $input * @return $this */ public function mergeMissing(array $input) { } /** * Returns the request body content. * * @return mixed */ public function getContent() { } /** * Merges the input arrays from the WP_REST_Request. * * @param \WP_REST_Request $wpRestRequest * @return void */ public function mergeInputsFromRestRequest($wpRestRequest) { } /** * Merge the headers from the WP_REST_Request. * * @param \WP_REST_Request $wpRestRequest * @return void */ protected function mergerHeaders($wpRestRequest) { } /** * Retrieve an input item from the request. * * @param string|null $key * @param mixed $default * @return mixed */ public function input($key = null, $default = null) { } /** * Remove a key(s) from the $request array * @param mixed $key * @return self */ public function forget($key) { } /** * Get all inputs * * @return array */ protected function inputs() { } /** * To get item(s) from validated inputs * * @return self */ public function safe() { } /** * Get the request method. * * @return string */ public function method() { } /** * Get the URL (no query string) for the request. * * @return string */ public function url() { } /** * Get the full URL for the request. * * @return string */ public function getFullUrl() { } /** * Validate the request. * * @param array $rules * @param array $messages * @return mixed * @throws \FluentCart\Framework\Validator\ValidationException */ public function validate(array $rules, array $messages = []) { } /** * Get the validator instance. * * @return \FluentCart\Framework\Validator\Validator */ public function getValidator() { } /** * Get the valid data after validation has been passed. * * @return array */ public function validated($data = []) { } /** * Abort the request. * * @param integer $status * @param string $message * @return \WP_REST_Response */ public function abort($status = 403, $message = null) { } /** * Terminate the request. * * @param integer $status * @param string $message * @return \WP_REST_Response */ public function terminate($status = 200, $message = null) { } /** * Throw a validation exception if status is validation exception. * @param mixed $status * @return void * @throws \FluentCart\Framework\Validator\ValidationException */ protected function maybeThrowValidationException($status) { } /** * Get an input element from the request. * * @param string $key * @return mixed */ public function __get($key) { } /** * Retrieves the currently logged in user. * * @return \FluentCart\Framework\Http\Request\WPUserProxy */ public function user() { } /** * Dynamyc method calls (specially for WP_rest_request) * @param string $method * @param array $params * @return mixed */ public function __call($method, $params = []) { } } /** * Class FluentCart\Framework\Framework\Http\Request\WPUserProxy * * @method void __construct() Constructs the class * @method void init() Initializes the object * @method mixed getDataBy(string $field, mixed $value) Retrieves data by field * @method bool __isset(string $name) Checks if a property is set * @method mixed __get(string $name) Dynamically gets a property * @method void __set(string $name, mixed $value) Dynamically sets a property * @method void __unset(string $name) Unsets a property * @method bool exists() Checks existence of something * @method mixed get(string $key) Gets a value by key * @method bool hasProp(string $prop) Checks if a property exists * @method array getRoleCaps() Gets role capabilities * @method void addRole(string $role, string $displayName, array $caps) Adds a role * @method void removeRole(string $role) Removes a role * @method void setRole(string $role) Sets a role * @method void levelReduction() Reduces levels * @method void updateUserLevelFromCaps() Updates user level from capabilities * @method void addCap(string $cap) Adds a capability * @method void removeCap(string $cap) Removes a capability * @method void removeAllCaps() Removes all capabilities * @method bool hasCap(string $cap) Checks if the object has a capability * @method string translateLevelToCap(int $level) Translates a level to a capability * @method self forBlog(int $blogId) Switches context to a blog * @method self forSite(int $siteId) Switches context to a site * @method int getSiteId() Gets the site ID */ class WPUserProxy { /** * User identifier: ID, email, or WP_User instance * * @var int|string|\WP_User */ protected $userIdentifier; /** * Method aliases to pass through to WP_User * * @var array */ protected $passthrough = ['can' => 'has_cap']; /** * Store the user identifier (ID, email, or WP_User instance) * * @param int|string|\WP_User $wpUser */ public function __construct($wpUser) { } /** * Resolve the latest WP_User instance * * @return \WP_User * @throws \InvalidArgumentException */ protected function wpUser() { } /** * Get the user ID * * @return int */ public function id() { } /** * Get the user email * * @return string */ public function email() { } /** * Get the user login * * @return string */ public function login() { } /** * Get the user nicename * * @return string */ public function nicename() { } /** * Get the user status * * @return int */ public function status() { } /** * Get the display name * * @return string */ public function displayName() { } /** * Get user roles * * @return array */ public function getRoles() { } /** * Get user capabilities / permissions * * @return array */ public function getPermissions() { } /** * Get user meta (fresh from database) * * @param string|null $metaKey * @param mixed|null $default * @return mixed */ public function getMeta($metaKey = null, $default = null) { } /** * Set user meta * * @param string $key * @param mixed $value * @return bool */ public function setMeta($key, $value) { } /** * Get the underlying WP_User instance * * @return \WP_User */ public function toBase() { } /** * Check if the user is a super admin * * @return bool */ public function isSuperAdmin() { } /** * Check if the user is an administrator * * @return bool */ public function isAdmin() { } /** * Check if the user has a specific role * * @param string $role * @return bool */ public function is($role) { } /** * Dynamically get a WP_User property * * @param string $key * @return mixed */ public function __get($key) { } /** * Dynamically set a WP_User property * * @param string $key * @param mixed $value */ public function __set($key, $value) { } /** * Check if a WP_User property exists * * @param string $key * @return bool */ public function __isset($key) { } /** * Unset a WP_User property * * @param string $key */ public function __unset($key) { } /** * Dynamically call WP_User methods with passthrough and snake_case support * * @param string $method * @param array $args * @return mixed * @throws \BadMethodCallException */ public function __call($method, $args) { } } } namespace FluentCart\Framework\Http { /** * Class Response * * Handles HTTP responses for HTTP Client class, * providing methods to access response data. */ class Response implements \JsonSerializable { /** * The HTTP response data. * * @var array */ protected $response; /** * Create a new Response instance. * * @param array $response The response data. */ public function __construct($response) { } /** * Convert the response to an array. * * @return array */ public function toArray() { } /** * Convert the response object to an array. * * @return array */ #[\ReturnTypeWillChange] public function jsonSerialize() { } /** * Get the HTTP response object. * * @return mixed */ public function getHttpResponseObject() { } /** * Determine if the response is successful (2xx status code). * * @return bool */ public function isOkay() { } /** * Determine if the response is a redirect (3xx status code). * * @return bool */ public function isRedirect() { } /** * Throw an exception based on the response status code. * * @throws \WpOrg\Requests\Exception */ public function throw() { } /** * Throw an exception if the given callback returns true. * * @param callable $callback * @return void */ public function throwIf(callable $callback) { } /** * Get the HTTP response status code. * * @return int */ public function getCode() { } /** * Get the HTTP response status code (alias for getCode). * * @return int */ public function getStatus() { } /** * Get the HTTP response status message. * * @return string */ public function getMessage() { } /** * Get the HTTP response body. * * @return string */ public function getBody() { } /** * Determine if the response body is JSON. * * @return bool */ public function isJson() { } /** * Get the decoded JSON body. * * @return array|null */ public function getJson() { } /** * Get the headers from the response. * * @return array */ public function getHeaders() { } /** * Get a specific header from the response. * * @param string $key The header key. * @return string|null */ public function getHeader($key) { } /** * Get the cookies from the response. * * @return array */ public function getCookies() { } /** * Get a specific cookie from the response. * * @param string $name The cookie name. * @param bool $isObject Whether to return the \WP_Http_Cookie object. * @return mixed */ public function getCookie($name, $isObject = false) { } } } namespace FluentCart\Framework\Http\Response { class Response { /** * Response Data * @var mixed */ protected $data = null; /** * Response Status Code * @var integer */ protected $code = 200; /** * Response Headers * @var array */ protected $headers = []; /** * Response Cookies * @var array */ protected $cookies = []; /** * Construct the response instance. * * @param array $data * @param integer $code * @param array $headers */ public function __construct($data = null, $code = 200, $headers = []) { } /** * Creates an instance of self. * * @param mixed $data * @param integer $code * @param array $headers * @return self */ public static function make($data = null, $code = 200, $headers = []) { } /** * Send json response. * * @param array $data * @param integer $code * @return string|false JSON encoded string, or false if fails to encode. */ public function json($data = null, $code = 200) { } /** * Send rest response. * * @param mixed $data * @param integer $code * @param array $headers * @return \WP_REST_Response */ public function send($data = null, $code = 200, $headers = []) { } /** * Send a success rest response. * * @param mixed $data * @param integer $code * @return \WP_REST_Response */ public function sendSuccess($data = null, $code = 200, $headers = []) { } /** * Send an error json response * @param array $data * @param integer $code * @return \WP_REST_Response */ public function sendError($data = null, $code = 422, $headers = []) { } /** * Convert the WP_Error to WP_REST_Response * * @param \WP_Error $wpError * @return \WP_REST_Response */ public function wpErrorToResponse(\WP_Error $wpError) { } /** * Set response headers * @param string|array $key * @param string|null $value * @return self */ public function withHeader($key, $value = null) { } /** * Set response cookie * * @param string $name * @param mixed $value * @param int $minutes * @param string $path * @param string|null $domain * @param bool $secure * @param bool $httpOnly * @param string $samesite * @return self */ public function withCookie($name, $value, $minutes, $path = '/', $domain = null, $secure = false, $httpOnly = true, $samesite = 'Lax') { } /** * Attach a response cookie whose value is base64(json($value)). * * Pairs with Request::cookie(), which auto-detects this exact format * and decodes back to the original value on read. Use this when you * need to attach arrays/objects to a Response — strings, numbers, and * scalars work fine through plain withCookie() and don't need encoding. * * @param string $name * @param mixed $value Anything json_encode can serialize * @param int $minutes * @param string $path * @param string|null $domain * @param bool $secure * @param bool $httpOnly * @param string $samesite * @return self */ public function withEncodedCookie($name, $value, $minutes, $path = '/', $domain = null, $secure = false, $httpOnly = true, $samesite = 'Lax') { } /** * Set response cookie * * @param string $name * @param mixed $value * @param int $minutes * @param string $path * @param string|null $domain * @param bool $secure * @param bool $httpOnly * @param string $samesite * @return string */ protected function buildCookie($name, $value, $minutes, $path, $domain, $secure, $httpOnly, $samesite = 'Lax') { } /** * Merge additional headers if exist. * * @param \WP_REST_Response $response */ protected function maybeMergeHeaders(\WP_REST_Response $response) { } /** * Merge cookies if exist. * * @param \WP_REST_Response $response */ protected function maybeMergeCookies(\WP_REST_Response $response) { } /** * Prepares expiration time in minutes. * * @param int|\DateTimeInterface $minutes * @return int */ protected static function expiresAt($minutes = 0) { } /** * Send the response * * @return \WP_REST_Response */ public function toArray() { } /** * Get data from response. * * @return mixed */ public function getData() { } /** * Set data to response. * * @param mixed $data * @return void */ public function SetData($data) { } /** * Send a file download response. * * @param string $filePath * @param string|null $fileName * @return void */ public static function download($filePath, $fileName = null) { } /** * Send a redirect response. * * @param string $route * @param integer $status * @return \WP_REST_Response */ public static function redirect($route, $status = 303) { } } } namespace FluentCart\Framework\Http { trait SubstituteParameters { protected function substituteParameters($routeParameters) { } protected function boundModel($name, $parameter, $routeParameters) { } protected function getParametersFromRouteAction() { } } class Route { use \FluentCart\Framework\Http\SubstituteParameters; /** * Application Instance * @var \FluentCart\Framework\Foundation\Application */ protected $app = null; /** * Route name * @var string */ protected $name = null; /** * Rest namespace from config * @var string */ protected $restNamespace = null; /** * Whether this route should override existing routes at the same URI. * @var bool */ protected $shouldOverride = false; /** * Full URI * @var string */ protected $uri = null; /** * Compiled rest endpoint * @var string */ protected $compiled = null; /** * Route meta data * @var array */ protected $meta = []; /** * Rest Handler/Callback before parsing * @var string */ protected $handler = null; /** * Rest Handler/Callback after parsing * @var callable|string */ protected $action = null; /** * Rest route action info after parsing * @var array */ protected $actionInfo = []; /** * Policy Handler/Callback after parsing * @var string */ protected $permissionHandler = []; /** * HTTP Methods * @var string */ protected $method = null; /** * Rest options * @var array */ protected $options = []; /** * Route where constraints * @var array */ protected $wheres = []; /** * Rest namespace * @var string */ protected $namespace = null; /** * Policy Handler/Callback after parsing * @var callable|string */ protected $policyHandler = null; /** * Route Middleware * @var array */ protected $middleware = ['before' => [], 'after' => []]; /** * Skips middlewar if true * * @var boolean */ protected $skipMiddleware = false; /** * Predefined Regex foe where constraints * @var array */ protected $predefinedNamedRegx = ['int' => '[0-9]+', 'alpha' => '[a-zA-Z]+', 'alpha_num' => '[a-zA-Z0-9]+', 'alpha_num_dash' => '[a-zA-Z0-9-_]+']; /** * Route parameters * @var null|array */ protected $parameters = null; /** * Route substituted parameters * * @var null|array */ protected $substitutedParameters = []; /** * Is route signed * * @var boolean */ protected $signed = false; /** * Route signature. * * @var array */ protected $endpointSignature = []; /** * Response instance * * @var \WP_REST_Response */ protected $response = null; /** * Construct the route instance * * @param \FluentCart\Framework\Foundation\Application $app * @param string $restNamespace * @param string $uri * @param string $handler * @param string $method */ public function __construct($app, $restNamespace, $uri, $handler, $method) { } /** * Map the route to be used in front-end. * * @param mixed $handler * @return self */ public function preparefrontendHandlers() { } /** * Get a display name for the route's policy handler. * * @return string|null */ protected function getPolicyName() { } /** * Parse the action from the handler. * * @param mixed $handler * @return string */ protected function parseAction($handler) { } /** * Alternative constructor * * @param \FluentCart\Framework\Foundation\Application $app * @param string $namespace * @param string $uri * @param string $handler * @param string $method * @return self */ public static function create($app, $namespace, $uri, $handler, $method) { } /** * Set route meta * * @param string $key * @param mixed $value * @return self */ public function meta($key, $value = null) { } /** * Get route meta * * @param string $key * @return mixed */ public function getMeta($key = '') { } /** * Get route options * * @return mixed */ public function getOptions() { } /** * Get route options * * @param string $key * @return mixed */ public function getOption($key = null) { } /** * Get route action information * @param string $key * @return mixed */ public function getAction($key = '') { } /** * Set a where constrain into the route * * @param string $identifier * @param string $value * @return self */ public function where($identifier, $value = null) { } /** * Add an integer type route constraint * * @param string $identifiers * @return self */ public function int($identifiers) { } /** * Add an alpha type route constraint * * @param string $identifiers * @return self */ public function alpha($identifiers) { } /** * Add an alphanum type route constraint * * @param string $identifiers * @return self */ public function alphaNum($identifiers) { } /** * Add an alphanumdash type route constraint * * @param string $identifiers * @return self */ public function alphaNumDash($identifiers) { } /** * Set the route before middleware * * @param array|string $middleware * @return self */ public function before(...$middleware) { } /** * Set the route after middleware * * @param array|string $middleware * @return self */ public function after(...$middleware) { } /** * Set the route middleware * @param array $middleware * @return self */ public function middleware($type = 'before', ...$middleware) { } /** * Set the default route policy. * * @return self */ public function withDefaultPolicy() { } /** * Set the route policy * * @param mixed $handler * @param string|null $method * @return self */ public function withPolicy($handler, $method = null) { } /** * Check if the request is from CLI; * * @return bool */ protected function fromCli() { } /** * Add route information for CLI command. * * @param mixed $handler * @return self */ protected function addRouteInfo($handler) { } /** * Inject property into route infio. * * @param string $key * @param mixed $value * @return void */ public function injectProp($key, $value) { } /** * Resolve and set policy with namespace for add-ons * * @param array $backTrace * @return void */ protected function setPolicyHandlerWithNamespace($backTrace) { } /** * Set the name for the route. * * @param string $name * @return self */ public function name($name) { } /** * Set the name for the route. * * @param string $name * @return null */ public function withName($name) { } /** * Set the namespace for controller/action. * * @param string $ns * @return null */ public function withNamespace($ns) { } /** * Sign the route. * * @return $this */ public function signed() { } /** * Apply rate limit to the route. * * @param int $limit Number of allowed requests. * @param int $interval Time interval in seconds. * * @return $this */ public function rateLimit($limit, $interval) { } /** * Apply a rate limit to the route for per minute. * * @param int $limit The maximum number of requests allowed per minute. * @return $this */ public function rateLimitPerMinute($limit) { } /** * Apply an hourly rate limit to the route. * * @param int $limit The maximum number of requests allowed per hour. * @return $this */ public function rateLimitHourly($limit) { } /** * Apply a daily basis (24 hours) rate limit to the route. * * @param int $limit The maximum number of requests allowed per day. * @return $this */ public function rateLimitDaily($limit) { } /** * Register the rest endpoint * * @return null */ public function register() { } /** * Update route options before registering. * * @return void */ protected function updateRouteOptions() { } /** * Get normalized uri for the current route. * * @return string */ protected function getRouteUri() { } /** * Mark this route to override any existing route at the same URI. * * @return $this */ public function override() { } /** * Set route options * * @return null */ protected function setOptions() { } /** * Get default options. * * @return array */ protected function getDefaultOptions() { } /** * Generate and return the schema for the route. * * @return self * @see https://developer.wordpress.org/rest-api/extending-the-rest-api/schema */ public function schema($schema) { } /** * Get item from predefined regex * @param string $value * @return string */ protected function getValue($value) { } /** * Compikle the rest route to regex * * @param string $uri * @return string compiled rest endpoint */ protected function compileRoute($uri) { } /** * Route handler * * @return \WP_REST_Response */ public function callback() { } /** * Run the bound `ExceptionHandler` over `$e` and convert its result * to a `WP_REST_Response`, or `null` if the handler has nothing for * this exception (in which case the caller falls through to the * sanitizer). * * Returns an `HttpException` result through `renderHttpException()` * so observability + headers + the `{code, message, data}` shape * stay consistent with the dedicated `HttpException` catch arm. * A `WP_REST_Response` is returned verbatim — the renderer claimed * full control over the response shape; we still fire * `fluent_exception` so observability listeners see the original * exception. * * @param \Throwable $e * @return \WP_REST_Response|null */ protected function mapToHandlerResponse(\Throwable $e) { } /** * Handle response from route. * * @param \WP_REST_Response $response * @return \WP_REST_Response */ protected function handleResponse($response) { } /** * Throw an exception based on the status code. * * @param string $message * @param int $status * @return null * @throws \Exception */ protected function throwException($message, $status) { } /** * Handle exception and send error response. * * @param \Throwable $e * @return \WP_REST_Response */ protected function handleUnknownException(\Throwable $e, $headers = []) { } /** * Render an HttpException to a sanitization-free response. * * HttpException is the opt-in contract for "I authored this message, * it is safe to ship to the client". Bypasses handleUnknownException's * production sanitization but still fires fluent_exception for * observability so listeners see every thrown HttpException. * * @param \FluentCart\Framework\Foundation\Exceptions\HttpException $e * @return \WP_REST_Response */ protected function renderHttpException(\FluentCart\Framework\Foundation\Exceptions\HttpException $e) { } /** * Dispatch the route action. * * @return \WP_REST_Response */ protected function dispatchRouteAction() { } /** * Handle after middleware if any. * * @param mixed $response * @return mixed */ protected function handleAfterMiddleware($response) { } /** * Normalize the response. * * @param mixed $response * @return mixed */ protected function normalize($response) { } /** * Fire exception action hook. * * @param \Exception $exception * @return void */ protected function fireExceptionEvent($exception) { } /** * Permission callback for route * @param \WP_REST_Request $wpRestRequest * @return mixed */ public function permissionCallback($wpRestRequest) { } /** * Checks if the route is signed and needs validation. * * @return boolean [description] */ protected function isThisValidSignedRoute() { } /** * Dispatches the permission handler. * * @return bool|null */ protected function dispatchPermissionHandler() { } /** * Checks if the user is an instance of WPUserProxy. * * @param \FluentCart\Framework\Http\Request\WPUserProxy $user * @return bool */ protected function isUser($user) { } /** * Throw invalid policy handling exception. * * @return \InvalidArgumentException */ protected function throwInvalidPolicy() { } /** * Gether route params after substituted the params * * @return array */ protected function getControllerParameters() { } /** * Added the ability to add middleware so we can intercept * the request without modifying the source code again * and again. The middleware class will implement * the handle method as given below: * * public function handle($request, $next) * * And must return $next($request) to handle the request. * Otherwise return nothing to abort the request. * Optionally, you may call the abort method: * return $request->abort(code, message); * * @param string $type * @return array */ protected function collectMiddleWare($type = 'before') { } /** * Resolve a middleware from a class. * * @param string $class * @return \Closure */ protected function resolveMiddlewareFrom($class) { } /** * Resolve the middleware * * @param mixed $handler * @param array $pieces * @return object */ protected function resolveMiddleware($handler, $pieces) { } /** * Create a class to wrap the middleware * * @param mixed $handler * @param array $pieces * @return object */ protected function wrapMiddleware($handler, $pieces) { } /** * Add the middleware in the stack * * @param array &$stack All callable middleware for the route * @param string $middleware * @return void */ protected function addMiddlewareInTheStack(&$stack, $middleware) { } /** * Resolve the policy handler * * @param string $policyHandler * @return mixed */ protected function getPolicyHandler($policyHandler) { } /** * Check if the policy handler is parseable. * * @param string $policyHandler * @return boolean */ protected function isPolicyHandlerParseable($policyHandler) { } /** * Default/Fallback policy handler for the route * * @return bool */ public function defaultPolicyHandler() { } /** * Parse the rest and permission/policy handlers * * @param \WP_REST_Request $request * @return null * @throws \BadMethodCallException */ public function prepareCallbacks($request) { } /** * Get the method name to build action info. * * @param mixed $action * @param mixed $handler * @return string|null */ protected function getMethodName($action, $handler) { } /** * Resolve the handler details. * * @param mixed $handler * @return array */ protected function resolveHandlerDetails($handler) { } /** * Extract the controller name from the FQCN. * * @param string $fqcn * @return string */ protected function extractControllerName($fqcn) { } /** * Parse and validate the policy handler. * * @return array */ protected function resolvePolicyHandler() { } /** * Build and throw an exception for invalid policy handlers. * * @throws \BadMethodCallException */ protected function invalidPolicyHandlerException() { } /** * Get one or more route parameters * @param string $key * * @return mixed */ public function getParameter($key = null) { } /** * Get the name of the route. * * @return string */ public function getName() { } /** * Get the url of the route. * * @return string */ public function getUrl() { } /** * Get the url of the route. * * @return string */ public function uri() { } /** * Dynamically access a route parameter. * * @param string $key * @return mixed */ public function __get($key) { } } class Router { /** * Application Instance * @var \FluentCart\Framework\Foundation\Application */ protected $app = null; /** * Name for the route. * @var array */ protected $name = []; /** * Mapping of named routes. * @var array */ protected $namedRoutes = []; /** * Prefix for the route * @var array */ protected $prefix = []; /** * Controller/Handler namespace * @var array */ protected $namespace = []; /** * Registered routes collection * @var array */ protected $routes = []; /** * Route policy handler to pass to the route * @var array */ protected $policyHandler = []; /** * Route middleware to pass to the route * @var array */ protected $middleware = ['before' => [], 'after' => []]; /** * Whether routes created by this router should override existing ones. * @var bool */ protected $shouldOverride = false; /** * Keep the track of number of group calls * @var integer */ protected $groupCount = 0; /** * Construct the routet instance * @param \FluentCart\Framework\Foundation\Application $app */ public function __construct($app) { } /** * Create a route group * @param array $attributes * @param \Closure|null $callback * @return null */ public function group($attributes = [], ?\Closure $callback = null) { } /** * Set the route name * * @param string $name * @return self */ public function name($name) { } /** * Set the route prefix * * @param string $prefix * @return self */ public function prefix($prefix) { } /** * Set the namespace for the action/controller * * @param string $ns * @return self */ public function namespace($ns) { } /** * Set the default route policy. * * @return self */ public function withDefaultPolicy() { } /** * Set the route policy * * @param mixed $handler * @param string|null $method * @return self */ public function withPolicy($handler, $method = null) { } /** * Set the route before middleware * * @param array|string $middleware * @return self */ public function before(...$middleware) { } /** * Set the route after middleware * * @param array|string $middleware * @return self */ public function after(...$middleware) { } /** * Set the route middleware * * @param array|string $middleware * @return self */ public function middleware($type = 'before', ...$middleware) { } /** * Execute the route group callback * * @param \Closure $callback * @return null */ public function executeGroupCallback($callback) { } /** * Declare a GET route endpoint * @param string $uri * @param array|string|\Closure $handler * @return \FluentCart\Framework\Http\Route */ public function get($uri, $handler) { } /** * Declare a POST route endpoint * @param string $uri * @param array|string|\Closure $handler * @return \FluentCart\Framework\Http\Route */ public function post($uri, $handler) { } /** * Declare a PUT route endpoint * @param string $uri * @param array|string|\Closure $handler * @return \FluentCart\Framework\Http\Route */ public function put($uri, $handler) { } /** * Declare a PATCH route endpoint * @param string $uri * @param array|string|\Closure $handler * @return \FluentCart\Framework\Http\Route */ public function patch($uri, $handler) { } /** * Declare a DELETE route endpoint * @param string $uri * @param array|string|\Closure $handler * @return \FluentCart\Framework\Http\Route */ public function delete($uri, $handler) { } /** * Declare a route endpoint that matches any HTTP Verb/Method * @param string $uri * @param array|string|\Closure $handler * @return \FluentCart\Framework\Http\Route */ public function any($uri, $handler) { } /** * Create a new route instance * @param string $uri * @param string|\Closure $handler * @param string $method HTTP Method * @return \FluentCart\Framework\Http\Route */ protected function newRoute($uri, $handler, $method) { } /** * Resolve the rest namespace for the plugin * * @return string */ protected function getRestNamespace() { } /** * Build the URI with the prefix * * @param string $uri * @return string The URI */ protected function buildUriWithPrefix($uri) { } /** * Mark all routes created by this router to override existing ones. * * @return $this */ public function overrideExisting() { } /** * Register all the routse in WordPress Rest Engine * * @return null */ public function registerRoutes() { } /** * Get all ther registered routes * @return array */ public function getRoutes() { } /** * Set a named route in the router. * * @param string $name * @param Route $route */ public function setNamedRoute($name, \FluentCart\Framework\Http\Route $route) { } /** * Get a route by name. * * @param string $name * @return Route|null */ public function getByName($name) { } } class URL { /** * The full URL string. * * @var string */ protected $url = ''; /** * URL generator instance used for signing and route generation. * * @var UrlGenerator|null */ protected $generator = null; /** * URL scheme (e.g., 'http', 'https'). * * @var string */ protected $scheme = ''; /** * URL host (e.g., 'example.com'). * * @var string|null */ protected $host = null; /** * URL port (e.g., 80, 443). * * @var int|null */ protected $port = null; /** * URL path (e.g., '/users/view'). * * @var string */ protected $path = ''; /** * URL query parameters as an associative array. * * @var array */ protected $query = []; /** * URL fragment (e.g., 'top' in '#top'). * * @var string|null */ protected $fragment = null; /** * URL username for authentication (if any). * * @var string|null */ protected $user = null; /** * URL password for authentication (if any). * * @var string|null */ protected $pass = null; /** * Constructor. * * @param string|null $url Optional URL to initialize. Defaults to current URL. * @param UrlGenerator|null $generator Optional generator instance for signing/routes. * * @throws \InvalidArgumentException If the given URL is invalid. */ public function __construct($url = '', $generator = null) { } /** * Parse a URL according to RFC 3986 and populate internal components. * * @param string $url The URL to parse. * * @return void * * @throws \InvalidArgumentException If the URL cannot be parsed. */ protected function prepareRfcProperties($url) { } /** * Create a new URL instance. * * @param string $uri * @return static */ public static function of($uri) { } /** * Get the current URL * * @return string */ public function current() { } /** * Parse a url from uncompiled route * * @param string $url * @param array $params * @return string */ public function parse(string $url, array $params) { } /** * Sign the current url. * * @param array $params * @return string */ public function signCurrentUrl($params = []) { } /** * Sign a URL * * @param string $url * @param array $params * @return string */ public function sign($url, $params = []) { } /** * Validate a URL * * @param string $url * @return mixed (false or array) */ public function validate($url) { } /** * Helper method for home_url. * * @return string */ public function wp($path = '') { } /** * Retrieve the wp-content URL. * * Note: The wp-content directory is renamable by devs so it's not * guaranteed to be wp-content, so use this method for safety. * * @param string $path * @return string */ public function content($path = '') { } /** * Retrieve the wp-content/plugins URL. * * @param string $path * @return string */ public function plugins($path = '') { } /** * Retrieve the wp-content/plugins URL. * * @param string $path * @return string */ public function plugin($path = '') { } /** * Retrieve the wp-content/themes URL. * * @param string $path * @return string */ public function themes($path = '') { } /** * Retrieve the wp-content/uploads URL. * * @param string $path * @return string */ public function uploads($path = '') { } /** * Retrieve the site/home URL. * * @param string $path * @return string */ public function home($path = '', $scheme = null) { } /** * Generate a URL from a file path. * * @param string $path * @param bool $checkFile Whether to check if the file exists * @return string * * @phpstan-ignore-next-line */ public function fromFile(string $path, bool $checkFile = false): string { } /** * Generate a URL from a named route. * * @param string $name * @param array $params * @param array $query * @return string|null */ public function route($name, $params = [], $query = []) { } /** * Return a clone of the URL with a new path. * * @param string $path * @return $this */ public function withPath($path) { } /** * Return a clone of the URL with a new query. * * @param array|string $query An array of query params or a query string * @return $this */ public function withQuery($query) { } /** * Return a clone of the URL with a new fragment. * * @param string $fragment * @return $this */ public function withFragment($fragment) { } /** * Return a clone of the URL with a new scheme. * * @param string $scheme * @return $this */ public function withScheme($scheme) { } /** * Get the URL scheme (e.g., 'http' or 'https'). * * @return string */ public function scheme() { } /** * Get the URL host. * * @return string|null */ public function host() { } /** * Get the URL port. * * @return int|null */ public function port() { } /** * Get the URL path. * * @return string */ public function path() { } /** * Get the URL query as an array. * * @return array */ public function query() { } /** * Get the URL fragment. * * @return string|null */ public function fragment() { } /** * Get the URL pass. * * @return string|null */ public function pass() { } /** * Get the URL user. * * @return string */ public function user() { } /** * Returns the string representation of the URL object. * * @return string Current URL. */ public function __toString() { } } class UrlGenerator { /** * The application instance. * * @var \FluentCart\Framework\Foundation\App|null */ protected $app = null; /** * The encrypter instance. * @var \FluentCart\Framework\Encryption\Encrypter|null */ protected $encrypter = null; /** * Create a new URL Generator instance. * * @param \FluentCart\Framework\Foundation\App|null $app * @param \FluentCart\Framework\Encryption\Encrypter|null $encrypter */ public function __construct($app = null, $encrypter = null) { } /** * Sign a URL * * @param string $url * @param array $params * @return string */ public function sign($url, $params = []) { } /** * Normalize URL — handle relative routes, slugs, and REST routes. * * @param string $url * @return string */ protected function normalizeUrl($url) { } /** * Extract base URL and query array from a full URL. * * @param string $url * @return array */ protected function extractUrlParts($url) { } /** * Normalize the expiry time. * * @param array $params * @return array * @throws \InvalidArgumentException * * @phpstan-ignore-next-line */ public function validateExpiryTime(array $params): array { } /** * Validate a URL * * @param string $url * @return mixed (false or array) */ public function validate($url) { } /** * Parse query string from the url. * * @param string $url * @return mixed (bool or array) */ public function parseUrlAndGetQuery($url) { } /** * Verify the signature. * * @param array $data * @param string $signature * @return mixed (bool or array) */ public function verifySignature($data, $signature) { } /** * Generate a full REST URL from a named route. * * @param string $nameOrPath The name of the route or path. * @param array $params Optional parameters to fill in the placeholders. * @param array $query Optional query parameters to append to the URL. * @return string|null The full REST URL or null if the route doesn't exist. */ public function route($nameOrPath, $params = [], $query = []) { } /** * Resolve the encrypter. * * @return \FluentCart\Framework\Encryption\Encrypter */ protected function resolveEncrypter() { } /** * Build the full URL including base REST path, * namespace, version, and route path. * * @param string $path * @return string */ protected function buildFullUrl($path) { } /** * Get the base REST URL (e.g., https://wpfluent.org/wp-json). * * @return string */ protected function buildRestBaseUrl() { } /** * Build the namespace and version segment of the REST URL. * * @return string */ protected function buildNamespaceSegment() { } /** * Replace route placeholders in the URI with the provided parameters. * * @param string $template * @param array $params * @return string */ protected function buildPath($template, &$params) { } /** * Append query parameters to a URL. * * @param string $url * @param array $query * @return string */ protected function appendQueryString($url, $query) { } } } namespace FluentCart\Framework\Support { trait Tappable { /** * Call the given Closure with this instance then return the instance. * * @param callable|null $callback * @return $this|\FluentCart\Framework\Support\HigherOrderTapProxy */ public function tap($callback = null) { } } } namespace FluentCart\Framework\Pagination { /** * @mixin \FluentCart\Framework\Support\Collection */ abstract class AbstractCursorPaginator { use \FluentCart\Framework\Support\ForwardsCalls, \FluentCart\Framework\Support\Tappable; /** * All of the items being paginated. * * @var \FluentCart\Framework\Support\Collection */ protected $items; /** * The number of items to be shown per page. * * @var int */ protected $perPage; /** * The base path to assign to all URLs. * * @var string */ protected $path = '/'; /** * The query parameters to add to all URLs. * * @var array */ protected $query = []; /** * The URL fragment to add to all URLs. * * @var string|null */ protected $fragment; /** * The cursor string variable used to store the page. * * @var string */ protected $cursorName = 'cursor'; /** * The current cursor. * * @var \FluentCart\Framework\Pagination\Cursor|null */ protected $cursor; /** * The paginator parameters for the cursor. * * @var array */ protected $parameters; /** * The paginator options. * * @var array */ protected $options; /** * Indicates whether there are more items in the data source. * * @return bool */ protected $hasMore; /** * The current cursor resolver callback. * * @var \Closure */ protected static $currentCursorResolver; /** * Get the URL for a given cursor. * * @param \FluentCart\Framework\Pagination\Cursor|null $cursor * @return string */ public function url($cursor) { } /** * Get the URL for the previous page. * * @return string|null */ public function previousPageUrl() { } /** * The URL for the next page, or null. * * @return string|null */ public function nextPageUrl() { } /** * Get the "cursor" that points to the previous set of items. * * @return \FluentCart\Framework\Pagination\Cursor|null */ public function previousCursor() { } /** * Get the "cursor" that points to the next set of items. * * @return \FluentCart\Framework\Pagination\Cursor|null */ public function nextCursor() { } /** * Get a cursor instance for the given item. * * @param \ArrayAccess|\stdClass $item * @param bool $isNext * @return \FluentCart\Framework\Pagination\Cursor */ public function getCursorForItem($item, $isNext = true) { } /** * Get the cursor parameters for a given object. * * @param \ArrayAccess|\stdClass $item * @return array * * @throws \Exception */ public function getParametersForItem($item) { } /** * Get the cursor parameter value from a pivot model if applicable. * * @param \FluentCart\Framework\Database\Orm\Model $item * @param string $parameterName * @return string|null */ protected function getPivotParameterForItem($item, $parameterName) { } /** * Ensure the parameter is a primitive type. * * This can resolve issues that arise the developer uses a value object for an attribute. * * @param mixed $parameter * @return mixed */ protected function ensureParameterIsPrimitive($parameter) { } /** * Get / set the URL fragment to be appended to URLs. * * @param string|null $fragment * @return $this|string|null */ public function fragment($fragment = null) { } /** * Add a set of query string values to the paginator. * * @param array|string|null $key * @param string|null $value * @return $this */ public function appends($key, $value = null) { } /** * Add an array of query string values. * * @param array $keys * @return $this */ protected function appendArray(array $keys) { } /** * Add all current query string values to the paginator. * * @return $this */ public function withQueryString() { } /** * Add a query string value to the paginator. * * @param string $key * @param string $value * @return $this */ protected function addQuery($key, $value) { } /** * Build the full fragment portion of a URL. * * @return string */ protected function buildFragment() { } /** * Load a set of relationships onto the mixed relationship collection. * * @param string $relation * @param array $relations * @return $this */ public function loadMorph($relation, $relations) { } /** * Load a set of relationship counts onto the mixed relationship collection. * * @param string $relation * @param array $relations * @return $this */ public function loadMorphCount($relation, $relations) { } /** * Get the slice of items being paginated. * * @return array */ public function items() { } /** * Transform each item in the slice of items using a callback. * * @param callable $callback * @return $this */ public function through(callable $callback) { } /** * Get the number of items shown per page. * * @return int */ public function perPage() { } /** * Get the current cursor being paginated. * * @return \FluentCart\Framework\Pagination\Cursor|null */ public function cursor() { } /** * Get the query string variable used to store the cursor. * * @return string */ public function getCursorName() { } /** * Set the query string variable used to store the cursor. * * @param string $name * @return $this */ public function setCursorName($name) { } /** * Set the base path to assign to all URLs. * * @param string $path * @return $this */ public function withPath($path) { } /** * Set the base path to assign to all URLs. * * @param string $path * @return $this */ public function setPath($path) { } /** * Get the base path for paginator generated URLs. * * @return string|null */ public function path() { } /** * Resolve the current cursor or return the default value. * * @param string $cursorName * @return \FluentCart\Framework\Pagination\Cursor|null */ public static function resolveCurrentCursor($cursorName = 'cursor', $default = null) { } /** * Set the current cursor resolver callback. * * @param \Closure $resolver * @return void */ public static function currentCursorResolver(\Closure $resolver) { } /** * Get an iterator for the items. * * @return \ArrayIterator */ #[\ReturnTypeWillChange] public function getIterator() { } /** * Determine if the list of items is empty. * * @return bool */ public function isEmpty() { } /** * Determine if the list of items is not empty. * * @return bool */ public function isNotEmpty() { } /** * Get the number of items for the current page. * * @return int */ #[\ReturnTypeWillChange] public function count() { } /** * Get the paginator's underlying collection. * * @return \FluentCart\Framework\Support\Collection */ public function getCollection() { } /** * Set the paginator's underlying collection. * * @param \FluentCart\Framework\Support\Collection $collection * @return $this */ public function setCollection(\FluentCart\Framework\Support\Collection $collection) { } /** * Get the paginator options. * * @return array */ public function getOptions() { } /** * Determine if the given item exists. * * @param mixed $key * @return bool */ #[\ReturnTypeWillChange] public function offsetExists($key) { } /** * Get the item at the given offset. * * @param mixed $key * @return mixed */ #[\ReturnTypeWillChange] public function offsetGet($key) { } /** * Set the item at the given offset. * * @param mixed $key * @param mixed $value * @return void */ #[\ReturnTypeWillChange] public function offsetSet($key, $value) { } /** * Unset the item at the given key. * * @param mixed $key * @return void */ #[\ReturnTypeWillChange] public function offsetUnset($key) { } /** * Make dynamic calls into the collection. * * @param string $method * @param array $parameters * @return mixed */ public function __call($method, $parameters) { } /** * Render the contents of the paginator when casting to a string. * * @return string */ public function __toString() { } } /** * @mixin \FluentCart\Framework\Support\Collection */ abstract class AbstractPaginator { use \FluentCart\Framework\Support\ForwardsCalls, \FluentCart\Framework\Support\Tappable; /** * All of the items being paginated. * * @var \FluentCart\Framework\Support\Collection */ protected $items; /** * The number of items to be shown per page. * * @var int */ protected $perPage; /** * The current page being "viewed". * * @var int */ protected $currentPage; /** * The base path to assign to all URLs. * * @var string */ protected $path = '/'; /** * The query parameters to add to all URLs. * * @var array */ protected $query = []; /** * The URL fragment to add to all URLs. * * @var string|null */ protected $fragment; /** * The query string variable used to store the page. * * @var string */ protected $pageName = 'page'; /** * The number of links to display on each side of current page link. * * @var int */ public $onEachSide = 3; /** * The paginator options. * * @var array */ protected $options; /** * The current path resolver callback. * * @var \Closure */ protected static $currentPathResolver; /** * The current page resolver callback. * * @var \Closure */ protected static $currentPageResolver; /** * The query string resolver callback. * * @var \Closure */ protected static $queryStringResolver; /** * The default pagination view. * * @var string */ public static $defaultView = 'pagination::tailwind'; /** * The default "simple" pagination view. * * @var string */ public static $defaultSimpleView = 'pagination::simple-tailwind'; /** * Determine if the given value is a valid page number. * * @param int $page * @return bool */ protected function isValidPageNumber($page) { } /** * Get the URL for the previous page. * * @return string|null */ public function previousPageUrl() { } /** * Create a range of pagination URLs. * * @param int $start * @param int $end * @return array */ public function getUrlRange($start, $end) { } /** * Get the URL for a given page number. * * @param int $page * @return string */ public function url($page) { } /** * Get / set the URL fragment to be appended to URLs. * * @param string|null $fragment * @return $this|string|null */ public function fragment($fragment = null) { } /** * Add a set of query string values to the paginator. * * @param array|string|null $key * @param string|null $value * @return $this */ public function appends($key, $value = null) { } /** * Add an array of query string values. * * @param array $keys * @return $this */ protected function appendArray(array $keys) { } /** * Add all current query string values to the paginator. * * @return $this */ public function withQueryString() { } /** * Add a query string value to the paginator. * * @param string $key * @param string $value * @return $this */ protected function addQuery($key, $value) { } /** * Build the full fragment portion of a URL. * * @return string */ protected function buildFragment() { } /** * Load a set of relationships onto the mixed relationship collection. * * @param string $relation * @param array $relations * @return $this */ public function loadMorph($relation, $relations) { } /** * Load a set of relationship counts onto the mixed relationship collection. * * @param string $relation * @param array $relations * @return $this */ public function loadMorphCount($relation, $relations) { } /** * Get the slice of items being paginated. * * @return array */ public function items() { } /** * Get the number of the first item in the slice. * * @return int */ public function firstItem() { } /** * Get the number of the last item in the slice. * * @return int */ public function lastItem() { } /** * Transform each item in the slice of items using a callback. * * @param callable $callback * @return $this */ public function through(callable $callback) { } /** * Get the number of items shown per page. * * @return int */ public function perPage() { } /** * Determine if there are enough items to split into multiple pages. * * @return bool */ public function hasPages() { } /** * Determine if the paginator is on the first page. * * @return bool */ public function onFirstPage() { } /** * Determine if the paginator is on the last page. * * @return bool */ public function onLastPage() { } /** * Get the current page. * * @return int */ public function currentPage() { } /** * Get the query string variable used to store the page. * * @return string */ public function getPageName() { } /** * Set the query string variable used to store the page. * * @param string $name * @return $this */ public function setPageName($name) { } /** * Set the base path to assign to all URLs. * * @param string $path * @return $this */ public function withPath($path) { } /** * Set the base path to assign to all URLs. * * @param string $path * @return $this */ public function setPath($path) { } /** * Set the number of links to display on each side of current page link. * * @param int $count * @return $this */ public function onEachSide($count) { } /** * Get the base path for paginator generated URLs. * * @return string|null */ public function path() { } /** * Resolve the current request path or return the default value. * * @param string $default * @return string */ public static function resolveCurrentPath($default = '/') { } /** * Set the current request path resolver callback. * * @param \Closure $resolver * @return void */ public static function currentPathResolver(\Closure $resolver) { } /** * Resolve the current page or return the default value. * * @param string $pageName * @param int $default * @return int */ public static function resolveCurrentPage($pageName = 'page', $default = 1) { } /** * Set the current page resolver callback. * * @param \Closure $resolver * @return void */ public static function currentPageResolver(\Closure $resolver) { } /** * Resolve the query string or return the default value. * * @param string|array|null $default * @return string */ public static function resolveQueryString($default = null) { } /** * Set with query string resolver callback. * * @param \Closure $resolver * @return void */ public static function queryStringResolver(\Closure $resolver) { } /** * Render the paginator using the given view. * * @param string|null $view * @param array $data * @return \FluentCart\Framework\View\View */ public function links($view = 'web.pagination.default', $data = []) { } /**s * Set the default pagination view. * * @param string $view * @return void */ public static function defaultView($view) { } /** * Set the default "simple" pagination view. * * @param string $view * @return void */ public static function defaultSimpleView($view) { } /** * Get an iterator for the items. * * @return \ArrayIterator */ #[\ReturnTypeWillChange] public function getIterator() { } /** * Determine if the list of items is empty. * * @return bool */ public function isEmpty() { } /** * Determine if the list of items is not empty. * * @return bool */ public function isNotEmpty() { } /** * Get the number of items for the current page. * * @return int */ #[\ReturnTypeWillChange] public function count() { } /** * Get the paginator's underlying collection. * * @return \FluentCart\Framework\Support\Collection */ public function getCollection() { } /** * Set the paginator's underlying collection. * * @param \FluentCart\Framework\Support\Collection $collection * @return $this */ public function setCollection(\FluentCart\Framework\Support\Collection $collection) { } /** * Get the paginator options. * * @return array */ public function getOptions() { } /** * Determine if the given item exists. * * @param mixed $key * @return bool */ #[\ReturnTypeWillChange] public function offsetExists($key) { } /** * Get the item at the given offset. * * @param mixed $key * @return mixed */ #[\ReturnTypeWillChange] public function offsetGet($key) { } /** * Set the item at the given offset. * * @param mixed $key * @param mixed $value * @return void */ #[\ReturnTypeWillChange] public function offsetSet($key, $value) { } /** * Unset the item at the given key. * * @param mixed $key * @return void */ #[\ReturnTypeWillChange] public function offsetUnset($key) { } /** * Make dynamic calls into the collection. * * @param string $method * @param array $parameters * @return mixed */ public function __call($method, $parameters) { } /** * Render the contents of the paginator when casting to a string. * * @return string */ public function __toString() { } } class Cursor implements \FluentCart\Framework\Support\ArrayableInterface { /** * The parameters associated with the cursor. * * @var array */ protected $parameters; /** * Determine whether the cursor points to the next or previous set of items. * * @var bool */ protected $pointsToNextItems; /** * Create a new cursor instance. * * @param array $parameters * @param bool $pointsToNextItems */ public function __construct(array $parameters, $pointsToNextItems = true) { } /** * Get the given parameter from the cursor. * * @param string $parameterName * @return string|null * * @throws \UnexpectedValueException */ public function parameter(string $parameterName) { } /** * Get the given parameters from the cursor. * * @param array $parameterNames * @return array */ public function parameters(array $parameterNames) { } /** * Determine whether the cursor points to the next set of items. * * @return bool */ public function pointsToNextItems() { } /** * Determine whether the cursor points to the previous set of items. * * @return bool */ public function pointsToPreviousItems() { } /** * Get the array representation of the cursor. * * @return array */ public function toArray() { } /** * Get the encoded string representation of the cursor to construct a URL. * * @return string */ public function encode() { } /** * Get a cursor instance from the encoded string representation. * * @param string|null $encodedString * @return static|null */ public static function fromEncoded($encodedString) { } } /** * @deprecated Will be removed in a future Laravel version. */ class CursorPaginationException extends \RuntimeException { // } interface CursorPaginatorInterface { /** * Get the URL for a given cursor. * * @param \FluentCart\Framework\Pagination\Cursor|null $cursor * @return string */ public function url($cursor); /** * Add a set of query string values to the paginator. * * @param array|string|null $key * @param string|null $value * @return $this */ public function appends($key, $value = null); /** * Get / set the URL fragment to be appended to URLs. * * @param string|null $fragment * @return $this|string|null */ public function fragment($fragment = null); /** * Get the URL for the previous page, or null. * * @return string|null */ public function previousPageUrl(); /** * The URL for the next page, or null. * * @return string|null */ public function nextPageUrl(); /** * Get all of the items being paginated. * * @return array */ public function items(); /** * Get the "cursor" of the previous set of items. * * @return \FluentCart\Framework\Pagination\Cursor|null */ public function previousCursor(); /** * Get the "cursor" of the next set of items. * * @return \FluentCart\Framework\Pagination\Cursor|null */ public function nextCursor(); /** * Determine how many items are being shown per page. * * @return int */ public function perPage(); /** * Get the current cursor being paginated. * * @return \FluentCart\Framework\Pagination\Cursor|null */ public function cursor(); /** * Determine if there are enough items to split into multiple pages. * * @return bool */ public function hasPages(); /** * Get the base path for paginator generated URLs. * * @return string|null */ public function path(); /** * Determine if the list of items is empty or not. * * @return bool */ public function isEmpty(); /** * Determine if the list of items is not empty. * * @return bool */ public function isNotEmpty(); } class CursorPaginator extends \FluentCart\Framework\Pagination\AbstractCursorPaginator implements \FluentCart\Framework\Support\ArrayableInterface, \ArrayAccess, \Countable, \IteratorAggregate, \FluentCart\Framework\Support\JsonableInterface, \JsonSerializable, \FluentCart\Framework\Pagination\CursorPaginatorInterface { /** * Indicates whether there are more items in the data source. * * @return bool */ protected $hasMore; /** * Create a new paginator instance. * * @param mixed $items * @param int $perPage * @param \FluentCart\Framework\Pagination\Cursor|null $cursor * @param array $options (path, query, fragment, pageName) * @return void */ public function __construct($items, $perPage, $cursor = null, array $options = []) { } /** * Set the items for the paginator. * * @param mixed $items * @return void */ protected function setItems($items) { } /** * Determine if there are more items in the data source. * * @return bool */ public function hasMorePages() { } /** * Determine if there are enough items to split into multiple pages. * * @return bool */ public function hasPages() { } /** * Determine if the paginator is on the first page. * * @return bool */ public function onFirstPage() { } /** * Get the instance as an array. * * @return array */ public function toArray() { } /** * Convert the object into something JSON serializable. * * @return array */ #[\ReturnTypeWillChange] public function jsonSerialize() { } /** * Convert the object to its JSON representation. * * @param int $options * @return string */ public function toJson($options = 0) { } } interface PaginatorInterface { /** * Get the URL for a given page. * * @param int $page * @return string */ public function url($page); /** * Add a set of query string values to the paginator. * * @param array|string $key * @param string|null $value * @return $this */ public function appends($key, $value = null); /** * Get / set the URL fragment to be appended to URLs. * * @param string|null $fragment * @return $this|string */ public function fragment($fragment = null); /** * The URL for the next page, or null. * * @return string|null */ public function nextPageUrl(); /** * Get the URL for the previous page, or null. * * @return string|null */ public function previousPageUrl(); /** * Get all of the items being paginated. * * @return array */ public function items(); /** * Get the "index" of the first item being paginated. * * @return int */ public function firstItem(); /** * Get the "index" of the last item being paginated. * * @return int */ public function lastItem(); /** * Determine how many items are being shown per page. * * @return int */ public function perPage(); /** * Determine the current page being paginated. * * @return int */ public function currentPage(); /** * Determine if there are enough items to split into multiple pages. * * @return bool */ public function hasPages(); /** * Determine if there are more items in the data store. * * @return bool */ public function hasMorePages(); /** * Get the base path for paginator generated URLs. * * @return string|null */ public function path(); /** * Determine if the list of items is empty or not. * * @return bool */ public function isEmpty(); /** * Determine if the list of items is not empty. * * @return bool */ public function isNotEmpty(); } interface LengthAwarePaginatorInterface extends \FluentCart\Framework\Pagination\PaginatorInterface { /** * Create a range of pagination URLs. * * @param int $start * @param int $end * @return array */ public function getUrlRange($start, $end); /** * Determine the total number of items in the data store. * * @return int */ public function total(); /** * Get the page number of the last available page. * * @return int */ public function lastPage(); } class LengthAwarePaginator extends \FluentCart\Framework\Pagination\AbstractPaginator implements \FluentCart\Framework\Support\ArrayableInterface, \ArrayAccess, \Countable, \IteratorAggregate, \JsonSerializable, \FluentCart\Framework\Support\JsonableInterface, \FluentCart\Framework\Pagination\LengthAwarePaginatorInterface { /** * The total number of items before slicing. * * @var int */ protected $total; /** * The last available page. * * @var int */ protected $lastPage; /** * Create a new paginator instance. * * @param mixed $items * @param int $total * @param int $perPage * @param int|null $currentPage * @param array $options (path, query, fragment, pageName) * @return void */ public function __construct($items, $total, $perPage, $currentPage = null, array $options = []) { } /** * Get the current page for the request. * * @param int $currentPage * @param string $pageName * @return int */ protected function setCurrentPage($currentPage, $pageName) { } /** * Get the paginator links as a collection (for JSON responses). * * @return \FluentCart\Framework\Support\Collection */ public function linkCollection() { } /** * Get the array of elements to pass to the view. * * @return array */ protected function elements() { } /** * Get the total number of items being paginated. * * @return int */ public function total() { } /** * Determine if there are more items in the data source. * * @return bool */ public function hasMorePages() { } /** * Get the URL for the next page. * * @return string|null */ public function nextPageUrl() { } /** * Get the last page. * * @return int */ public function lastPage() { } /** * Get the instance as an array. * * @return array */ public function toArray() { } /** * Convert the object into something JSON serializable. * * @return array */ #[\ReturnTypeWillChange] public function jsonSerialize() { } /** * Convert the object to its JSON representation. * * @param int $options * @return string */ public function toJson($options = 0) { } } class Paginator extends \FluentCart\Framework\Pagination\AbstractPaginator implements \FluentCart\Framework\Support\ArrayableInterface, \ArrayAccess, \Countable, \IteratorAggregate, \JsonSerializable, \FluentCart\Framework\Support\JsonableInterface, \FluentCart\Framework\Pagination\PaginatorInterface { /** * Determine if there are more items in the data source. * * @return bool */ protected $hasMore; /** * Create a new paginator instance. * * @param mixed $items * @param int $perPage * @param int|null $currentPage * @param array $options (path, query, fragment, pageName) * @return void */ public function __construct($items, $perPage, $currentPage = null, array $options = []) { } /** * Get the current page for the request. * * @param int $currentPage * @return int */ protected function setCurrentPage($currentPage) { } /** * Set the items for the paginator. * * @param mixed $items * @return void */ protected function setItems($items) { } /** * Get the URL for the next page. * * @return string|null */ public function nextPageUrl() { } /** * Manually indicate that the paginator does have more pages. * * @param bool $hasMore * @return $this */ public function hasMorePagesWhen($hasMore = true) { } /** * Determine if there are more items in the data source. * * @return bool */ public function hasMorePages() { } /** * Get the instance as an array. * * @return array */ public function toArray() { } /** * Convert the object into something JSON serializable. * * @return array */ #[\ReturnTypeWillChange] public function jsonSerialize() { } /** * Convert the object to its JSON representation. * * @param int $options * @return string */ public function toJson($options = 0) { } } class UrlWindow { /** * The paginator implementation. * * @var \FluentCart\Framework\Pagination\LengthAwarePaginatorInterface */ protected $paginator; /** * Create a new URL window instance. * * @param \FluentCart\Framework\Pagination\LengthAwarePaginatorInterface $paginator * @return void */ public function __construct(\FluentCart\Framework\Pagination\LengthAwarePaginatorInterface $paginator) { } /** * Create a new URL window instance. * * @param \FluentCart\Framework\Pagination\LengthAwarePaginatorInterface $paginator * @return array */ public static function make(\FluentCart\Framework\Pagination\LengthAwarePaginatorInterface $paginator) { } /** * Get the window of URLs to be shown. * * @return array */ public function get() { } /** * Get the slider of URLs there are not enough pages to slide. * * @return array */ protected function getSmallSlider() { } /** * Create a URL slider links. * * @param int $onEachSide * @return array */ protected function getUrlSlider($onEachSide) { } /** * Get the slider of URLs when too close to beginning of window. * * @param int $window * @param int $onEachSide * @return array */ protected function getSliderTooCloseToBeginning($window, $onEachSide) { } /** * Get the slider of URLs when too close to ending of window. * * @param int $window * @param int $onEachSide * @return array */ protected function getSliderTooCloseToEnding($window, $onEachSide) { } /** * Get the slider of URLs when a full slider can be made. * * @param int $onEachSide * @return array */ protected function getFullSlider($onEachSide) { } /** * Get the page range for the current page window. * * @param int $onEachSide * @return array */ public function getAdjacentUrlRange($onEachSide) { } /** * Get the starting URLs of a pagination slider. * * @return array */ public function getStart() { } /** * Get the ending URLs of a pagination slider. * * @return array */ public function getFinish() { } /** * Determine if the underlying paginator being presented has pages to show. * * @return bool */ public function hasPages() { } /** * Get the current page from the paginator. * * @return int */ protected function currentPage() { } /** * Get the last page from the paginator. * * @return int */ protected function lastPage() { } } } namespace FluentCart\Framework\Randomizer { trait GetStringTrait { public function getString(int $length = 16, string $charlist = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ!@#$%^&*()-_=+[]{}|;:,.<>?/~') { } } /** * Wrapper around the native PHP 8.2+ Random\Randomizer. * * @method string getBytes(int $length) * @method int getInt(int $min, int $max) * @method float getFloat(float $min, float $max) * @method int nextInt() * @method float nextFloat() * @method array pickArrayKeys(array $array, int $num) * @method array shuffleArray(array $array) * @method string shuffleBytes(string $string) */ final class Randomizer { use \FluentCart\Framework\Randomizer\GetStringTrait; private $randomizer; public function __construct() { } public function getBytesFromString(string $string, int $length): string { } public function __call($method, $args = []) { } } } namespace FluentCart\Framework\Support { class Arr { use \FluentCart\Framework\Support\MacroableTrait; /** * Makes a collection from array * * @param array $array * @return \FluentCart\Framework\Support\Collection */ public static function of(array $array) { } /** * Determine whether the given value is array accessible. * * @param mixed $value * @return bool */ public static function accessible($value) { } /** * Add an element to an array using "dot" notation if it doesn't exist. * * @param array $array * @param string $key * @param mixed $value * @return array */ public static function add($array, $key, $value) { } /** * Collapse an array of arrays into a single array. * * @param iterable $array * @return array */ public static function collapse($array) { } /** * Cross join the given arrays, returning all possible permutations. * * @param iterable ...$arrays * @return array */ public static function crossJoin(...$arrays) { } /** * Divide an array into two arrays. One with keys and the other with values. * * @param array $array * @return array */ public static function divide($array) { } /** * Flatten a multi-dimensional associative array with dots. * * @param iterable $array * @param string $prepend * @return array */ public static function dot($array, $prepend = '') { } /** * Convert a flatten "dot" notation array into an expanded array. * * @param iterable $array * @return array */ public static function undot($array) { } /** * Get all of the given array except for a specified array of keys. * * @param array $array * @param array|string $keys * @return array */ public static function except($array, $keys) { } /** * Determine if the given key exists in the provided array. * * @param \ArrayAccess|array $array * @param string|int $key * @return bool */ public static function exists($array, $key) { } /** * Alias of exists. * @param \ArrayAccess|array $array * @param string|int $key * @return bool */ public static function keyExists($array, $key) { } /** * Alias of exists. * @param \ArrayAccess|array $array * @param string|int $key * @return bool */ public static function arrayKeyExists($array, $key) { } /** * Return the first element in an array passing a given truth test. * * @param iterable $array * @param callable|null $callback * @param mixed $default * @return mixed */ public static function first($array, ?callable $callback = null, $default = null) { } /** * Returns the key of the first item (matching the specified * callback if given) or null if there is no such item. * * @param array $array * @param callable|null $callback * @return mixed */ public static function firstKey($array, ?callable $callback = null) { } /** * Recursively filter an array like array_filter. * * @param array $array * @param callable|null $cb * @param integer $mode (ARRAY_FILTER_USE_BOTH = 1 | ARRAY_FILTER_USE_KEY = 2) * @return array */ public static function filterRecursive($array, ?callable $cb = null, $mode = 0) { } /** * Recursively search the value and return the path of first match. * * @param array $array * @param mixed $value * @param bool $ci (false for case insensitive search, true otherwise) * @return string|null */ public static function findPath($array, $value, $ci = false) { } /** * Return the last element in an array passing a given truth test. * * @param array $array * @param callable|null $callback * @param mixed $default * @return mixed */ public static function last($array, ?callable $callback = null, $default = null) { } /** * Returns the key of the last item (matching the specified * callback if given) or null if there is no such item. * * @param array $array * @param callable|null $callback * @return mixed */ public static function lastKey($array, ?callable $callback = null) { } /** * Flatten a multi-dimensional array into a single level. * * @param iterable $array * @param int|float $depth * @return array */ public static function flatten($array, $depth = INF) { } /** * Remove one or many array items from a given array using "dot" notation. * * @param array $array * @param array|string $keys * @return void */ public static function forget(&$array, $keys) { } /** * Get an item from an array using "dot" notation. * * @param \ArrayAccess|array $array * @param string|int|null $key * @param mixed $default * @return mixed */ public static function get($array, $key, $default = null) { } /** * Check if an item or items (using key) exist in an array using "dot" notation. * * @param \ArrayAccess|array $array * @param string|array $keys * @return bool */ public static function has($array, $keys) { } /** * Determine if any of the keys exist in an array using "dot" notation. * * @param \ArrayAccess|array $array * @param string|array $keys * @return bool */ public static function hasAny($array, $keys) { } /** * Alias of contains. * * @param array $array * @param string|array $value * @return bool */ public static function inArray($array, $value) { } /** * Determines if an array is associative. * * An array is "associative" if it doesn't have * sequential numerical keys beginning with zero. * * @param array $array * @return bool */ public static function isAssoc(array $array) { } /** * Determines if an array is a list. * * An array is a "list" if all array keys are sequential * integers starting from 0 with no gaps in between. * * @param array $array * @return bool */ public static function isList($array) { } /** * Determines if the given key contains a boolean value. * * Returns true for true, 1, "1", "true", "on" and "yes" * Returns false for false, "0", "false", "off", "no", and "" * Returns for all non-boolean values. * * @param array $array * @param string $key * * @return bool|null * @see https://www.php.net/manual/en/filter.filters.validate.php */ public static function isTrue($array, $key) { } /** * Get a subset of the items from the given array. * * @param array $array * @param array|string $keys * @return array */ public static function only($array, $keys) { } /** * Select an array of values from an array. * * @param array $array * @param array|string $keys * @return array */ public static function select($array, $keys) { } /** * Pluck an array of values from an array. * * @param iterable $array * @param string|array|int|null $value * @param string|array|null $key * @return array */ public static function pluck($array, $value, $key = null) { } /** * Explode the "value" and "key" arguments passed to "pluck". * * @param string|array $value * @param string|array|null $key * @return array */ protected static function explodePluckParameters($value, $key) { } /** * Push an item onto the beginning of an array. * * @param array $array * @param mixed $value * @param mixed $key * @return array */ public static function prepend($array, $value, $key = null) { } /** * Get a value from the array, and remove it. * * @param array $array * @param string|int $key * @param mixed $default * @return mixed */ public static function pull(&$array, $key, $default = null) { } /** * Convert the array into a query string. * * @param array $array * @return string */ public static function query($array) { } /** * Get one or a specified number of random values from an array. * * @param array $array * @param int|null $number * @param bool|false $preserveKeys * @return mixed * * @throws \InvalidArgumentException */ public static function random($array, $number = null, $preserveKeys = false) { } /** * Set an array item to a given value using "dot" notation. * * If no key is given to the method, the entire array will be replaced. * * @param array $array * @param string|null $key * @param mixed $value * @return array */ public static function set(&$array, $key, $value) { } /** * Shuffle the given array and return the result. * * @param array $array * @param int|null $seed * @return array */ public static function shuffle($array, $seed = null) { } /** * Sort the array using the given callback or "dot" notation. * * @param array $array * @param callable|array|string|null $callback * @return array */ public static function sort($array, $callback = null) { } /** * Sort an array in descending order. * * @param array $array The input array. * @param int-mask-of $flags * @return array * * @see https://www.php.net/manual/en/function.rsort.php */ public static function rsort($array, $flags = SORT_REGULAR) { } /** * Sort an array in ascending order and maintain index association. * * @param array $array * @param int-mask-of $flags * @return array * @see https://www.php.net/manual/en/function.asort.php */ public static function asort($array, $flags = SORT_REGULAR) { } /** * Sort an array in descending order and maintain index association. * * @param array $array * @param int-mask-of $flags * @return array * @see https://www.php.net/manual/en/function.arsort.php */ public static function arsort($array, $flags = SORT_REGULAR) { } /** * Sort an array by key in ascending order. * * @param array $array * @param int-mask-of $flags * @return array * @see https://www.php.net/manual/en/function.ksort.php */ public static function ksort($array, $flags = SORT_REGULAR) { } /** * Sort an array by key in descending order. * * @param array $array * @param int-mask-of $flags * @return array * @see https://www.php.net/manual/en/function.krsort.php */ public static function krsort($array, $flags = SORT_REGULAR) { } /** * Sort an array using a "natural order" algorithm. * * @param array $array * @return array * @see https://www.php.net/manual/en/function.natsort.php */ public static function natsort($array) { } /** * Sort an array using a case insensitive "natural order" algorithm. * * @param array $array * @return array * @see https://www.php.net/manual/en/function.natcasesort.php */ public static function natcasesort($array) { } /** * Sort an array by values using a user-defined comparison function. * * @param array $array * @return array * @see https://www.php.net/manual/en/function.usort.php */ public static function usort($array, callable $callback) { } /** * Sort an array with a user-defined comparison * function and maintain index association. * * @param array $array * @return array * @see https://www.php.net/manual/en/function.uasort.php */ public static function uasort($array, callable $callback) { } /** * Sort an array by keys using a user-defined comparison function. * * @param array $array * @return array * @see https://www.php.net/manual/en/function.uksort.php */ public static function uksort($array, callable $callback) { } /** * Recursively sort an array by keys and values. * * @param array $array * @param int $options * @param bool $desc * @return array */ public static function sortRecursive($array, $options = SORT_REGULAR, $desc = false) { } /** * Recursively sort an array by keys and values in Descending order. * * @param array $array * @param int $options * @param bool $desc * @return array */ public static function sortRecursiveDesc($array, $options = SORT_REGULAR, $desc = false) { } /** * Conditionally compile classes from an array into a CSS class list. * * @param array $array * @return string */ public static function toCssClasses($array) { } /** * Transforms an array to \stdClass * @param array $array * @return \stdClass */ public static function toObject($array) { } /** * Filter the array using the given callback. * * @param array $array * @param callable $callback * @return array */ public static function where($array, callable $callback) { } /** * Filter items where the value is not null. * * @param array $array * @return array */ public static function whereNotNull($array) { } /** * Filter items where the value is not null. * * @param array $array * @return array */ public static function whereNotTrue($array, $strict = false) { } /** * If the given value is not an array and not null, wrap it in one. * * @param mixed $value * @return array */ public static function wrap($value) { } /** * Maps a function to all non-iterable elements of an array or an object. * * This is similar to `array_walk_recursive()` but acts upon objects too. * * @param mixed $value The array, object, or scalar. * @param callable $callback The function to map onto $value. * @see https://developer.wordpress.org/reference/functions/map_deep/ * * @return mixed The value with the callback applied to all non-arrays and non-objects inside it. */ public static function map($value, $callback) { } /** * Check if the value(s) exist in an array using "dot" notation. * * @param array $array * @param string|array $values * @return bool */ public static function contains(array $array, $values) { } /** * Check if the any value exist in an array using "dot" notation. * * @param array $array * @param string|array $values * @return bool */ public static function containsAny(array $array, $values) { } /** * Compare two nested arrays side by side * @param array $array1 * @param array $array2 * @param array $path * @return array */ public static function compare($array1, $array2, $path = []) { } /** * Merge the items from the first array into the * second array if the second array is missing it. * * @param array &$array1 * @param array &$array2 * @return array */ public static function mergeMissing(&$array1, &$array2) { } /** * Recursively merge the given array with defaults. * Overwrite $array with $defaults if only $array * contains null or empty values or doesn't exist. * * @param array $array * @param array $defaults * @return array */ public static function mergeMissingValues(array $array, array $defaults) { } /** * Return matching items from array (similar to mysql's %LIKE%) * * @param string $pattern (plain string or regex) * @param array $array * @return array|false */ public static function like($array, $pattern) { } /** * Return non-matching items from array (similar to mysql's NOT %LIKE%) * * @param string $pattern (plain string or regex) * @param array $array * @return array|false */ public static function notLike($array, $pattern) { } /** * Return matching starting of items from array (similar to mysql's %LIKE) * * @param string $pattern (plain string or regex) * @param array $array * @return array|false */ public static function startsLike($array, $pattern) { } /** * Return non-matching starting of items from array (similar to mysql's NOT %LIKE) * * @param string $pattern (plain string or regex) * @param array $array * @return array|false */ public static function DoesNotStartLike($array, $pattern) { } /** * Return matching ending of items from array (similar to mysql's LIKE%) * * @param string $pattern (plain string or regex) * @param array $array * @return array|false */ public static function endsLike($array, $pattern) { } /** * Return non-matching ending of items from array (similar to mysql's NOT LIKE%) * * @param string $pattern (plain string or regex) * @param array $array * @return array|false */ public static function DoesNotEndLike($array, $pattern) { } /** * Return matching items from array by keys * * @param string $pattern (plain string or regex) * @param array $array * @return array|false */ public static function keysLike($array, $pattern) { } /** * Return non-matching items from array by keys * * @param string $pattern (plain string or regex) * @param array $array * @return array|false */ public static function keysNotLike($array, $pattern) { } /** * Return matching starting of items from array by keys * * @param string $pattern (plain string or regex) * @param array $array * @return array|false */ public static function keysStartLike($array, $pattern) { } /** * Return non-matching starting of items from array by keys * * @param string $pattern (plain string or regex) * @param array $array * @return array|false */ public static function keysDoesNotStartLike($array, $pattern) { } /** * Return matching ending of items from array by keys * * @param string $pattern (plain string or regex) * @param array $array * @return array|false */ public static function keysEndLike($array, $pattern) { } /** * Return non-matching ending of items from array by keys * * @param string $pattern (plain string or regex) * @param array $array * @return array|false */ public static function keysDoesNotEndLike($array, $pattern) { } /** * Insert a new item in the array at the given position. * * @param array $array * @param int $pos * @param mixed $newItem * @return array */ public static function insertAt($array, $pos, $newItem) { } /** * Inserts an item before the specified key in the given array. If the * key is not found, inserts the item at the beginning of the array. * * @param array $array * @param mixed $key * @param mixed $newKey * @param mixed $newValue * @return array $newArray */ public static function insertBefore($array, $key, $newKey, $newValue) { } /** * Inserts an item after the specified key in the given array. If the * key is not found, inserts the item at the end of the array. * * @param array $array * @param mixed $key * @param mixed $newKey * @param mixed $newValue * @return array $newArray */ public static function insertAfter($array, $key, $newKey, $newValue) { } /** * Tests whether at least one element in the array passes * the test implemented by the provided callback. * * @param array $array * @param callable $callback * @return bool */ public static function some($array, callable $callback) { } /** * Tests whether all elements in the array pass the * test implemented by the provided callback. * * @param array $array * @param callable $callback * @return bool */ public static function every($array, callable $callback) { } /** * Finds the first element in the array that satisfies the * condition implemented by the callback function. * * @param array $array * @param callable $callback * @return mixed */ public static function find($array, callable $callback, $findKey = false) { } /** * Finds the first key in the array that satisfies the * condition implemented by the callback function. * * @param array $array * @param callable $callback * @return mixed */ public static function findKey($array, callable $callback) { } /** * Find similar words in an array. * * @param string $needle * @param array $haystack * @param integer $accuracy * @return string|null */ public static function findSimilar($needle, array $haystack, $accuracy = 60) { } /** * Pass the items through a series of callbacks. * * @param array $items * @param array $callbacks * @param integer $mode * @return array */ public static function passThrough(array $items, array $callbacks, $mode = 0) { } } /** * @mixin \DateTimeImmutable * @method self addYear(int $value = 1) * @method self addYears(int $value = 1) * @method self addMonth(int $value = 1) * @method self addMonths(int $value = 1) * @method self addWeek(int $value = 1) * @method self addWeeks(int $value = 1) * @method self addDay(int $value = 1) * @method self addDays(int $value = 1) * @method self addHour(int $value = 1) * @method self addHours(int $value = 1) * @method self addMinute(int $value = 1) * @method self addMinutes(int $value = 1) * @method self addSecond(int $value = 1) * @method self addSeconds(int $value = 1) * @method self addQuarter(int $value = 1) * @method self addQuarters(int $value = 1) * @method self addDecade(int $value = 1) * @method self addDecades(int $value = 1) * * @method self subYear(int $value = 1) * @method self subYears(int $value = 1) * @method self subMonth(int $value = 1) * @method self subMonths(int $value = 1) * @method self subWeek(int $value = 1) * @method self subWeeks(int $value = 1) * @method self subDay(int $value = 1) * @method self subDays(int $value = 1) * @method self subHour(int $value = 1) * @method self subHours(int $value = 1) * @method self subMinute(int $value = 1) * @method self subMinutes(int $value = 1) * @method self subSecond(int $value = 1) * @method self subSeconds(int $value = 1) * @method self subQuarter(int $value = 1) * @method self subQuarters(int $value = 1) * @method self subDecade(int $value = 1) * @method self subDecades(int $value = 1) * * @method int getYear() * @method int getMonth() * @method int getDay() * @method int getHour() * @method int getMinute() * @method int getSecond() * @method int getQuarter() * @method int getDecade() * * @method self setYear(int $value) * @method self setMonth(int $value) * @method self setDay(int $value) * @method self setHour(int $value) * @method self setMinute(int $value) * @method self setSecond(int $value) */ class DateTimeImmutable extends \DateTimeImmutable { /** @var string[] Singular time units */ protected const SINGULAR_UNITS = ['year', 'month', 'week', 'day', 'hour', 'minute', 'second', 'quarter', 'decade']; /** @var string[] Plural time units */ protected const PLURAL_UNITS = ['years', 'months', 'weeks', 'days', 'hours', 'minutes', 'seconds', 'quarters', 'decades']; /** * Construct the object. * * @param string|int|\DateTimeInterface $datetime * @param \DateTimeZone|string|null $timezone */ public function __construct($datetime = 'now', $timezone = null) { } /** * Gets the WordPress default timezone. * * @return \DateTimeZone */ public static function getDefaultTimezone() { } /** * Creates a DateTime object from various inputs. * * @param string|int|\DateTimeInterface $time * @param string|\DateTimeZone|null $tz * * @return static * @throws \InvalidArgumentException */ public static function create($time = null, $tz = null) { } /** * Creates a new instance for the current time. * * @param string|\DateTimeZone|null $tz * @return static */ public static function now($tz = null) { } /** * Creates a new instance for the beginning of today. * * @param string|\DateTimeZone|null $tz * @return static */ public static function today($tz = null) { } /** * Creates a new instance for the beginning of yesterday. * * @param string|\DateTimeZone|null $tz * @return static */ public static function yesterday($tz = null) { } /** * Creates a new instance for the beginning of tomorrow. * * @param string|\DateTimeZone|null $tz * @return static */ public static function tomorrow($tz = null) { } /** * Creates a new instance for the beginning of the current week. * * @param string|\DateTimeZone|null $tz * @return static */ public static function currentWeek($tz = null) { } /** * Creates a new instance for the beginning of last week. * * @param string|\DateTimeZone|null $tz * @return static */ public static function lastWeek($tz = null) { } /** * Creates a new instance for the beginning of next week. * * @param string|\DateTimeZone|null $tz * @return static */ public static function nextWeek($tz = null) { } /** * Creates a new instance for the beginning of the current month. * * @param string|\DateTimeZone|null $tz * @return static */ public static function currentMonth($tz = null) { } /** * Creates a new instance for the beginning of last month. * * @param string|\DateTimeZone|null $tz * @return static */ public static function lastMonth($tz = null) { } /** * Creates a new instance for the beginning of next month. * * @param string|\DateTimeZone|null $tz * @return static */ public static function nextMonth($tz = null) { } /** * Creates a new instance for the beginning of the current year. * * @param string|\DateTimeZone|null $tz * @return static */ public static function currentYear($tz = null) { } /** * Creates a new instance for the beginning of last year. * * @param string|\DateTimeZone|null $tz * @return static */ public static function lastYear($tz = null) { } /** * Creates a new instance for the beginning of next year. * * @param string|\DateTimeZone|null $tz * @return static */ public static function nextYear($tz = null) { } /** * Sets the timezone for the instance. * * @param string|\DateTimeZone $tz * @return self */ public function timezone($tz) { } /** * Checks if the current instance is between two dates. * * @param string|\DateTimeInterface $date1 * @param string|\DateTimeInterface $date2 * @return bool */ public function between($date1, $date2) { } /** * Creates a new instance from a formatted string. * * @param string $format * @param string $datetimeString * @param string|\DateTimeZone|null $timezone * * @return static * @throws \InvalidArgumentException */ public static function createFromFormat($format, $datetimeString, $timezone = null) { } /** * Creates a new instance from date parts. * * @param int $year * @param int $month * @param int $day * @param int $hour * @param int $minute * @param int $second * @param string|\DateTimeZone|null $tz * * @return static * @throws \InvalidArgumentException */ public static function createFromDate(int $year, int $month, int $day, int $hour = 0, int $minute = 0, int $second = 0, $tz = null) { } /** * Creates a new instance from a UTC date string. * * @param string $dateString * @param string $format * @return static */ public static function createFromUTC(string $dateString, string $format = 'Y-m-d H:i:s') { } /** * Parses a datetime string and returns a new instance. * * @param string $datetimeString * @param string|\DateTimeZone|null $timezone * * @return static * @throws \InvalidArgumentException */ public static function parse($datetimeString, $timezone = null) { } /** * Adds an interval to the instance. * * @param \DateInterval|string $interval * @return self * @throws \InvalidArgumentException */ public function add($interval) { } /** * Subtracts an interval from the instance. * * @param \DateInterval|string $interval * @return self * @throws \InvalidArgumentException */ public function sub($interval) { } /** * Creates a copy of the instance. * * @return self */ public function copy() { } /** * Converts the instance to a string. * * @return string */ public function __toString() { } /** * Checks if the instance has a timezone. * * @return bool */ public function hasTimezone() { } /** * Sets the time to the beginning of the day. * * @return self */ public function startOfDay() { } /** * Sets the time to the end of the day. * * @return self */ public function endOfDay() { } /** * Sets the time to the beginning of the hour. * * @return self */ public function startOfHour() { } /** * Sets the time to the end of the hour. * * @return self */ public function endOfHour() { } /** * Sets the time to the beginning of the minute. * * @return self */ public function startOfMinute() { } /** * Sets the time to the end of the minute. * * @return self */ public function endOfMinute() { } /** * Sets the date to the beginning of the week. * * @return self */ public function startOfWeek() { } /** * Sets the date to the end of the week. * * @return self */ public function endOfWeek() { } /** * Sets the date to the beginning of the month. * * @return self */ public function startOfMonth() { } /** * Sets the date to the end of the month. * * @return self */ public function endOfMonth() { } /** * Sets the date to the beginning of the quarter. * * @return self */ public function startOfQuarter() { } /** * Sets the date to the end of the quarter. * * @return self */ public function endOfQuarter() { } /** * Sets the date to the beginning of the year. * * @return self */ public function startOfYear() { } /** * Sets the date to the end of the year. * * @return self */ public function endOfYear() { } /** * Sets the date to the beginning of the decade. * * @return self */ public function startOfDecade() { } /** * Sets the date to the end of the decade. * * @return self */ public function endOfDecade() { } /** * Magic setter for time units. * * @param string $key * @param mixed $value * @return self * @throws \InvalidArgumentException */ public function __set($key, $value) { } /** * Magic method for dynamic calls (e.g., `addDay`, `getYear`). * * @param string $method * @param array $params * @return mixed|self * @throws \InvalidArgumentException */ public function __call($method, $params) { } } class Env { protected static $localStore = []; /** * Load environment variables from a file. */ public static function load(string $filePath): void { } /** * Get an environment variable. */ public static function get(string $key, $default = null) { } /** * Set an environment variable. */ public static function set(string $key, $value): void { } /** * Get all environment variables. */ public static function all(): array { } /** * Dump and die. */ public static function dd(): void { } /** * Normalize string values to PHP native types. */ protected static function normalize($value) { } } /** * Base exception marker interface for the instantiator component */ interface ExceptionInterface extends \Throwable { // ... } abstract class Facade { /** * The application instance being facaded. * * @var \FluentCart\Framework\Foundation\Application */ protected static $app; /** * The resolved object instances. * * @var array */ protected static $resolvedInstance; /** * Run a Closure when the facade has been resolved. * * @param \Closure $callback * @return void */ public static function resolved(\Closure $callback) { } /** * Get the root object behind the facade. * * @return mixed */ public static function getFacadeRoot() { } /** * Get the registered name of the component. * * @return string * * @throws \RuntimeException */ protected static function getFacadeAccessor() { } /** * Resolve the facade root instance from the container. * * @param object|string $name * @return mixed */ protected static function resolveFacadeInstance($name) { } /** * Clear a resolved facade instance. * * @param string $name * @return void */ public static function clearResolvedInstance($name) { } /** * Clear all of the resolved instances. * * @return void */ public static function clearResolvedInstances() { } /** * Get the application instance behind the facade. * * @return \FluentCart\Framework\Foundation\Application */ public static function getFacadeApplication() { } /** * Set the application instance. * * @param \FluentCart\Framework\Foundation\Application $app * @return void */ public static function setFacadeApplication($app) { } /** * Handle dynamic, static calls to the object. * * @param string $method * @param array $args * @return mixed * * @throws \RuntimeException */ public static function __callStatic($method, $args) { } } /** * Class File * * A wrapper for the WordPress Filesystem API. */ class File { /** * Instance of the WordPress Filesystem API. * * @var \WP_Filesystem_Base|false */ protected static $filesystem; /** * Initialize or return the WordPress Filesystem API instance. * * @return \WP_Filesystem_Base */ public static function init() { } /** * Initialize or return the WordPress Filesystem API instance. * * @return \WP_Filesystem_Base */ public static function fileSystem() { } /** * Check if a file or directory exists. * * @param string $path * @return bool */ public static function exists($path) { } /** * Read the contents of a file. * * @param string $path * @return string */ public static function get($path) { } /** * Read the contents of a file. * * @param string $path * @return string */ public static function read($path) { } /** * Read the contents of a file. * * @param string $path * @return string */ public static function getJson($path, $asArray = true) { } /** * Read the contents of a file as lines of array. * * @param string $path * @return string */ public static function getArray($path) { } /** * Read the contents of a file as lines of array. * * @param string $path * @return string */ public static function readAsArray($path) { } /** * Write contents to a file. * * @param string $path * @param string $contents * @param int|false $mode The file permissions as octal number. * @return bool */ public static function put($path, $contents, $mode = false) { } /** * Write contents to a file. * * @param string $path * @param string $contents * @param int|false $mode The file permissions as octal number. * @return bool */ public static function write($path, $contents, $mode = false) { } /** * Append contents to a file. * * @param string $path * @param string $contents * @return bool */ public static function append($path, $contents) { } /** * Prepend contents to a file. * * @param string $path * @param string $contents * @return bool */ public static function prepend($path, $contents) { } /** * Delete a file or directory. * * @param string $path * @param bool $recursive * @return bool */ public static function delete($path, $recursive = true) { } /** * Delete a file or directory. * * @param string $path * @param bool $recursive * @return bool */ public static function deleteDirectory($path, $recursive = true) { } /** * Delete a file or directory. * * @param string $path * @param bool $recursive * @return bool */ public static function rmdir($path, $recursive = true) { } /** * Create a directory. * * @param string $path * @param int $chmod * @param string|int|false $chown Optional. A user name or number. * @param string|int|false $chgrp Optional. A group name or number. * @return bool */ public static function mkdir($path, $chmod = FS_CHMOD_DIR, $chown = false, $chgrp = false) { } /** * Create a directory. * * @param string $path * @param int $chmod * @param string|int|false $chown Optional. A user name or number. * @param string|int|false $chgrp Optional. A group name or number. * @return bool */ public static function makeDirectory($path, $chmod = FS_CHMOD_DIR, $chown = false, $chgrp = false) { } /** * List files and directories in a path. * * @param string $path * @param bool $withHidden * @param bool $recurse * @return array An associative array with details. */ public static function list($path, $withHidden = true, $recurse = false) { } /** * Get the list of files and directories as plain array. * * @param string $path * @param bool $withHidden * @return array */ public static function getList($path, $withHidden = true) { } /** * List files in a path. * * @param string $path * @param bool $withHidden * @param bool $recurse * @return array An associative array with details. */ public static function files($path, $withHidden = true, $recurse = false) { } /** * Get the list of files as plain array. * * @param string $path * @param bool $withHidden * @return array */ public static function getFiles($path, $withHidden = true) { } /** * List directories in a path. * * @param string $path * @param bool $withHidden * @param bool $recurse * @return array An associative array with details. */ public static function directories($path, $withHidden = true, $recurse = true) { } /** * Get the list of directories as plain array. * * @param string $path * @param bool $withHidden * @return array */ public static function getDirectories($path, $withHidden = true) { } /** * Copy a file. * * @param string $source * @param string $dest * @param bool $overwrite * @return bool */ public static function copy($source, $dest, $overwrite = true) { } /** * Move a file. * * @param string $source * @param string $destination * @param bool $overwrite * @return bool */ public static function move($source, $destination, $overwrite = false) { } /** * Get file metadata. * * @param string $path * @return array|false */ public static function getInfo($path) { } /** * Get file/dir metadata using stat. * * @param string $path * @return array|false */ public static function getStats($path) { } /** * Searches for metadata in the first 8 KB of a file. * * @param string $file * @param array $keys * @return array */ public static function getMetaData($file, $keys = []) { } /** * Check if a file is an image based on its MIME type. * * @param string $path * @return bool */ public static function isImage($path) { } /** * Get image metadata using EXIF. * * @param string $path * @return array|false */ public static function getImageMetadata($path) { } /** * Dynamically handle calls to the filesystem API. * * @param string $method * @param array $args * @return mixed */ public function __call($method, $args) { } /** * Dynamically handle static calls to the filesystem API. * * @param string $method * @param array $args * @return mixed */ public static function __callStatic($method, $args) { } } class Fluent implements \FluentCart\Framework\Support\ArrayableInterface, \ArrayAccess, \FluentCart\Framework\Support\JsonableInterface, \JsonSerializable { /** * All of the attributes set on the fluent instance. * * @var array */ protected $attributes = []; /** * Create a new fluent instance. * * @param array|object $attributes * @return void */ public function __construct($attributes = []) { } /** * Get an attribute from the fluent instance. * * @param string $key * @param mixed $default * @return mixed */ public function get($key, $default = null) { } /** * Get the attributes from the fluent instance. * * @return array */ public function getAttributes() { } /** * Convert the fluent instance to an array. * * @return array */ public function toArray() { } /** * Convert the object into something JSON serializable. * * @return array */ #[\ReturnTypeWillChange] public function jsonSerialize() { } /** * Convert the fluent instance to JSON. * * @param int $options * @return string */ public function toJson($options = 0) { } /** * Determine if the given offset exists. * * @param string $offset * @return bool */ #[\ReturnTypeWillChange] public function offsetExists($offset) { } /** * Get the value for a given offset. * * @param string $offset * @return mixed */ #[\ReturnTypeWillChange] public function offsetGet($offset) { } /** * Set the value at the given offset. * * @param string $offset * @param mixed $value * @return void */ #[\ReturnTypeWillChange] public function offsetSet($offset, $value) { } /** * Unset the value at the given offset. * * @param string $offset * @return void */ #[\ReturnTypeWillChange] public function offsetUnset($offset) { } /** * Handle dynamic calls to the fluent instance to set attributes. * * @param string $method * @param array $parameters * @return $this */ public function __call($method, $parameters) { } /** * Dynamically retrieve the value of an attribute. * * @param string $key * @return mixed */ public function __get($key) { } /** * Dynamically set the value of an attribute. * * @param string $key * @param mixed $value * @return void */ public function __set($key, $value) { } /** * Dynamically check if an attribute is set. * * @param string $key * @return bool */ public function __isset($key) { } /** * Dynamically unset an attribute. * * @param string $key * @return void */ public function __unset($key) { } } class Hash { /** * $algo Hashing algorithm * @var int */ protected static $algo = PASSWORD_BCRYPT; /** * Hash a value using the default algorithm. * * @param string $value * @return string */ public static function make($value) { } /** * Check if the given value is already hashed. * * @param string $value * @return bool */ public static function isHashed($value) { } /** * Verify the hashed value's configuration. * * @param string $hash * @return bool */ public static function verifyConfiguration($hash) { } /** * Verify if the given plain value matches the hash. * * @param string $value * @param string $hash * @return bool */ public static function check($value, $hash) { } /** * Check if two given hashes match. * * @param string $hash1 * @param string $hash2 * @return bool */ public static function compare($hash1, $hash2) { } } class Helper { /** * Create a collection from the given value. * * @param mixed $value * @return \FluentCart\Framework\Support\Collection */ public static function collect($value = null) { } /** * Fill in data where it's missing. * * @param mixed $target * @param string|array $key * @param mixed $value * @return mixed */ public function dataFill(&$target, $key, $value) { } /** * Get an item from an array or object using "dot" notation. * * @param mixed $target * @param string|array|int|null $key * @param mixed $default * @return mixed */ public static function dataGet($target, $key, $default = null) { } /** * Set an item on an array or object using dot notation. * * @param mixed $target * @param string|array $key * @param mixed $value * @param bool $overwrite * @return mixed */ public static function dataSet(&$target, $key, $value, $overwrite = true) { } /** * Get the first element of an array. Useful for method chaining. * * @param array $array * @return mixed */ public static function head($array) { } /** * Get the last element from an array. * * @param array $array * @return mixed */ public static function last($array) { } /** * Return the default value of the given value. * * @param mixed $value * @return mixed */ public static function value($value, ...$args) { } /** * Call the given Closure with the given value then return the value. * * @param mixed $value * @param callable|null $callback * @return mixed */ public static function tap($value, $callback = null) { } /** * Dispatch an event and call its listeners. * * @param string|object $event Event name or object * @param mixed ...$payload Optional arguments passed to listeners * @return mixed Result of the event dispatch */ public static function event($event, ...$payload) { } /** * Retry an operation a given number of times. * * @param int $times * @param callable $callback * @param int|\Closure $sleepMilliseconds * @param callable|null $when * @return mixed * * @throws \Exception */ public static function retry($times, callable $callback, $sleepMilliseconds = 0, $when = null) { } /** * Retrieve header status text by http code * @param int $code HTTP status code * @return string */ public static function getHeaderStatusText($code) { } /** * Retrieve the writable temp dir path * * @return string */ public static function getTempDirPath() { } /** * Retrieves the list of allowed mime types and file extensions. * * @return string[] Mime types keyed by the file extension regex. */ public static function getAllowedMimeTypes() { } /** * Get the content of a JSON file as array. * * @param string $filename * @param array $options * @return array json decoded content of the file */ public static function getJsonFile($filename, $options = []) { } /** * Gets the size of a directory. * * @param string $dirPath Full path of a directory. * @return int|false|null Size in bytes or false. Null if timeout. */ public static function getSizeOf($dirPath) { } /** * Creates an \stdClass from an array recursively. * * @param array $array * @return \stdClass */ public static function objectCreate(array $array) { } /** * Transforms an \stdClass to array * @param \stdClass $object * @return array */ public static function objectToArray(\stdClass $object) { } /** * Get an item from an object using "dot" notation. * * @param object $object * @param string|null $key * @param mixed $default * @return mixed */ public static function objectGet($object, $key, $default = null) { } /** * Replace a given pattern with each value in the array in sequentially. * * @param string $pattern * @param array $replacements * @param string $subject * @return string */ public static function pregReplaceArray($pattern, array $replacements, $subject) { } /** * Executes a callback and returns the captured output as a string. * * @param callable $callback * @return string */ public static function capture(callable $callback) { } /** * Executes an action and returns the captured output as a string. * * @param string $action * @param array $params the data to passed in action * @return string * @throws \Throwable */ public static function captureAction($action, ...$params) { } /** * Compares two values in the same way that PHP does. * * @param mixed $left * @param string $operator * @param mixed $right * @return bool */ public static function compare($left, $operator, $right) { } } /** * @mixin \FluentCart\Framework\Support\Enumerable */ class HigherOrderCollectionProxy { /** * The collection being operated on. * * @var \FluentCart\Framework\Support\Enumerable */ protected $collection; /** * The method being proxied. * * @var string */ protected $method; /** * Create a new proxy instance. * * @param \FluentCart\Framework\Support\Enumerable $collection * @param string $method * @return void */ public function __construct(\FluentCart\Framework\Support\Enumerable $collection, $method) { } /** * Proxy accessing an attribute onto the collection items. * * @param string $key * @return mixed */ public function __get($key) { } /** * Proxy a method call onto the collection items. * * @param string $method * @param array $parameters * @return mixed */ public function __call($method, $parameters) { } } class HigherOrderTapProxy { /** * The target being tapped. * * @var mixed */ public $target; /** * Create a new tap proxy instance. * * @param mixed $target * @return void */ public function __construct($target) { } /** * Dynamically pass method calls to the target. * * @param string $method * @param array $parameters * @return mixed */ public function __call($method, $parameters) { } } class HigherOrderWhenProxy { /** * The target being conditionally operated on. * * @var mixed */ protected $target; /** * The condition for proxying. * * @var bool */ protected $condition; /** * Indicates whether the proxy has a condition. * * @var bool */ protected $hasCondition = false; /** * Determine whether the condition should be negated. * * @var bool */ protected $negateConditionOnCapture; /** * Create a new proxy instance. * * @param mixed $target * @return void */ public function __construct($target) { } /** * Set the condition on the proxy. * * @param bool $condition * @return $this */ public function condition($condition) { } /** * Indicate that the condition should be negated. * * @return $this */ public function negateConditionOnCapture() { } /** * Proxy accessing an attribute onto the target. * * @param string $key * @return mixed */ public function __get($key) { } /** * Proxy a method call on the target. * * @param string $method * @param array $parameters * @return mixed */ public function __call($method, $parameters) { } } /** * Exception for invalid arguments provided to the instantiator */ class InvalidArgumentException extends \InvalidArgumentException implements \FluentCart\Framework\Support\ExceptionInterface { public static function fromNonExistingClass(string $className): self { } /** * @phpstan-param \ReflectionClass $reflectionClass * * @template T of object */ public static function fromAbstractClass(\ReflectionClass $reflectionClass): self { } public static function fromEnum(string $className): self { } } class Invoker { /** * Get the value of a private or protected property from an object. * * @param object $object The object instance to read property from. * @param string $property The property name to access. * @return mixed The value of the property. */ public static function get($object, $property) { } /** * Set the value of a private or protected property on an object. * * @param object $object The object instance to set property on. * @param string $property The property name to modify. * @param mixed $value The value to assign to the property. * @return void */ public static function set($object, $property, $value) { } /** * Call a private or protected method on an object. * * @param object $object The object instance to call method on. * @param string $method The method name to invoke. * @param array $args Optional array of arguments to pass to the method. * @return mixed The result returned by the method. */ public static function call($object, $method, $args = []) { } /** * Get the value of a private or protected static property on a class. * * @param string $class The fully qualified class name. * @param string $property The static property name. * @return mixed The value of the static property. * @throws \ReflectionException When the property does not exist. */ public static function getStatic($class, $property) { } /** * Set the value of a private or protected static property on a class. * * @param string $class The fully qualified class name. * @param string $property The static property name. * @param mixed $value The value to assign to the static property. * @return void * @throws \ReflectionException When the property does not exist. */ public static function setStatic($class, $property, $value) { } /** * Call a private or protected static method on a class. * * @param string $class The fully qualified class name. * @param string $method The static method name to invoke. * @param array $args Optional array of arguments to pass to the method. * @return mixed The result returned by the static method. * @throws \ReflectionException When the method does not exist. */ public static function callStatic($class, $method, $args = []) { } /** * Bind a closure to an object and invoke it with optional arguments. * * @param object $object The object to bind the closure to. * @param \Closure $closure The closure to bind and invoke. * @param mixed ...$args Optional arguments to pass to the closure. * @return mixed The result returned by the closure. */ public static function invoke($object, $closure, ...$args) { } } class ItemNotFoundException extends \RuntimeException { protected $message = 'No item was found in the collection.'; } class LazyCollection implements \FluentCart\Framework\Support\CanBeEscapedWhenCastToString, \FluentCart\Framework\Support\Enumerable { use \FluentCart\Framework\Support\EnumeratesValues, \FluentCart\Framework\Support\MacroableTrait; /** * The source from which to generate items. * * @var callable|static */ public $source; /** * Create a new lazy collection instance. * * @param mixed $source * @return void */ public function __construct($source = null) { } /** * Create a collection with the given range. * * @param int $from * @param int $to * @return static */ public static function range($from, $to) { } /** * Get all items in the enumerable. * * @return array */ public function all() { } /** * Eager load all items into a new lazy collection backed by an array. * * @return static */ public function eager() { } /** * Cache values as they're enumerated. * * @return static */ public function remember() { } /** * Get the average value of a given key. * * @param callable|string|null $callback * @return mixed */ public function avg($callback = null) { } /** * Get the median of a given key. * * @param string|array|null $key * @return mixed */ public function median($key = null) { } /** * Get the mode of a given key. * * @param string|array|null $key * @return array|null */ public function mode($key = null) { } /** * Collapse the collection of items into a single array. * * @return static */ public function collapse() { } /** * Determine if an item exists in the enumerable. * * @param mixed $key * @param mixed $operator * @param mixed $value * @return bool */ public function contains($key, $operator = null, $value = null) { } /** * Determine if an item is not contained in the enumerable. * * @param mixed $key * @param mixed $operator * @param mixed $value * @return bool */ public function doesntContain($key, $operator = null, $value = null) { } /** * Cross join the given iterables, returning all possible permutations. * * @param array ...$arrays * @return static */ public function crossJoin(...$arrays) { } /** * Count the number of items in the collection by a field or using a callback. * * @param callable|string $countBy * @return static */ public function countBy($countBy = null) { } /** * Get the items that are not present in the given items. * * @param mixed $items * @return static */ public function diff($items) { } /** * Get the items that are not present in the given items, using the callback. * * @param mixed $items * @param callable $callback * @return static */ public function diffUsing($items, callable $callback) { } /** * Get the items whose keys and values are not present in the given items. * * @param mixed $items * @return static */ public function diffAssoc($items) { } /** * Get the items whose keys and values are not present in the given items, using the callback. * * @param mixed $items * @param callable $callback * @return static */ public function diffAssocUsing($items, callable $callback) { } /** * Get the items whose keys are not present in the given items. * * @param mixed $items * @return static */ public function diffKeys($items) { } /** * Get the items whose keys are not present in the given items, using the callback. * * @param mixed $items * @param callable $callback * @return static */ public function diffKeysUsing($items, callable $callback) { } /** * Retrieve duplicate items. * * @param callable|string|null $callback * @param bool $strict * @return static */ public function duplicates($callback = null, $strict = false) { } /** * Retrieve duplicate items using strict comparison. * * @param callable|string|null $callback * @return static */ public function duplicatesStrict($callback = null) { } /** * Get all items except for those with the specified keys. * * @param mixed $keys * @return static */ public function except($keys) { } /** * Run a filter over each of the items. * * @param callable|null $callback * @return static */ public function filter(?callable $callback = null) { } /** * Get the first item from the enumerable passing the given truth test. * * @param callable|null $callback * @param mixed $default * @return mixed */ public function first(?callable $callback = null, $default = null) { } /** * Get a flattened list of the items in the collection. * * @param int|float $depth * @return static */ public function flatten($depth = INF) { } /** * Flip the items in the collection. * * @return static */ public function flip() { } /** * Get an item by key. * * @param mixed $key * @param mixed $default * @return mixed */ public function get($key, $default = null) { } /** * Group an associative array by a field or using a callback. * * @param array|callable|string $groupBy * @param bool $preserveKeys * @return static */ public function groupBy($groupBy, $preserveKeys = false) { } /** * Key an associative array by a field or using a callback. * * @param callable|string $keyBy * @return static */ public function keyBy($keyBy) { } /** * Determine if an item exists in the collection by key. * * @param mixed $key * @return bool */ public function has($key) { } /** * Determine if any of the keys exist in the collection. * * @param mixed $key * @return bool */ public function hasAny($key) { } /** * Concatenate values of a given key as a string. * * @param string $value * @param string|null $glue * @return string */ public function implode($value, $glue = null) { } /** * Intersect the collection with the given items. * * @param mixed $items * @return static */ public function intersect($items) { } /** * Intersect the collection with the given items by key. * * @param mixed $items * @return static */ public function intersectByKeys($items) { } /** * Determine if the items are empty or not. * * @return bool */ public function isEmpty() { } /** * Determine if the collection contains a single item. * * @return bool */ public function containsOneItem() { } /** * Join all items from the collection using a string. The final items can use a separate glue string. * * @param string $glue * @param string $finalGlue * @return string */ public function join($glue, $finalGlue = '') { } /** * Get the keys of the collection items. * * @return static */ public function keys() { } /** * Get the last item from the collection. * * @param callable|null $callback * @param mixed $default * @return mixed */ public function last(?callable $callback = null, $default = null) { } /** * Get the values of a given key. * * @param string|array $value * @param string|null $key * @return static */ public function pluck($value, $key = null) { } /** * Run a map over each of the items. * * @param callable $callback * @return static */ public function map(callable $callback) { } /** * Run a dictionary map over the items. * * The callback should return an associative array with a single key/value pair. * * @param callable $callback * @return static */ public function mapToDictionary(callable $callback) { } /** * Run an associative map over each of the items. * * The callback should return an associative array with a single key/value pair. * * @param callable $callback * @return static */ public function mapWithKeys(callable $callback) { } /** * Merge the collection with the given items. * * @param mixed $items * @return static */ public function merge($items) { } /** * Recursively merge the collection with the given items. * * @param mixed $items * @return static */ public function mergeRecursive($items) { } /** * Create a collection by using this collection for keys and another for its values. * * @param mixed $values * @return static */ public function combine($values) { } /** * Union the collection with the given items. * * @param mixed $items * @return static */ public function union($items) { } /** * Create a new collection consisting of every n-th element. * * @param int $step * @param int $offset * @return static */ public function nth($step, $offset = 0) { } /** * Get the items with the specified keys. * * @param mixed $keys * @return static */ public function only($keys) { } /** * Push all of the given items onto the collection. * * @param iterable $source * @return static */ public function concat($source) { } /** * Get one or a specified number of items randomly from the collection. * * @param int|null $number * @return static|mixed * * @throws \InvalidArgumentException */ public function random($number = null) { } /** * Replace the collection items with the given items. * * @param mixed $items * @return static */ public function replace($items) { } /** * Recursively replace the collection items with the given items. * * @param mixed $items * @return static */ public function replaceRecursive($items) { } /** * Reverse items order. * * @return static */ public function reverse() { } /** * Search the collection for a given value and return the corresponding key if successful. * * @param mixed $value * @param bool $strict * @return mixed */ public function search($value, $strict = false) { } /** * Shuffle the items in the collection. * * @param int|null $seed * @return static */ public function shuffle($seed = null) { } /** * Create chunks representing a "sliding window" view of the items in the collection. * * @param int $size * @param int $step * @return static */ public function sliding($size = 2, $step = 1) { } /** * Skip the first {$count} items. * * @param int $count * @return static */ public function skip($count) { } /** * Skip items in the collection until the given condition is met. * * @param mixed $value * @return static */ public function skipUntil($value) { } /** * Skip items in the collection while the given condition is met. * * @param mixed $value * @return static */ public function skipWhile($value) { } /** * Get a slice of items from the enumerable. * * @param int $offset * @param int|null $length * @return static */ public function slice($offset, $length = null) { } /** * Split a collection into a certain number of groups. * * @param int $numberOfGroups * @return static */ public function split($numberOfGroups) { } /** * Get the first item in the collection, but only if exactly one item exists. Otherwise, throw an exception. * * @param mixed $key * @param mixed $operator * @param mixed $value * @return mixed * * @throws \FluentCart\Framework\Support\ItemNotFoundException * @throws \FluentCart\Framework\Support\MultipleItemsFoundException */ public function sole($key = null, $operator = null, $value = null) { } /** * Get the first item in the collection but throw an exception if no matching items exist. * * @param mixed $key * @param mixed $operator * @param mixed $value * @return mixed * * @throws \FluentCart\Framework\Support\ItemNotFoundException */ public function firstOrFail($key = null, $operator = null, $value = null) { } /** * Chunk the collection into chunks of the given size. * * @param int $size * @return static */ public function chunk($size) { } /** * Split a collection into a certain number of groups, and fill the first groups completely. * * @param int $numberOfGroups * @return static */ public function splitIn($numberOfGroups) { } /** * Chunk the collection into chunks with a callback. * * @param callable $callback * @return static */ public function chunkWhile(callable $callback) { } /** * Sort through each item with a callback. * * @param callable|null|int $callback * @return static */ public function sort($callback = null) { } /** * Sort items in descending order. * * @param int $options * @return static */ public function sortDesc($options = SORT_REGULAR) { } /** * Sort the collection using the given callback. * * @param callable|string $callback * @param int $options * @param bool $descending * @return static */ public function sortBy($callback, $options = SORT_REGULAR, $descending = false) { } /** * Sort the collection in descending order using the given callback. * * @param callable|string $callback * @param int $options * @return static */ public function sortByDesc($callback, $options = SORT_REGULAR) { } /** * Sort the collection keys. * * @param int $options * @param bool $descending * @return static */ public function sortKeys($options = SORT_REGULAR, $descending = false) { } /** * Sort the collection keys in descending order. * * @param int $options * @return static */ public function sortKeysDesc($options = SORT_REGULAR) { } /** * Sort the collection keys using a callback. * * @param callable $callback * @return static */ public function sortKeysUsing(callable $callback) { } /** * Take the first or last {$limit} items. * * @param int $limit * @return static */ public function take($limit) { } /** * Take items in the collection until the given condition is met. * * @param mixed $value * @return static */ public function takeUntil($value) { } /** * Take items in the collection until a given point in time. * * @param \DateTimeInterface $timeout * @return static */ public function takeUntilTimeout(\DateTimeInterface $timeout) { } /** * Take items in the collection while the given condition is met. * * @param mixed $value * @return static */ public function takeWhile($value) { } /** * Pass each item in the collection to the given callback, lazily. * * @param callable $callback * @return static */ public function tapEach(callable $callback) { } /** * Convert a flatten "dot" notation array into an expanded array. * * @return static */ public function undot() { } /** * Return only unique items from the collection array. * * @param string|callable|null $key * @param bool $strict * @return static */ public function unique($key = null, $strict = false) { } /** * Reset the keys on the underlying array. * * @return static */ public function values() { } /** * Zip the collection together with one or more arrays. * * e.g. new LazyCollection([1, 2, 3])->zip([4, 5, 6]); * => [[1, 4], [2, 5], [3, 6]] * * @param mixed ...$items * @return static */ public function zip($items) { } /** * Pad collection to the specified length with a value. * * @param int $size * @param mixed $value * @return static */ public function pad($size, $value) { } /** * Get the values iterator. * * @return \Traversable */ #[\ReturnTypeWillChange] public function getIterator() { } /** * Count the number of items in the collection. * * @return int */ #[\ReturnTypeWillChange] public function count() { } /** * Make an iterator from the given source. * * @param mixed $source * @return \Traversable */ protected function makeIterator($source) { } /** * Explode the "value" and "key" arguments passed to "pluck". * * @param string|array $value * @param string|array|null $key * @return array */ protected function explodePluckParameters($value, $key) { } /** * Pass this lazy collection through a method on the collection class. * * @param string $method * @param array $params * @return static */ protected function passthru($method, array $params) { } /** * Get the current time. * * @return int */ protected function now() { } } class Locale { /** * Locale identifier. * * @var string */ protected $locale = 'en_US'; /** * Locale info. * * @var \stdClass */ protected $localeInfo = null; /** * English month names for keys. * @var array */ protected static $monthNames = ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December']; /** * English weekday names for keys. * @var array */ protected static $weekdayNames = ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday']; /** * Construct the class. * * @param int|string|null $userIdOrLocale */ public function __construct($userIdOrLocale = null) { } /** * Load the locale info of a user. * * @param int|null $userIdOrLocale * @return \stdClass */ protected function populateLocaleInfo($userIdOrLocale = null) { } /** * Build a minimal en_US-style locale info object for use when WP's * i18n stack isn't available (plugin activation, early CLI, etc.). * Matches the shape produced by the full populateLocaleInfo() so * downstream callers don't need to know the difference. * * @param int|string|null $userIdOrLocale * @return \stdClass */ protected function buildFallbackLocaleInfo($userIdOrLocale = null) { } /** * Switch the locale for the user. * * @param string $locale * @return void */ public function switch($locale) { } /** * Restore to the user's original locale. * * @return void */ public function restore() { } /** * Get specific weekday. * * @param int $day 0-6 * @return string */ public function getWeekday($day) { } /** * Get specific weekday. * * @param int $day 0-6 * @return string */ public function getWeekdayName($day) { } /** * Get weekday initials (Short form). * * @param string $day * @return string */ public function getWeekdayInitial($day) { } /** * Get weekday abbr (Short form). * * @param string $day * @return string */ public function getWeekdayAbbrev($day) { } /** * Get specific month. * * @param int $month 0-11 * @return string */ public function getMonth($month) { } /** * Get specific month. * * @param int $month 0-11 * @return string */ public function getMonthName($month) { } /** * Get specific month. * * @param int $month 01-12 * @return string */ public function getShortMonthName($month) { } /** * Get specific genitive month. * * @param int $month 01-12 * @return string */ public function getMonthGenitive($month) { } /** * Get month abbr (Short form). * * @param string $month * @return string */ public function getMonthAbbrev($month) { } /** * Get meridiem. * * @param string $period * @return string */ public function getMeridiem($period) { } /** * Get tetx direction. * * @return string */ public function getTextDirection() { } /** * Get number format. * * @return string */ public function getNumberFormat() { } /** * Get list item separator. * * @return string */ public function getListItemSeparator() { } /** * Get word count type. * * @return string */ public function getWordCountType() { } /** * Get start day number/name of the week * * @return int */ public function getStartDayOfWeek($name = false) { } /** * Get start day name of the week * * @return int */ public function getStartDayNameOfWeek() { } /** * Checks if current locale is RTL. * * @since 3.0.0 * @return bool Whether locale is RTL. */ public function isRtl() { } /** * Resolve the month number. * * @param int|string $month * @return int */ public function resolveMonthNumber($month) { } /** * Resolve the month name. * * @param int|string $month * @return string */ public function resolveMonthName($month) { } /** * Resolve the weekday key. * * @param int|string $day * @return int */ public function resolveWeekdayKey($day) { } /** * Dynamic property accessor. * * @param string $key * @return mixed */ public function __get($key) { } /** * Get the info as array. * * @return array */ public function toArray() { } /** * Get the locale identifier. * * @return string */ public function toString() { } /** * Get the locale identifier. * * @return string */ public function __toString() { } /** * Alternative constructor. * * @param int|null $userIdOrLocale * @return $this */ public static function init($userIdOrLocale = null) { } /** * Load the locale info of a user. * * @param int|null $userIdOrLocale * @return \stdClass */ public static function getInfo($userIdOrLocale = null) { } } class Mail { protected array $to = []; protected array $cc = []; protected array $bcc = []; protected string $from = ''; protected string $fromName = ''; protected string $subject = ''; protected string $body = ''; protected array $headers = []; protected array $attachments = []; protected string $contentType = 'text/html'; /** * Set one or more recipients. * * @param string|array $emails * @return $this */ public function to($emails) { } /** * Set the email sender. * * @param string $email * @param string|null $name * @return $this */ public function from($email, $name = null) { } /** * Set one or more CC recipients. * * @param string|array $emails * @return $this */ public function cc($emails) { } /** * Set one or more BCC recipients. * * @param string|array $emails * @return $this */ public function bcc($emails) { } /** * Set the email subject. * * @param string $subject * @return $this */ public function subject($subject) { } /** * Set the email body (HTML or plain text). * * @param string $body * @return $this */ public function body($body) { } /** * Set the body from a PHP template file with optional data. * * @param string $templatePath * @param array $data * @return $this */ public function view($templatePath, $data = []) { } /** * Add or override headers. * * @param array|string $headers * @param string|null $value * @return $this */ public function withHeader($headers, $value = null) { } /** * Set Content-Type header (default is text/html). * * @param string $contentType * @return $this */ public function contentType($contentType) { } /** * Attach one or more files. * * @param string|array $paths * @return $this */ public function attach($paths) { } /** * Prepare headers for wp_mail. * * @return array */ protected function prepareHeaders() { } /** * Send the email immediately. * * @return bool */ public function send() { } /** * Static helper to start a new mail instance. * * @return static */ public static function make() { } } class MathException extends \RuntimeException { //... } class Media { /** * Turn off reading exif. * * @return $this */ public function withoutExif() { } /** * Turn off creating image sizes. * * @return $this */ public function withoutSizes() { } /** * Turn off reading exif and creating image sizes. * * @return $this */ public function withoutExifAndSizes() { } /** * Sideload a local file array (e.g. from $_FILES) or a remote file URL. * * @param array|string $resource File array from $_FILES or remote file URL * @param int|null $postId Optional post ID to attach the media to * @param string|null $filename Optional file name for remote URL * * @return array * @throws \InvalidArgumentException * @throws \RuntimeException */ public function upload($resource, $postId = 0, $filename = null) { } /** * Prepare the file array to use with media_handle_sideload. * * @param array|string $resource File array from $_FILES or remote file URL * @param string|null $filename Optional file name for remote URL * * @return array * @throws \InvalidArgumentException * @throws \RuntimeException */ protected function prepareMedia($resource, $filename = null) { } /** * Ensure required WordPress media functions are loaded. * * @return void */ protected function includeMediaFunctions() { } /** * Checks if a string is base64 encoded. * * @param string $string * @return boolean */ protected function isBase64($string) { } /** * Saves a base64 encoded image to a file and returns the URL. * * @param string $imageData The base64 encoded image string. * @param string $extension Optional. The image file extension. * @return string The URL of the saved image on success. * @throws \RuntimeException If the image could not be saved. */ public function base64ToUrl($imageData, $extension = 'png') { } /** * Delete the temporary file and throw an exception on failure. * * @param string $tmp * @param int|\WP_Error $attachmentId * @return void */ protected function cleanup($tmp, $attachmentId) { } /** * Generate and save attachment metadata (image sizes, dimensions, etc.) * * @param int $attachmentId * @return array */ public function generateMetadata($attachmentId) { } /** * Update attachment title, caption, description, alt text, etc. * * @param int $attachmentId * @param array $fields * @return void */ public function updateAttachmentFields($attachmentId, array $fields = []) { } /** * Get detailed info about an attachment. * * @param int $attachmentId * @return array */ public function getAttachmentArray($attachmentId) { } /** * Delete an attachment. * * @param int $attachmentId * @param boolean $forceDelete * @return \WP_Post|false|null Post data on success, false/null on failure. */ public function delete($attachmentId, $forceDelete = false) { } /** * Set an image as featured for a post. * * @param int $attachmentId * @param int $postId * @return int|bool */ public function setAsFeaturedImage($attachmentId, $postId) { } /** * Find an attachment by its file name. * * @param string $name Filename to search for (can be partial). * @return array|null Attachment data array or null if not found. */ public function findByFilename($name) { } /** * Get all media attachments associated with a specific post. * * @param int $postId * @return array List of attachment data arrays. */ public function findByPostId($postId) { } /** * Find attachments by MIME type. * * @param string $mimeType e.g. 'image/jpeg', 'application/pdf', etc. * @return array List of attachment data arrays. */ public function findByMimeType($mimeType) { } /** * Find attachments uploaded within a date range. * * @param string $startDate Format: 'YYYY-MM-DD' * @param string $endDate Format: 'YYYY-MM-DD' * @return array List of attachment data arrays. */ public function findByDateRange($startDate, $endDate) { } } class MediaUploader { /** * @var bool Whether to disable EXIF reading during upload */ protected static bool $withoutExif = false; /** * @var bool Whether to disable generating * intermediate image sizes during upload */ protected static bool $withoutSizes = false; /** * Disable EXIF reading during upload. * * @return static */ public static function withoutExif() { } /** * Disable generating intermediate image sizes during upload. * * @return static */ public static function withoutSizes() { } /** * Disable both EXIF reading and image sizes during upload. * * @return static */ public static function withoutExifAndSizes() { } /** * Upload a local file array or remote URL, optionally disabling EXIF or image sizes. * * @param array|string $resource File array from $_FILES or remote URL * @param int $postId Optional post ID to attach media to * @param string|null $filename Optional filename for remote URLs * * @return array */ public static function upload($resource, $postId = 0, $filename = null) { } } class MultipleItemsFoundException extends \RuntimeException { } class Number { /** * Format a number depending on the locale * * @param int|float $value * @param integer $dec * @return string Formatted number * @see https://developer.wordpress.org/reference/functions/number_format_i18n */ public static function format($value, $dec = 0) { } /** * Format a number as int * * @param int|float $val * @return int */ public static function toInt($val) { } /** * Cast to float, optionally rounding to $dec decimals. * * Default rounds to 2 decimals (preserved for backwards compatibility). * Pass $dec = null to skip rounding entirely and return the raw cast. * * @param int|float|string $val * @param int|null $dec Decimal places to round to, or null to skip rounding * @return float */ public static function toFloat($val, $dec = 2) { } /** * Convert a value to bool. * * Standard PHP cast semantics: 0, 0.0, '', '0' → false; everything else → true. * * @param mixed $val * @return bool */ public static function toBool($val) { } /** * Format a number to currency depending on the locale * * @param int|float $value * @param array $options * @return string Formatted number with currency symbol */ public static function toCurrency($value, $options = []) { } /** * Notation to numbers. * * This function transforms the php.ini notation * for numbers (like '2M') to an integer. * * @param string $num * @return int */ public static function notationToNum($num) { } /** * Calculates the percentage/$percent from the $value/$total * * @param int|float $percent * @param int|float $total * @return int|float */ public static function getPercentage($percent, $total) { } /** * Calculate what percentage $value is of $total. * * Returns 0.0 when $total is 0 (avoids divide-by-zero) — useful for * dashboards and reports where "0 out of 0" should display as 0%. * * Examples: * percentageOf(50, 200) → 25.0 * percentageOf(150, 100) → 150.0 * percentageOf(0, 0) → 0.0 * * @param int|float|string $value * @param int|float|string $total * @return float */ public static function percentageOf($value, $total) { } /** * Converts a number of bytes to human readable format * using the maximum unit available to convert the bytes. * * @param int|float $bytes * @param integer $decimals * @return string Formatted size units of bytes, i.e: 1mb/1gb e.t.c. */ public static function formatBytes($bytes, $decimals = 0) { } /** * Makes an ordinal number from the integer. * * Floats are truncated toward zero (2.7 → 2nd, -2.7 → -2nd). * Negatives keep their sign (-21 → -21st, -11 → -11th). * Non-numeric input is returned unchanged. * * @param int|float|string $number * @return string The ordinal number, i.e: 1st, 5th e.t.c. */ public static function toOrdinal($number) { } /** * Convert the number to its human readable equivalent. * * @param int $number * @param int $precision * @param int|null $maxPrecision * @return string */ public static function forHumans($number, $precision = 0, $maxPrecision = null, $abbr = false) { } /** * Convert the number to its human readable equivalent. * * @param int $number * @param int $precision * @param int|null $maxPrecision * @param array $units * @return string */ protected static function summarize($number, $precision = 0, $maxPrecision = null, $units = []) { } } class Once { protected $trace = null; protected $zeroStack = null; public function __construct(array $trace) { } public function getArguments() { } public function getFunctionName() { } public function getObjectName() { } public function getObject() { } public function getHash($strict) { } protected function staticCall() { } protected function globalFunction() { } public static function call(callable $callback, $strict = false) { } } class Path { /** * Get WordPress dir path. * * @return string Abs WP dir path */ public static function wp() { } /** * Get WordPress dir path. * * @return string Abs WP dir path */ public static function plugin($suffix = '') { } /** * Get plugin dir path. * * @param string $segment folder name (i.e: app.Models) * @param bool $isFile whether the segment is for filename. * @return string Abs plugin dir path */ public static function of($segment, $isFile = false) { } /** * Determines whether the given path is an absolute path. * * @param string $path The path to check. * @return bool True if the path is absolute, false otherwise. * @see https://developer.wordpress.org/reference/functions/path_is_absolute */ public static function isAbsolute($path) { } /** * Determines whether the given path is an relative path. * * @param string $path The path to check. * @return bool True if the path is relative, false otherwise. */ public static function isRelative($path) { } /** * Joins two filesystem paths together. * * For example, 'give me $path relative to $base'. * If the $path is absolute, then the * full path will be returned. * * @param string $base Base path. * @param string $path Path relative to $base. * @return string The path with the base or absolute path. * @see https://developer.wordpress.org/reference/functions/path_join */ public static function join($base, $path) { } /** * Normalizes a filesystem path. * * On windows systems, replaces backslashes with forward slashes * and forces upper-case drive letters. * Allows for two leading slashes for Windows network shares, but * ensures that all other duplicate slashes are reduced to a single. * * @param string $path Path to normalize. * @return string Normalized path. * @see https://developer.wordpress.org/reference/functions/wp_normalize_path */ public static function normalize($path) { } /** * Implodes path segments using the appropriate directory separator. * * @param string[] $paths * @return string */ public static function implode(...$paths) { } /** * Resolves an absolute path from one or more path segments. * * @param string[] $paths Path segments to resolve. * @return string The resolved absolute path. */ public static function resolve(...$paths) { } /** * Returns the directory name of a path. * * @param string $path The path. * @return string The directory name. */ public static function dirname($path) { } /** * Returns the last portion of a path, optionally removing a provided extension. * * @param string $path The path. * @param string|null $suffix Optional extension to remove. * @return string The last portion of the path. */ public static function basename($path, $suffix = null) { } /** * Returns the extension of the path. * * @param string $path The path. * @return string The extension. */ public static function extname($path) { } /** * Finds the closest dir/file from upward. * * @param string $path * @return string|null */ public static function closest($path, $limit = 25) { } /** * Breaks down a path into an an array. * * @param string $path The path to parse. * @return array An associative array with path information. */ public static function parse($path) { } } class Pipeline { /** * The container implementation. * * @var \FluentCart\Framework\Container\Container */ protected $container; /** * The object being passed through the pipeline. * * @var mixed */ protected $passable; /** * The array of class pipes. * * @var array */ protected $pipes = []; /** * The method to call on each pipe. * * @var string */ protected $method = 'handle'; /** * Create a new class instance. * * @param \FluentCart\Framework\Container\Container|null $container * @return void */ public function __construct(?\FluentCart\Framework\Container\Container $container = null) { } /** * Set the object being sent through the pipeline. * * @param mixed $passable * @return $this */ public function send($passable) { } /** * Set the array of pipes. * * @param array|mixed $pipes * @return $this */ public function through($pipes) { } /** * Set the method to call on the pipes. * * @param string $method * @return $this */ public function via($method) { } /** * Run the pipeline with a final destination callback. * * @param \Closure $destination * @return mixed */ public function then(\Closure $destination) { } /** * Run the pipeline and return the result. * * @return mixed */ public function thenReturn() { } /** * Get the final piece of the Closure onion. * * @param \Closure $destination * @return \Closure */ protected function prepareDestination(\Closure $destination) { } /** * Get a Closure that represents a slice of the application onion. * * @return \Closure */ protected function carry() { } /** * Parse full pipe string to get name and parameters. * * @param string $pipe * @return array */ protected function parsePipeString($pipe) { } /** * Get the array of configured pipes. * * @return array */ protected function pipes() { } /** * Get the container instance. * * @return \FluentCart\Framework\Container\Container * * @throws \RuntimeException */ protected function getContainer() { } /** * Set the container instance. * * @param \FluentCart\Framework\Container\Container $container * @return $this */ public function setContainer(\FluentCart\Framework\Container\Container $container) { } /** * Handle the value returned from each pipe before passing it to the next. * * @param mixed $carry * @return mixed */ protected function handleCarry($carry) { } /** * Handle the given exception. * * @param mixed $passable * @param \Throwable $e * @return mixed * * @throws \Throwable */ protected function handleException($passable, \Throwable $e) { } } class Pluralizer { /** * Plural word form rules. * * @var array */ public static array $plural = ['/(quiz)$/i' => '$1zes', '/^(ox)$/i' => '$1en', '/([ml])ouse$/i' => '$1ice', '/(matr|vert|ind)(?:ix|ex)$/i' => '$1ices', '/(stoma|epo|monar|matriar|patriar|oligar|eunu)ch$/i' => '$1chs', '/(x|ch|ss|sh)$/i' => '$1es', '/([^aeiouy]|qu)y$/i' => '$1ies', '/(hive)$/i' => '$1s', '/(?:([^f])fe|([lr])f)$/i' => '$1$2ves', '/(shea|lea|loa|thie)f$/i' => '$1ves', '/sis$/i' => 'ses', '/([ti])um$/i' => '$1a', '/(torped|embarg|tomat|potat|ech|her|vet)o$/i' => '$1oes', '/(bu)s$/i' => '$1ses', '/(alias)$/i' => '$1es', '/(fung)us$/i' => '$1i', '/(ax|test)is$/i' => '$1es', '/(us)$/i' => '$1es', '/s$/i' => 's', '/$/' => 's']; /** * Singular word form rules. * * @var array */ public static array $singular = ['/(quiz)zes$/i' => '$1', '/(matr)ices$/i' => '$1ix', '/(vert|vort|ind)ices$/i' => '$1ex', '/^(ox)en$/i' => '$1', '/(alias)es$/i' => '$1', '/(octop|vir|fung)i$/i' => '$1us', '/(cris|ax|test)es$/i' => '$1is', '/(shoe)s$/i' => '$1', '/(o)es$/i' => '$1', '/(bus)es$/i' => '$1', '/([ml])ice$/i' => '$1ouse', '/(x|ch|ss|sh)es$/i' => '$1', '/(m)ovies$/i' => '$1ovie', '/(s)eries$/i' => '$1eries', '/([^aeiouy]|qu)ies$/i' => '$1y', '/([lr])ves$/i' => '$1f', '/(tive)s$/i' => '$1', '/(hive)s$/i' => '$1', '/(li|wi|kni)ves$/i' => '$1fe', '/(shea|loa|lea|thie)ves$/i' => '$1f', '/(^analy)ses$/i' => '$1sis', '/((a)naly|(b)a|(d)iagno|(p)arenthe|(p)rogno|(s)ynop|(t)he)ses$/i' => '$1$2sis', '/([ti])a$/i' => '$1um', '/(n)ews$/i' => '$1ews', '/(h|bl)ouses$/i' => '$1ouse', '/(corpse)s$/i' => '$1', '/(gallows|headquarters)$/i' => '$1', '/(us)es$/i' => '$1', '/(us|ss)$/i' => '$1', '/s$/i' => '']; /** * Irregular word forms. * * @var array Singular to plural mappings */ public static array $irregular = ['child' => 'children', 'corpus' => 'corpora', 'criterion' => 'criteria', 'foot' => 'feet', 'freshman' => 'freshmen', 'goose' => 'geese', 'genus' => 'genera', 'human' => 'humans', 'man' => 'men', 'woman' => 'women', 'mouse' => 'mice', 'louse' => 'lice', 'person' => 'people', 'tooth' => 'teeth', 'ox' => 'oxen', 'wolf' => 'wolves', 'calf' => 'calves', 'leaf' => 'leaves', 'loaf' => 'loaves', 'life' => 'lives', 'wife' => 'wives', 'knife' => 'knives', 'self' => 'selves', 'thief' => 'thieves', 'datum' => 'data', 'bacterium' => 'bacteria', 'medium' => 'media', 'analysis' => 'analyses', 'diagnosis' => 'diagnoses', 'parenthesis' => 'parentheses', 'hypothesis' => 'hypotheses', 'thesis' => 'theses', 'crisis' => 'crises', 'oasis' => 'oases', 'phenomenon' => 'phenomena', 'nucleus' => 'nuclei', 'radius' => 'radii', 'stimulus' => 'stimuli', 'syllabus' => 'syllabi', 'index' => 'indices', 'appendix' => 'appendices', 'matrix' => 'matrices', 'axis' => 'axes', 'alumnus' => 'alumni', 'formula' => 'formulae', 'move' => 'moves', 'tax' => 'taxes', 'tech' => 'techs', 'cactus' => 'cacti', 'fungus' => 'fungi', 'focus' => 'foci', 'ellipsis' => 'ellipses', 'basis' => 'bases', 'vertebra' => 'vertebrae', 'stratum' => 'strata', 'hero' => 'heroes', 'echo' => 'echoes', 'potato' => 'potatoes', 'tomato' => 'tomatoes']; /** * Uncountable word forms. * * @var string[] */ public static array $uncountable = ['advice', 'air', 'alcohol', 'art', 'bison', 'bread', 'butter', 'cheese', 'chassis', 'clothing', 'commerce', 'compensation', 'coreopsis', 'data', 'deer', 'dust', 'education', 'electricity', 'equipment', 'evidence', 'fashion', 'feedback', 'fish', 'flour', 'food', 'furniture', 'garbage', 'gold', 'grass', 'happiness', 'homework', 'honesty', 'information', 'jewelry', 'knowledge', 'luggage', 'mathematics', 'meat', 'money', 'moose', 'music', 'news', 'nutrition', 'offspring', 'oil', 'oxygen', 'patience', 'permission', 'plankton', 'poetry', 'police', 'progress', 'rain', 'rice', 'salt', 'series', 'sheep', 'shopping', 'software', 'species', 'sugar', 'swine', 'tea', 'traffic', 'transportation', 'water', 'weather', 'wildlife', 'wood', 'wool', 'work']; /** * Cache for plural inflections. * * @var array */ protected static array $pluralCache = []; /** * Cache for singular inflections. * * @var array */ protected static array $singularCache = []; /** * Convert a plural word to its singular form. * * @param string $value * @return string */ public static function singular(string $value): string { } /** * Convert a singular word to its plural form. * * @param string $value * @param int $count Number of items; if 1, returns singular. * @return string */ public static function plural(string $value, int $count = 2): string { } /** * Perform inflection (singular or plural) on a word. * * @param string $value * @param array $source * @param array $irregulars * @return string|null */ protected static function inflect(string $value, array $source, array $irregulars): ?string { } /** * Check if a word is uncountable. * * @param string $value * @return bool */ protected static function uncountable(string $value): bool { } /** * Match the case of a word to another word's case. * * @param string $value * @param string $comparison * @return string */ protected static function matchCase(string $value, string $comparison): string { } /** * Check if a word is plural. * * @param string $word * @return bool */ public static function isPlural(string $word): bool { } /** * Check if a word is singular. * * @param string $word * @return bool */ public static function isSingular(string $word): bool { } /** * Pluralize a word only if needed based on count. * * @param string $word * @param int $count * @return string */ public static function pluralizeIfNeeded(string $word, int $count): string { } /** * Add a new irregular singular/plural pair. * * @param string $singular * @param string $plural * @return void */ public static function addIrregular(string $singular, string $plural): void { } /** * Add a new uncountable word. * * @param string $word * @return void */ public static function addUncountable(string $word): void { } /** * Clear the plural and singular caches. * * @return void */ public static function clearCache(): void { } } class Reflector { /** * This is a PHP 7.4 compatible implementation of is_callable. * * @param mixed $var * @param bool $syntaxOnly * @return bool */ public static function isCallable($var, $syntaxOnly = false) { } /** * Get the class name of the given parameter's type, if possible. * * @param \ReflectionParameter $parameter * @return string|null */ public static function getParameterClassName($parameter) { } /** * Get the class names of the given parameter's type, including union types. * * @param \ReflectionParameter $parameter * @return array */ public static function getParameterClassNames($parameter) { } /** * Get the given type's class name. * * @param \ReflectionParameter $parameter * @param \ReflectionNamedType $type * @return string */ protected static function getTypeName($parameter, $type) { } /** * Determine if the parameter's type is a subclass of the given type. * * @param \ReflectionParameter $parameter * @param string $className * @return bool */ public static function isParameterSubclassOf($parameter, $className) { } } class Sanitizer { /** * Sanitize an email address. * * @param string $arg * @return string */ public static function sanitizeEmail($arg) { } /** * Sanitize a file name. * * @param string $arg * @return string */ public static function sanitizeFileName($arg) { } /** * Sanitize an HTML class. * * @param string $arg * @return string */ public static function sanitizeHtmlClass($arg) { } /** * Sanitize a key. * * @param string $arg * @return string */ public static function sanitizeKey($arg) { } /** * Sanitize meta data. * * @param string $metaKey Meta key. * @param mixed $metaValue Meta value to sanitize. * @param string $objectType Type of object the meta is registered to * (e.g., 'post', 'term', 'user'). * @param string $objectSubtype Optional. Subtype of the object type (e.g., custom post type). Default ''. * * @return mixed Sanitized meta value. */ public static function sanitizeMeta($metaKey, $metaValue, $objectType = 'post', $objectSubtype = '') { } /** * Sanitize a mime type. * * @param string $arg * @return string */ public static function sanitizeMimeType($arg) { } /** * Sanitize an option value. * * @param string $option The option name. * @param mixed $value The option value to sanitize. * @return mixed */ public static function sanitizeOption(string $option, $value) { } /** * Sanitize an SQL ORDER BY clause. * * @param string $arg * @return string */ public static function sanitizeSqlOrderby($arg) { } /** * Sanitize an integer. * * @param string $arg * @return integer */ public static function sanitizeInt($arg) { } /** * Sanitize an float. * * @param string $arg * @return float */ public static function sanitizeFloat($arg) { } /** * Sanitize a text field. * * @param string $arg * @return string */ public static function sanitizeTextField($arg) { } /** * Sanitize a text field. * * @param string $arg * @return string */ public static function sanitizeText($arg) { } /** * Sanitize a title. * * @param string $arg * @return string */ public static function sanitizeTitle($arg) { } /** * Sanitize a title for a query. * * @param string $arg * @return string */ public static function sanitizeTitleForQuery($arg) { } /** * Sanitize a title with dashes. * * @param string $arg * @return string */ public static function sanitizeTitleWithDashes($arg) { } /** * Sanitize a username. * * @param string $arg * @return string */ public static function sanitizeUser($arg) { } /** * Filter content through kses for posts. * * @param string $arg * @return string */ public static function wpFilterPostKses($arg) { } /** * Filter content through kses for no HTML. * * @param string $arg * @return string */ public static function wpFilterNohtmlKses($arg) { } /** * Escape HTML attribute. * * @param string $arg * @return string */ public static function escAttr($arg) { } /** * Escape HTML. * * @param string $arg * @return string */ public static function escHtml($arg) { } /** * Escape JavaScript. * * @param string $arg * @return string */ public static function escJs($arg) { } /** * Escape textarea content. * * @param string $arg * @return string */ public static function escTextarea($arg) { } /** * Escape URL. * * @param string $arg * @return string */ public static function escUrl($arg) { } /** * Escape URL (raw). * * @param string $arg * @return string */ public static function escUrlRaw($arg) { } /** * Escape XML. * * @param string $arg * @return string */ public static function escXml($arg) { } /** * Sanitize content with KSES. * * @param string $string Content to sanitize. * @param array|string $allowedHtml Allowed HTML tags. Can be an array of * tags/attributes,or a context string accepted by wp_kses_allowed_html(). * Defaults to 'post'. * * @return string Sanitized content with only allowed HTML. */ public static function kses($string, $allowedHtml = 'post') { } /** * Kses post content. * * @param string $arg * @return string */ public static function ksesPost($arg) { } /** * Kses data. * * @param string $arg * @return string */ public static function ksesData($arg) { } /** * Escape HTML with translation. * * @param string $arg * @return string */ public static function escHtml__($arg) { } /** * Escape attribute with translation. * * @param string $arg * @return string */ public static function escAttr__($arg) { } /** * Escape HTML and echo. * * @param string $arg * @return void */ public static function escHtmlE($arg) { } /** * Escape attribute and echo. * * @param string $arg * @return void */ public static function escAttrE($arg) { } /** * Escape HTML with translation context. * * @param string $text Text to escape and translate. * @param string $context Context information for translators. * @param string $domain Optional. Text domain. Default 'default'. * @return string */ public static function escHtmlX($text, $context, $domain = 'default') { } /** * Escape attribute with translation context. * * @param string $text Text to escape and translate. * @param string $context Context information for translators. * @param string $domain Optional. Text domain. Default 'default'. * @return string */ public static function escAttrX($text, $context, $domain = 'default') { } /** * Returns a DateTime object. * * @param string $key * @param string|null $format * @param string|null|\DateTimeZone $tz * @return \FluentCart\Framework\Support\DateTime|null */ public static function sanitizeDate($value, $format, $tz) { } /** * Sanitize data based on given rules. * * @param array $data * @param array $rules * @return array */ public static function sanitize($data = [], $rules = []) { } public static function substituteWildcardKeys($array, $field, $data) { } /** * Check and fix if callbacks are given * as: callback1|callback2\callback3. * * @param array|string $callbacks * @return array */ public static function mayBeFixCallbacks($callbacks) { } /** * Get the callback function. * * @param callable|string $callback * @return callable|null */ protected static function getCallback($callback) { } /** * Check if the method exists. * * @param string $method * @return callable|null */ protected static function methodExists($method) { } } class Serializer { /** * Serialize data into the specified format. * * @param mixed $data Data to serialize. * @param string $format Serialization format ('json' or 'php'). * @param int|null $jsonOptions Options for JSON encoding * (default: JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES). * @return string Serialized data. * @throws \InvalidArgumentException If the format is unsupported. */ public static function serialize($data, $format = 'json', $jsonOptions = null) { } /** * Deserialize data from JSON or PHP serialized format. * * @param string $data The serialized data. * @param mixed $option The option: * * - For JSON, true/1 (decode as array), * false/0 (decode as object), default false. * * - For PHP serialized data, an array of allowed * classes or true/false to allow/disallow all classes. * * @return mixed The deserialized data. * @throws \RuntimeException If the data cannot be deserialized. */ public static function deserialize($data, $option = false) { } /** * Check if the data is a valid JSON string. * * @param string $data Data to check. * @return bool True if the data is valid JSON. */ public static function isJson($data) { } /** * Check if the data is a serialized PHP string. * * @param string $data Data to check. * @return bool True if the data is serialized. */ public static function isSerialized($data) { } } class Str { use \FluentCart\Framework\Support\MacroableTrait; /** * The cache of snake-cased words. * * @var array */ protected static $snakeCache = []; /** * The cache of camel-cased words. * * @var array */ protected static $camelCache = []; /** * The cache of studly-cased words. * * @var array */ protected static $studlyCache = []; /** * Get a new stringable object from the given string. * * @param string $string * @return \FluentCart\Framework\Support\Stringable */ public static function of($string) { } /** * Makes an acronum from a string of words * * @param string $string * @param string $delimiter * @return string */ public static function acronym($string, $delimiter = '') { } /** * Return the remainder of a string after the first occurrence of a given value. * * @param string $subject * @param string $search * @return string */ public static function after($subject, $search) { } /** * Return the remainder of a string after the last occurrence of a given value. * * @param string $subject * @param string $search * @return string */ public static function afterLast($subject, $search) { } /** * Transliterate a UTF-8 value to ASCII. * * @param string $value * @return string * @see https://github.com/fzaninotto/Faker/blob/master/src/Faker/Provider/Internet.php#L245 */ public static function ascii($value) { } /** * Transliterate a string to its closest ASCII representation. * * @param string $string * @return string * @see https://github.com/fzaninotto/Faker/blob/master/src/Faker/Provider/Internet.php#L229 */ public static function transliterate($string) { } /** * Get the portion of a string before the first occurrence of a given value. * * @param string $subject * @param string $search * @return string */ public static function before($subject, $search) { } /** * Get the portion of a string before the last occurrence of a given value. * * @param string $subject * @param string $search * @return string */ public static function beforeLast($subject, $search) { } /** * Get the portion of a string between two given values. * * @param string $subject * @param string $from * @param string $to * @return string */ public static function between($subject, $from, $to) { } /** * Get the smallest possible portion of a string between two given values. * * @param string $subject * @param string $from * @param string $to * @return string */ public static function betweenFirst($subject, $from, $to) { } /** * Convert a value to camel case. * * @param string $value * @return string */ public static function camel($value) { } /** * Get the character at the specified index. * * @param string $subject * @param int $index * @return string|false */ public static function charAt($subject, $index) { } /** * Remove the given string(s) if it exists at the start of the haystack. * * @param string $subject * @param string|array $needle * @return string */ public static function chopStart($subject, $needle) { } /** * Remove the given string(s) if it exists at the end of the haystack. * * @param string $subject * @param string|array $needle * @return string */ public static function chopEnd($subject, $needle) { } /** * Determine if a given string contains a given substring. * * @param string $haystack * @param string|iterable $needles * @param bool $ignoreCase * @return bool */ public static function contains($haystack, $needles, $ignoreCase = false) { } /** * Determine if a given string contains all array values. * * @param string $haystack * @param iterable $needles * @param bool $ignoreCase * @return bool */ public static function containsAll($haystack, $needles, $ignoreCase = false) { } /** * Replace consecutive instances of a given character * with a single character in the given string. * * @param string $string * @param string $character * @return string */ public static function deduplicate(string $string, string $character = ' ') { } /** * Determine if a given string ends with a given substring. * * @param string $haystack * @param array|string $needles * @return bool */ public static function endsWith($haystack, $needles) { } /** * Cap a string with a single instance of a given value. * * @param string $value * @param string $cap * @return string */ public static function finish($value, $cap) { } /** * Determine if a given string matches a given pattern. * * @param string|array $pattern * @param string $value * @return bool */ public static function is($pattern, $value) { } /** * Converts a non-boolean value to boolean * @param string|int $str * @return bool|null */ public static function toBool($str) { } /** * Determine if a given string is 7 bit ASCII. * * @param string $value * @return bool * @see https://developer.wordpress.org/reference/classes/requests_idnaencoder/is_ascii/ */ public static function isAscii($value) { } /** * Checks if the word(s) are in capitalized form. * @param string $str * @param boolean $onlyFirst if true, checks only the first charatcer * @return boolean */ public static function isCapitalized($str, $onlyFirst = false) { } /** * Checks if the first character is in capital form. * * @param string $str * @return boolean */ public static function isCapital($str) { } /** * Checks if the chracters are in upper case * * @param string $str * @return boolean */ public static function isUpper($str) { } /** * Checks if the chracters are in lower case * * @param string $str * @return boolean */ public static function isLower($str) { } /** * Checks if two words sounds alike * * @param string $str1 * @param string $str2 * @return bool */ public static function soundsAlike($str1, $str2) { } /** * Checks if two words are similar * * @param string $str1 * @param string $str2 * * @return bool */ public static function isSimilar($str1, $str2, $accuracy = 60) { } /** * Checks if two words are similar * * @param string $str1 * @param string $str2 * * @return bool */ public static function similarityOf($str1, $str2) { } /** * Determine if a given value is valid JSON. * * @param mixed $value * @return bool */ public static function isJson($value) { } /** * Determine if a given value is a valid URL. * * @param mixed $value * @param array $protocols * @return bool */ public static function isUrl($value, array $protocols = []) { } /** * Determine if a given string is a valid UUID. * * @param string $value * @return bool */ public static function isUuid($value) { } /** * Convert a string to kebab case. * * @param string $value * @return string */ public static function kebab($value) { } /** * Return the length of the given string. * * @param string $value * @param string|null $encoding * @return int */ public static function length($value, $encoding = null) { } /** * Limit the number of characters in a string. * * @param string $value * @param int $limit * @param string $end * @param bool $preserveWords * @return string */ public static function limit($value, $limit = 100, $end = '...', $preserveWords = false) { } /** * Convert the given string to lower-case. * * @param string $value * @return string */ public static function lower($value) { } /** * Limit the number of words in a string. * * @param string $value * @param int $words * @param string $end * @return string */ public static function words($value, $words = 100, $end = '...') { } /** * Masks a portion of a string with a repeated character. * * @param string $string * @param string $character * @param int $index * @param int|null $length * @param string $encoding * @return string */ public static function mask($string, $character, $index, $length = null, $encoding = 'UTF-8') { } /** * Get the string matching the given pattern. * * @param string $pattern * @param string $subject * @return string */ public static function match($pattern, $subject) { } /** * Determine if a given string matches a given pattern. * * @param string|iterable $pattern * @param string $value * @return bool */ public static function isMatch($pattern, $value) { } /** * Get the string matching the given pattern. * * @param string $pattern * @param string $subject * @return \FluentCart\Framework\Support\Collection */ public static function matchAll($pattern, $subject) { } /** * Pad both sides of a string with another. * * @param string $value * @param int $length * @param string $pad * @return string */ public static function padBoth($value, $length, $pad = ' ') { } /** * Pad the left side of a string with another. * * @param string $value * @param int $length * @param string $pad * @return string */ public static function padLeft($value, $length, $pad = ' ') { } /** * Pad the right side of a string with another. * * @param string $value * @param int $length * @param string $pad * @return string */ public static function padRight($value, $length, $pad = ' ') { } /** * Parse a Class[@]method style callback into class and method. * * @param string $callback * @param string|null $default * @return array */ public static function parseCallback($callback, $default = null) { } /** * Parse an integer from a string. * * @param string $value * @return int|null */ public static function parseInt($value) { } /** * Parse a floasting point number from a string. * * @param string $value * @return float|null */ public static function parseFloat($value) { } /** * Remove all non-numeric characters from a string. * * @param string $value * @return string */ public static function parseNumber($value) { } /** * Get the plural form of an English word. * * @param string $value * @param int|array|\Countable $count * @return string */ public static function plural($value, $count = 2) { } /** * Pluralize the last word of an English, studly caps case string. * * @param string $value * @param int|array|\Countable $count * @return string */ public static function pluralStudly($value, $count = 2) { } /** * Find the multi-byte safe position of the first * occurrence of a given substring in a string. * * @param string $haystack * @param string $needle * @param int $offset * @param string|null $encoding * @return int|false */ public static function position($haystack, $needle, $offset = 0, $encoding = null) { } /** * Generate a more truly "random" alpha-numeric string. * * @param int $length * @return string */ public static function random($length = 16) { } /** * Repeat the given string. * * @param string $string * @param int $times * @return string */ public static function repeat(string $string, int $times) { } /** * Escape SQL LIKE wildcards (% and _) in a user-supplied search term. * * Pairs with `where('col', 'LIKE', '%'.Str::likeEscape($term).'%')` or * `whereLike($col, $term)`. Uses `\` as the escape character — works as * a no-op for MySQL/MariaDB (default LIKE escape is `\`); on SQLite or * PostgreSQL, also append `ESCAPE '\\'` to the LIKE clause so the * escapes take effect. * * @param string $value * @return string */ public static function likeEscape($value) { } /** * Replace a given value in the string sequentially with an array. * * @param string $search * @param array $replace * @param string $subject * @return string */ public static function replaceArray($search, array $replace, $subject) { } /** * Replace the given value in the given string. * * @param string|iterable $search * @param string|iterable $replace * @param string|iterable $subject * @param bool $caseSensitive * @return string|string[] */ public static function replace($search, $replace, $subject, $caseSensitive = true) { } /** * Replace the first occurrence of a given value in the string. * * @param string $search * @param string $replace * @param string $subject * @return string */ public static function replaceFirst($search, $replace, $subject) { } /** * Replace the first occurrence of the given value if it appears at the start of the string. * * @param string $search * @param string $replace * @param string $subject * @return string */ public static function replaceStart($search, $replace, $subject) { } /** * Replace the last occurrence of a given value in the string. * * @param string $search * @param string $replace * @param string $subject * @return string */ public static function replaceLast($search, $replace, $subject) { } /** * Replace the last occurrence of a given value if it appears at the end of the string. * * @param string $search * @param string $replace * @param string $subject * @return string */ public static function replaceEnd($search, $replace, $subject) { } /** * Replace the patterns matching the given regular expression. * * @param array|string $pattern * @param \Closure|string[]|string $replace * @param array|string $subject * @param int $limit * @return string|string[]|null */ public static function replaceMatches($pattern, $replace, $subject, $limit = -1) { } /** * Remove any occurrence of the given string in the subject. * * @param string|array $search * @param string $subject * @param bool $caseSensitive * @return string */ public static function remove($search, $subject, $caseSensitive = true) { } /** * Reverse the given string. * * @param string $value * @return string */ public static function reverse(string $value) { } /** * Begin a string with a single instance of a given value. * * @param string $value * @param string $prefix * @return string */ public static function start($value, $prefix) { } /** * Convert the given string to upper-case. * * @param string $value * @return string */ public static function upper($value) { } /** * Convert the given string to title case. * * @param string $value * @return string */ public static function title($value) { } /** * Convert the given string to title case for each word. * * @param string $value * @return string */ public static function headline($value) { } /** * Convert the given string to APA-style title case. * * See: https://apastyle.apa.org/style-grammar-guidelines/capitalization/title-case * * @param string $value * @return string */ public static function apa($value) { } /** * Get the singular form of an English word. * * @param string $value * @return string */ public static function singular($value) { } /** * Generate a URL friendly "slug" from a given string. * * @param string $title * @return string * @see https://developer.wordpress.org/reference/functions/sanitize_title/ */ public static function slug($title, $fallback_title = '', $context = 'save') { } /** * Convert a string to snake case. * * @param string $value * @param string $delimiter * @return string */ public static function snake($value, $delimiter = '_') { } /** * Remove whitespace (including special Unicode spaces) from a string. * * Supports trimming from left, right, or both ends, and allows * specifying additional characters to trim. * * @param string $value The string to trim. * @param string|null $charlist Optional additional characters to trim. * @param string $mode One of 'both' (default), 'left', 'right'. * * @return string The trimmed string. */ protected static function _unicodeTrim(string $value, ?string $charlist = null, string $mode = 'both'): string { } /** * Remove all whitespace (including special Unicode spaces) from both ends of a string. * * @param string $value The string to trim. * @param string|null $charlist Optional additional characters to trim. * * @return string The trimmed string. */ public static function trim(string $value, ?string $charlist = null): string { } /** * Remove all whitespace (including special Unicode spaces) from the beginning of a string. * * @param string $value The string to trim. * @param string|null $charlist Optional additional characters to trim. * * @return string The trimmed string. */ public static function ltrim(string $value, ?string $charlist = null): string { } /** * Remove all whitespace (including special Unicode spaces) from the end of a string. * * @param string $value The string to trim. * @param string|null $charlist Optional additional characters to trim. * * @return string The trimmed string. */ public static function rtrim(string $value, ?string $charlist = null): string { } /** * Remove all "extra" blank space from the given string. * * @param string $value * @return string */ public static function squish($value) { } /** * Determine if a given string starts with a given substring. * * @param string $haystack * @param string|iterable $needles * @return bool */ public static function startsWith($haystack, $needles) { } /** * Convert a value to studly caps case. * * @param string $value * @return string */ public static function studly($value) { } /** * Convert a value to Pascal case. * * @param string $value * @return string */ public static function pascal($value) { } /** * Returns the portion of the string specified by the start and length parameters. * * @param string $string * @param int $start * @param int|null $length * @return string */ public static function substr($string, $start, $length = null) { } /** * Returns the number of substring occurrences. * * @param string $haystack * @param string $needle * @param int $offset * @param int|null $length * @return int */ public static function substrCount($haystack, $needle, $offset = 0, $length = null) { } /** * Replace text within a portion of a string. * * @param string|array $string * @param string|array $replace * @param array|int $offset * @param array|int|null $length * @return string|array */ public static function substrReplace($string, $replace, $offset = 0, $length = null) { } /** * Swap multiple keywords in a string with other keywords. * * @param array $map * @param string $subject * @return string */ public static function swap(array $map, $subject) { } /** * Take the first or last {$limit} characters of a string. * * @param string $string * @param int $limit * @return string */ public static function take($string, int $limit): string { } /** * Convert the given string to Base64 encoding. * * @param string $string * @return string */ public static function toBase64($string) { } /** * Decode the given Base64 encoded string. * * @param string $string * @param bool $strict * @return string|false */ public static function fromBase64($string, $strict = false) { } /** * Make a string's first character lowercase. * * @param string $string * @return string */ public static function lcfirst($string) { } /** * Make a string's first character uppercase. * * @param string $string * @return string */ public static function ucfirst($string) { } /** * Split a string into pieces by uppercase characters. * * @param string $string * @return array */ public static function ucsplit($string) { } /** * Count the number of words in a UTF-8 string. * * @param string $string * @return int */ public static function wordCount(string $string) { } /** * Wrap a string to a given number of characters. * * @param string $string * @param int $characters * @param string $break * @param bool $cutLongWords * @return string */ public static function wordWrap($string, $characters = 75, $break = "\n", $cutLongWords = false) { } /** * Wrap the string with the given strings. * * @param string $value * @param string $before * @param string|null $after * @return string */ public static function wrap($value, $before, $after = null) { } /** * Generate a UUID (version 4). * * @return string */ public static function uuid() { } /** * Increment a counter. * @return int */ public static function incrementCounter($prefix = '') { } /** * Generate a deterministic unique id by a prefix. * * @param string $slug * @return string */ public static function incrementBySlug($slug = '') { } /** * Remove all strings from the casing caches. * * @return void */ public static function flushCache() { } } class Stringable implements \JsonSerializable { use \FluentCart\Framework\Support\Tappable, \FluentCart\Framework\Support\Conditionable, \FluentCart\Framework\Support\MacroableTrait, \FluentCart\Framework\Support\HelperFunctionsTrait; /** * The underlying string value. * * @var string */ protected $value; /** * Create a new instance of the class. * * @param string $value * @return void */ public function __construct($value = '') { } /** * Makes an acronum from a string of words * * @param string $delimiter * @return self */ public function acronym(string $delimiter = '') { } /** * Return the remainder of a string after the first occurrence of a given value. * * @param string $search * @return static */ public function after($search) { } /** * Return the remainder of a string after the last occurrence of a given value. * * @param string $search * @return static */ public function afterLast($search) { } /** * Append the given values to the string. * * @param array|string ...$values * @return static */ public function append(...$values) { } /** * Append a new line to the string. * * @param int $count * @return $this */ public function newLine($count = 1) { } /** * Transliterate a UTF-8 value to ASCII. * * @return static */ public function ascii() { } /** * Checks if the word(s) are in capitalized form. * * @param boolean $onlyFirst if true, checks only the first charatcer * @return boolean */ public function isCapitalized($onlyFirst = false) { } /** * Checks if the first character is in capital form. * * @return boolean */ public function isCapital() { } /** * Checks if the chracters are in upper case * * @return boolean */ public function isUpper() { } /** * Checks if the chracters are in lower case * * @return boolean */ public function isLower() { } /** * Checks if two words sounds alike * * @param string $str * * @return bool */ public function soundsAlike($str) { } /** * Checks if two words are similar * * @param string $str * @param int $accuracy * * @return bool */ public function isSimilar($str, $accuracy = 50) { } /** * Checks if two words are similar * * @param string $str * * @return bool */ public function similarityOf($str) { } /** * Get the trailing name component of the path. * * @param string $suffix * @return static */ public function basename($suffix = '') { } /** * Get the character at the specified index. * * @param int $index * @return string|false */ public function charAt($index) { } /** * Get the basename of the class path. * * @return static */ public function classBasename() { } /** * Get the portion of a string before the first occurrence of a given value. * * @param string $search * @return static */ public function before($search) { } /** * Get the portion of a string before the last occurrence of a given value. * * @param string $search * @return static */ public function beforeLast($search) { } /** * Get the portion of a string between two given values. * * @param string $from * @param string $to * @return static */ public function between($from, $to) { } /** * Get the smallest possible portion of a string between two given values. * * @param string $from * @param string $to * @return static */ public function betweenFirst($from, $to) { } /** * Convert a value to camel case. * * @return static */ public function camel() { } /** * Determine if a given string contains a given substring. * * @param string|iterable $needles * @param bool $ignoreCase * @return bool */ public function contains($needles, $ignoreCase = false) { } /** * Determine if a given string contains all array values. * * @param iterable $needles * @param bool $ignoreCase * @return bool */ public function containsAll($needles, $ignoreCase = false) { } /** * Replace consecutive instances of a given character with a single character. * * @param string $character * @return static */ public function deduplicate(string $character = ' ') { } /** * Get the parent directory's path. * * @param int $levels * @return static */ public function dirname($levels = 1) { } /** * Determine if a given string ends with a given substring. * * @param string|iterable $needles * @return bool */ public function endsWith($needles) { } /** * Determine if the string is an exact match with the given value. * * @param \FluentCart\Framework\Support\Stringable|string $value * @return bool */ public function exactly($value) { } /** * Explode the string into an array. * * @param string $delimiter * @param int $limit * @return \FluentCart\Framework\Support\Collection */ public function explode($delimiter, $limit = PHP_INT_MAX) { } /** * Split a string using a regular expression or by length. * * @param string|int $pattern * @param int $limit * @param int $flags * @return \FluentCart\Framework\Support\Collection */ public function split($pattern, $limit = -1, $flags = 0) { } /** * Cap a string with a single instance of a given value. * * @param string $cap * @return static */ public function finish($cap) { } /** * Determine if a given string matches a given pattern. * * @param string|iterable $pattern * @return bool */ public function is($pattern) { } /** * Determine if a given string is 7 bit ASCII. * * @return bool */ public function isAscii() { } /** * Determine if a given string is valid JSON. * * @return bool */ public function isJson() { } /** * Determine if a given value is a valid URL. * * @return bool */ public function isUrl() { } /** * Determine if a given string is a valid UUID. * * @return bool */ public function isUuid() { } /** * Determine if the given string is empty. * * @return bool */ public function isEmpty() { } /** * Determine if the given string is not empty. * * @return bool */ public function isNotEmpty() { } /** * Convert a string to kebab case. * * @return static */ public function kebab() { } /** * Return the length of the given string. * * @param string|null $encoding * @return int */ public function length($encoding = null) { } /** * Limit the number of characters in a string. * * @param int $limit * @param string $end * @return static */ public function limit($limit = 100, $end = '...') { } /** * Convert the given string to lower-case. * * @return static */ public function lower() { } /** * Masks a portion of a string with a repeated character. * * @param string $character * @param int $index * @param int|null $length * @param string $encoding * @return static */ public function mask($character, $index, $length = null, $encoding = 'UTF-8') { } /** * Get the string matching the given pattern. * * @param string $pattern * @return static */ public function match($pattern) { } /** * Determine if a given string matches a given pattern. * * @param string|iterable $pattern * @return bool */ public function isMatch($pattern) { } /** * Get the string matching the given pattern. * * @param string $pattern * @return \FluentCart\Framework\Support\Collection */ public function matchAll($pattern) { } /** * Determine if the string matches the given pattern. * * @param string $pattern * @return bool */ public function test($pattern) { } /** * Pad both sides of the string with another. * * @param int $length * @param string $pad * @return static */ public function padBoth($length, $pad = ' ') { } /** * Pad the left side of the string with another. * * @param int $length * @param string $pad * @return static */ public function padLeft($length, $pad = ' ') { } /** * Pad the right side of the string with another. * * @param int $length * @param string $pad * @return static */ public function padRight($length, $pad = ' ') { } /** * Parse a Class@method style callback into class and method. * * @param string|null $default * @return array */ public function parseCallback($default = null) { } /** * Parse an integer from a string. * * @param string $value * @return int|null */ public function parseInt($value) { } /** * Parse a floasting point number from a string. * * @param string $value * @return float|null */ public function parseFloat($value) { } /** * Remove all non-numeric characters from a string. * * @param string $value * @return string */ public function parseNumber($value) { } /** * Call the given callback and return a new string. * * @param callable $callback * @return static */ public function pipe(callable $callback) { } /** * Get the plural form of an English word. * * @param int|array|\Countable $count * @return static */ public function plural($count = 2) { } /** * Pluralize the last word of an English, studly caps case string. * * @param int|array|\Countable $count * @return static */ public function pluralStudly($count = 2) { } /** * Prepend the given values to the string. * * @param string ...$values * @return static */ public function prepend(...$values) { } /** * Remove any occurrence of the given string in the subject. * * @param string|iterable $search * @param bool $caseSensitive * @return static */ public function remove($search, $caseSensitive = true) { } /** * Reverse the string. * * @return static */ public function reverse() { } /** * Repeat the string. * * @param int $times * @return static */ public function repeat(int $times) { } /** * Replace the given value in the given string. * * @param string|iterable $search * @param string|iterable $replace * @param bool $caseSensitive * @return static */ public function replace($search, $replace, $caseSensitive = true) { } /** * Replace a given value in the string sequentially with an array. * * @param string $search * @param iterable $replace * @return static */ public function replaceArray($search, $replace) { } /** * Replace the first occurrence of a given value in the string. * * @param string $search * @param string $replace * @return static */ public function replaceFirst($search, $replace) { } /** * Replace the last occurrence of a given value in the string. * * @param string $search * @param string $replace * @return static */ public function replaceLast($search, $replace) { } /** * Replace the patterns matching the given regular expression. * * @param string $pattern * @param \Closure|string $replace * @param int $limit * @return static */ public function replaceMatches($pattern, $replace, $limit = -1) { } /** * Parse input from a string to a collection, according to a format. * * @param string $format * @return \FluentCart\Framework\Support\Collection */ public function scan($format) { } /** * Remove all "extra" blank space from the given string. * * @return static */ public function squish() { } /** * Begin a string with a single instance of a given value. * * @param string $prefix * @return static */ public function start($prefix) { } /** * Strip HTML and PHP tags from the given string. * * @param string $allowedTags * @return static */ public function stripTags($allowedTags = null) { } /** * Convert the given string to upper-case. * * @return static */ public function upper() { } /** * Convert the given string to title case. * * @return static */ public function title() { } /** * Convert the given string to title case for each word. * * @return static */ public function headline() { } /** * Get the singular form of an English word. * * @return static */ public function singular() { } /** * Generate a URL friendly "slug" from a given string. * * @param string $fallbackTitle * @param string $context * @return static */ public function slug($fallbackTitle = '', $context = 'save') { } /** * Convert a string to snake case. * * @param string $delimiter * @return static */ public function snake($delimiter = '_') { } /** * Determine if a given string starts with a given substring. * * @param string|iterable $needles * @return bool */ public function startsWith($needles) { } /** * Convert a value to studly caps case. * * @return static */ public function studly() { } /** * Returns the portion of the string specified by the start and length parameters. * * @param int $start * @param int|null $length * @return static */ public function substr(int $start, ?int $length = null) { } /** * Returns the number of substring occurrences. * * @param string $needle * @param int $offset * @param int|null $length * @return int */ public function substrCount($needle, $offset = 0, $length = null) { } /** * Replace text within a portion of a string. * * @param string|string[] $replace * @param int|int[] $offset * @param int|int[]|null $length * @return static */ public function substrReplace($replace, $offset = 0, $length = null) { } /** * Swap multiple keywords in a string with other keywords. * * @param array $map * @return static */ public function swap(array $map) { } /** * Trim the string of the given characters. * * @param string $characters * @return static */ public function trim($characters = null) { } /** * Left trim the string of the given characters. * * @param string $characters * @return static */ public function ltrim($characters = null) { } /** * Right trim the string of the given characters. * * @param string $characters * @return static */ public function rtrim($characters = null) { } /** * Make a string's first character lowercase. * * @return static */ public function lcfirst() { } /** * Make a string's first character uppercase. * * @return static */ public function ucfirst() { } /** * Split a string by uppercase characters. * * @return \FluentCart\Framework\Support\Collection */ public function ucsplit() { } /** * Execute the given callback if the string contains a given substring. * * @param string|iterable $needles * @param callable $callback * @param callable|null $default * @return static */ public function whenContains($needles, $callback, $default = null) { } /** * Execute the given callback if the string contains all array values. * * @param array $needles * @param callable $callback * @param callable|null $default * @return static */ public function whenContainsAll(array $needles, $callback, $default = null) { } /** * Execute the given callback if the string is empty. * * @param callable $callback * @param callable|null $default * @return static */ public function whenEmpty($callback, $default = null) { } /** * Execute the given callback if the string is not empty. * * @param callable $callback * @param callable|null $default * @return static */ public function whenNotEmpty($callback, $default = null) { } /** * Execute the given callback if the string ends with a given substring. * * @param string|iterable $needles * @param callable $callback * @param callable|null $default * @return static */ public function whenEndsWith($needles, $callback, $default = null) { } /** * Execute the given callback if the string is an exact match with the given value. * * @param string $value * @param callable $callback * @param callable|null $default * @return static */ public function whenExactly($value, $callback, $default = null) { } /** * Execute the given callback if the string is not an exact match with the given value. * * @param string $value * @param callable $callback * @param callable|null $default * @return static */ public function whenNotExactly($value, $callback, $default = null) { } /** * Execute the given callback if the string matches a given pattern. * * @param string|iterable $pattern * @param callable $callback * @param callable|null $default * @return static */ public function whenIs($pattern, $callback, $default = null) { } /** * Execute the given callback if the string is 7 bit ASCII. * * @param callable $callback * @param callable|null $default * @return static */ public function whenIsAscii($callback, $default = null) { } /** * Execute the given callback if the string is a valid UUID. * * @param callable $callback * @param callable|null $default * @return static */ public function whenIsUuid($callback, $default = null) { } /** * Execute the given callback if the string starts with a given substring. * * @param string|string[] $needles * @param callable $callback * @param callable|null $default * @return static */ public function whenStartsWith($needles, $callback, $default = null) { } /** * Execute the given callback if the string matches the given pattern. * * @param string $pattern * @param callable $callback * @param callable|null $default * @return static */ public function whenTest($pattern, $callback, $default = null) { } /** * Limit the number of words in a string. * * @param int $words * @param string $end * @return static */ public function words($words = 100, $end = '...') { } /** * Get the number of words a string contains. * * @return int */ public function wordCount() { } /** * Wrap a string to a given number of characters. * * @param int $characters * @param string $break * @param bool $cutLongWords * @return static */ public function wordWrap($characters = 75, $break = "\n", $cutLongWords = false) { } /** * Wrap the string with the given strings. * * @param string $before * @param string|null $after * @return static */ public function wrap($before, $after = null) { } /** * Dump the string. * * @return $this */ public function dump() { } /** * Dump the string and end the script. * * @return never */ public function dd() { } /** * Get the underlying string value. * * @return string */ public function value() { } /** * Get the underlying string value. * * @return string */ public function toString() { } /** * Get the underlying string value as an integer. * * @return int */ public function toInteger() { } /** * Get the underlying string value as a float. * * @return float */ public function toFloat() { } /** * Get the underlying string value as a boolean. * * Returns true when value is "1", "true", "on", and "yes". Otherwise, returns false. * * @return bool */ public function toBoolean() { } /** * Get the underlying string value as a Carbon instance. * * @param string|null $format * @param string|null $tz * @return \FluentCart\Framework\Support\DateTime * * @throws \InvalidArgumentException */ public function toDate($format = null, $tz = null) { } /** * Convert the object to a string when JSON encoded. * * @return string */ #[\ReturnTypeWillChange] public function jsonSerialize() { } /** * Proxy dynamic properties onto methods. * * @param string $key * @return mixed */ public function __get($key) { } /** * Get the raw string value. * * @return string */ public function __toString() { } } /** * Expands URI templates. Userland implementation of PECL uri_template. * * @see https://datatracker.ietf.org/doc/html/rfc6570 */ final class UriTemplate { /** * @var array Hash for quick operator lookups */ private static $operatorHash = ['' => ['prefix' => '', 'joiner' => ',', 'query' => false], '+' => ['prefix' => '', 'joiner' => ',', 'query' => false], '#' => ['prefix' => '#', 'joiner' => ',', 'query' => false], '.' => ['prefix' => '.', 'joiner' => '.', 'query' => false], '/' => ['prefix' => '/', 'joiner' => '/', 'query' => false], ';' => ['prefix' => ';', 'joiner' => ';', 'query' => true], '?' => ['prefix' => '?', 'joiner' => '&', 'query' => true], '&' => ['prefix' => '&', 'joiner' => '&', 'query' => true]]; /** * @var string[] Delimiters */ private static $delims = [':', '/', '?', '#', '[', ']', '@', '!', '$', '&', '\'', '(', ')', '*', '+', ',', ';', '=']; /** * @var string[] Percent encoded delimiters */ private static $delimsPct = ['%3A', '%2F', '%3F', '%23', '%5B', '%5D', '%40', '%21', '%24', '%26', '%27', '%28', '%29', '%2A', '%2B', '%2C', '%3B', '%3D']; /** * @param array $variables Variables to use in the template expansion * * @throws \RuntimeException */ public static function expand(string $template, array $variables): string { } /** * @param array $variables Variables to use in the template expansion * * @return callable(string[]): string */ private static function expandMatchCallback(array $variables): callable { } /** * Process an expansion * * @param array $variables Variables to use in the template expansion * @param string[] $matches Matches met in the preg_replace_callback * * @return string Returns the replacement string */ private static function expandMatch(array $matches, array $variables): string { } /** * Parse an expression into parts * * @param string $expression Expression to parse * * @return array{operator:string, values:array} */ private static function parseExpression(string $expression): array { } /** * Determines if an array is associative. * * This makes the assumption that input arrays are sequences or hashes. * This assumption is a tradeoff for accuracy in favor of speed, but it * should work in almost every case where input is supplied for a URI * template. */ private static function isAssoc(array $array): bool { } /** * Removes percent encoding on reserved characters (used with + and # * modifiers). */ private static function decodeReserved(string $string): string { } } class Util { /** * Returns a comma-separated string or array of functions that * have been called to get to the current point in code. * * @param string $ignoreClass * @param integer $skipFrames * @param boolean $pretty * @return string|array * @see https://developer.wordpress.org/reference/functions/wp_debug_backtrace_summary/ */ public static function debugBacktraceSummary($ignoreClass = null, $skipFrames = 0, $pretty = true) { } /** * @param string|array $value * @return mixed * @see https://developer.wordpress.org/reference/functions/wp_slash */ public static function addslashes($value) { } /** * Convert an absolute file path to URL. * * @param string $filePath * @return string */ public static function pathToUrl($filePath = '', $checkFile = false) { } /** * Get the user locale. * * @param int|null $userId * @return \FluentCart\Framework\Support\Locale */ public static function getLocale($userId = null) { } } } namespace FluentCart\Framework\Validator { trait MessageBag { /** * The default message bag. * * @var array */ protected $bag = ['array' => 'The :attribute must be an array.', 'alpha' => 'The :attribute must contain only alphabetic characters.', 'alphanum' => 'The :attribute must contain only alphanumeric characters.', 'alphadash' => 'The :attribute must contain only alphanumeric and _- characters.', 'email' => 'The :attribute must be a valid email address.', 'date_format' => 'Unable to format the :attribute field from the :value format string.', 'exists' => 'The selected :attribute is invalid.', 'gt' => 'The :attribute must be greater than :value.', 'lt' => 'The :attribute must be less than :value.', 'gte' => 'The :attribute must be greater than or equal to :value.', 'lte' => 'The :attribute must be less than or equal to :value.', 'in' => 'The selected :attribute is invalid.', 'not_in' => 'The selected :attribute is invalid.', 'max' => ['numeric' => 'The :attribute may not be greater than :max.', 'file' => 'The :attribute may not be greater than :max kilobytes.', 'string' => 'The :attribute may not be greater than :max characters.', 'array' => 'The :attribute may not have more than :max items.'], 'mimes' => 'The :attribute must be a file of type: :values.', 'mimetypes' => 'The :attribute must be a file of type: :values.', 'min' => ['numeric' => 'The :attribute must be at least :min.', 'file' => 'The :attribute must be at least :min kilobytes.', 'string' => 'The :attribute must be at least :min characters.', 'array' => 'The :attribute must have at least :min items.'], 'string' => 'The :attribute must be a string.', 'integer' => 'The :attribute must be an integer.', 'numeric' => 'The :attribute must be a number.', 'required' => 'The :attribute field is required.', 'required_array_keys' => 'The :attribute must be an array and should contain :keys.', 'required_if' => 'The :attribute field is required when :other is :value.', 'required_with' => 'The :attribute field is required when the :other field is present.', 'required_with_all' => 'The :attribute field is required when the :other field is present.', 'required_without' => 'The :attribute field is required when the :other field is not present.', 'required_without_all' => 'The :attribute field is required when the :other fields are not present.', 'same' => 'The :attribute and :other must match.', 'size' => ['numeric' => 'The :attribute must be :size.', 'file' => 'The :attribute must be :size kilobytes.', 'string' => 'The :attribute must be :size characters.', 'array' => 'The :attribute must contain :size items.'], 'url' => 'The :attribute format is invalid.', 'unique' => 'The :attribute attribute is already taken and must be unique.', 'digits' => 'The :attribute must be :digits characters.']; /** * Generate a validation error message. * * @param $attribute * @param $rule * @param $parameters * @param $originalRuleKey * * @return mixed */ protected function generate($attribute, $rule, $parameters, $originalRuleKey = null) { } /** * Fallback message generator for the failed validation. * @param string $attribute * @param array $parameters * @return string */ protected function generateDefaultMessage($attribute, $parameters) { } /** * Get the replacement text of the error message. * * @param $customKey * @param $bagAccessor * @param $originalKey * * @return string */ protected function getReplacementText($customKey, $bagAccessor, $originalKey = null) { } /** * Make bag accessor key. * * @param $attribute * @param $rule * * @return string */ protected function makeBagKey($attribute, $rule) { } /** * Replace all place-holders for the string rule. * * @param $attribute * @param $parameters * @param $originalKey * @return string */ protected function replaceString($attribute, $parameters, $originalKey) { } /** * Replace all place-holders for the int|integer rule. * * @param $attribute * @param $parameters * @param $originalKey * @return string */ protected function replaceInt($attribute, $parameters, $originalKey) { } /** * Replace all place-holders for the int|integer rule. * * @param $attribute * @param $parameters * @param $originalKey * * @return string */ protected function replaceInteger($attribute, $parameters, $originalKey) { } /** * Replace all place-holders for the alpha rule. * * @param $attribute * @param $parameters * @param $originalKey * * @return string */ protected function replaceAlpha($attribute, $parameters, $originalKey) { } /** * Replace all place-holders for the alphanum rule. * * @param $attribute * @param $parameters * @param $originalKey * * @return string */ protected function replaceAlphanum($attribute, $parameters, $originalKey) { } /** * Replace all place-holders for the alphadash rule. * * @param $attribute * @param $parameters * @param $originalKey * * @return string */ protected function replaceAlphadash($attribute, $parameters, $originalKey) { } /** * Replace all place-holders for the required rule. * * @param $attribute * @param $parameters * @param $originalKey * * @return string */ protected function replaceRequired($attribute, $parameters, $originalKey) { } /** * Replace all place-holders for the required if rule. * * @param $attribute * @param $parameters * @param $originalKey * * @return string */ protected function replaceRequiredIf($attribute, $parameters, $originalKey) { } /** * Replace all place-holders for the required with rule. * * @param $attribute * @param $parameters * @param $originalKey * * @return string */ protected function replaceRequiredWith($attribute, $parameters, $originalKey) { } /** * Replace all place-holders for the required with all rule. * * @param $attribute * @param $parameters * @param $originalKey * * @return string */ protected function replaceRequiredWithAll($attribute, $parameters, $originalKey) { } /** * Replace all place-holders for the required without rule. * * @param string $attribute * @param array $parameters * @param string $originalKey * @return string */ protected function replaceRequiredWithout($attribute, $parameters, $originalKey) { } /** * Replace all place-holders for the required without all rule. * * @param string $attribute * @param array $parameters * @param string $originalKey * @return string */ protected function replaceRequiredWithoutAll($attribute, $parameters, $originalKey) { } /** * Replace placeholders in a validation message for required array keys. * * @param string $attribute * @param array $parameters * @param string $originalKey * * @return string */ protected function replaceRequiredArrayKeys($attribute, $parameters, $originalKey) { } /** * Replace all place-holders for the gt rule. * * @param $attribute * @param $parameters * @param $originalKey * * @return string */ protected function replaceGt($attribute, $parameters, $originalKey) { } /** * Replace all place-holders for the lt rule. * * @param $attribute * @param $parameters * @param $originalKey * * @return string */ protected function replaceLt($attribute, $parameters, $originalKey) { } /** * Replace all place-holders for the gte rule. * * @param $attribute * @param $parameters * @param $originalKey * * @return string */ protected function replaceGte($attribute, $parameters, $originalKey) { } /** * Replace all place-holders for the lte rule. * * @param $attribute * @param $parameters * @param $originalKey * * @return string */ protected function replaceLte($attribute, $parameters, $originalKey) { } /** * Replace all place-holders for the email rule. * * @param $attribute * @param $parameters * @param $originalKey * * @return string */ protected function replaceEmail($attribute, $parameters, $originalKey) { } /** * Replace all place-holders for the email rule. * * @param $attribute * @param $parameters * @param $originalKey * * @return string */ protected function replaceDateformat($attribute, $parameters, $originalKey) { } /** * Replace all place-holders for the size rule. * * @param $attribute * @param $parameters * @param $originalKey * * @return string */ protected function replaceSize($attribute, $parameters, $originalKey) { } /** * Replace all place-holders for the min rule. * * @param $attribute * @param $parameters * @param $originalKey * * @return string */ protected function replaceMin($attribute, $parameters, $originalKey) { } /** * Replace all place-holders for the max rule. * * @param $attribute * @param $parameters * @param $originalKey * * @return string */ protected function replaceMax($attribute, $parameters, $originalKey) { } /** * Replace all place-holders for the min rule. * * @param $attribute * @param $parameters * @param $originalKey * * @return string */ protected function replaceSame($attribute, $parameters, $originalKey) { } /** * Replace all place-holders for the url rule. * * @param $attribute * @param $parameters * @param $originalKey * * @return string */ protected function replaceUrl($attribute, $parameters, $originalKey) { } /** * Replace all place-holders for the numeric rule. * * @param $attribute * @param $parameters * @param $originalKey * * @return string */ protected function replaceNumeric($attribute, $parameters, $originalKey) { } /** * Replace all place-holders for the mimes rule. * * @param $attribute * @param $parameters * @param $originalKey * * @return string */ protected function replaceMimes($attribute, $parameters, $originalKey) { } /** * Replace all place-holders for the mimetypes rule. * * @param $attribute * @param $parameters * @param $originalKey * * @return string */ protected function replaceMimetypes($attribute, $parameters, $originalKey) { } /** * Replace all place-holders for the unique rule. * * @param $attribute * @param $parameters * @param $originalKey * * @return string */ protected function replaceUnique($attribute, $parameters, $originalKey) { } /** * Replace all place-holders for the digits rule. * * @param $attribute * @param $parameters * @param $originalKey * * @return string */ protected function replaceDigits($attribute, $parameters, $originalKey) { } /** * Replace all place-holders for the array rule. * * @param $attribute * @param $parameters * @param $originalKey * * @return string */ protected function replaceArray($attribute, $parameters, $originalKey) { } /** * Replace all place-holders for the in rule. * * @param $attribute * @param $parameters * @param $originalKey * * @return string */ protected function replaceIn($attribute, $parameters, $originalKey) { } /** * Replace all place-holders for the not_in rule. * * @param $attribute * @param $parameters * @param $originalKey * * @return string */ protected function replaceNotIn($attribute, $parameters, $originalKey) { } /** * Replace all place-holders for the exista rule. * * @param $attribute * @param $parameters * @param $originalKey * * @return string */ protected function replaceExists($attribute, $parameters, $originalKey) { } } class Rule { /** * Create a new conditional rule set. * * @param callable|bool $condition * @param array|string $rules * @param array|string $defaultRules * @return \FluentCart\Framework\Validator\Rules\ConditionalRules */ public static function when($condition, $rules, $defaultRules = []) { } /** * Get a dimensions constraint builder instance. * * @param array $constraints * @return \FluentCart\Framework\Validator\Rules\Dimensions */ public static function dimensions(array $constraints = []) { } /** * Get an exists constraint builder instance. * * @param string $table * @param string $column * @return \FluentCart\Framework\Validator\Rules\Exists */ public static function exists($table, $column = 'NULL') { } /** * Get an in constraint builder instance. * * @param \FluentCart\Framework\Support\ArrayableInterface|array|string $values * @return \FluentCart\Framework\Validator\Rules\In */ public static function in($values) { } /** * Get a not_in constraint builder instance. * * @param \FluentCart\Framework\Support\ArrayableInterface|array|string $values * @return \FluentCart\Framework\Validator\Rules\NotIn */ public static function notIn($values) { } /** * Get a required_if constraint builder instance. * * @param callable|bool $callback * @return \FluentCart\Framework\Validator\Rules\RequiredIf */ public static function requiredIf($callback) { } /** * Get a unique constraint builder instance. * * @param string $table * @param string $column * @return \FluentCart\Framework\Validator\Rules\Unique */ public static function unique($table, $column = 'NULL') { } /** * Add a custom rule. * * @param string $rule * @param callable $callback * @return null * @throws \InvalidArgumentException|\LogicException */ public static function add($rule, $callback = null) { } /** * Handle dynamic calls * * @param string $method * @param array $params * @return bool/true * @throws \BadMethodCallException */ public static function __callStatic($method, $params) { } } } namespace FluentCart\Framework\Validator\Rules { class ConditionalRules { /** * The boolean condition indicating if the rules should be added to the attribute. * * @var callable|bool */ protected $condition; /** * The rules to be added to the attribute. * * @var array|string */ protected $rules; /** * The rules to be added to the attribute if the condition fails. * * @var array|string */ protected $defaults; /** * Create a new conditional rules instance. * * @param callable|bool $condition * @param array|string $rules * @param array|string $defaults * @return void */ public function __construct($condition, $rules, $defaults = []) { } /** * Determine if the conditional rules should be added. * * @param array $data * @return bool */ public function passes(array $data = []) { } /** * Get the rules. * * @return array */ public function rules() { } /** * Get the default rules. * * @return array */ public function defaultRules() { } } trait DatabaseRule { /** * The table to run the query against. * * @var string */ protected $table; /** * The column to check on. * * @var string */ protected $column; /** * The extra where clauses for the query. * * @var array */ protected $wheres = []; /** * The array of custom query callbacks. * * @var array */ protected $using = []; /** * Create a new rule instance. * * @param string $table * @param string $column * @return void */ public function __construct($table, $column = 'NULL') { } /** * Resolves the name of the table from the given string. * * @param string $table * @return string */ public function resolveTableName($table) { } /** * Set a "where" constraint on the query. * * @param \Closure|string $column * @param array|string|int|null $value * @return $this */ public function where($column, $value = null) { } /** * Set a "where not" constraint on the query. * * @param string $column * @param array|string $value * @return $this */ public function whereNot($column, $value) { } /** * Set a "where null" constraint on the query. * * @param string $column * @return $this */ public function whereNull($column) { } /** * Set a "where not null" constraint on the query. * * @param string $column * @return $this */ public function whereNotNull($column) { } /** * Set a "where in" constraint on the query. * * @param string $column * @param array $values * @return $this */ public function whereIn($column, array $values) { } /** * Set a "where not in" constraint on the query. * * @param string $column * @param array $values * @return $this */ public function whereNotIn($column, array $values) { } /** * Register a custom query callback. * * @param \Closure $callback * @return $this */ public function using(\Closure $callback) { } /** * Get the custom query callbacks for the rule. * * @return array */ public function queryCallbacks() { } /** * Format the where clauses. * * @return string */ protected function formatWheres() { } } class Dimensions { use \FluentCart\Framework\Support\Conditionable; /** * The constraints for the dimensions rule. * * @var array */ protected $constraints = []; /** * Create a new dimensions rule instance. * * @param array $constraints * @return void */ public function __construct(array $constraints = []) { } /** * Set the "width" constraint. * * @param int $value * @return $this */ public function width($value) { } /** * Set the "height" constraint. * * @param int $value * @return $this */ public function height($value) { } /** * Set the "min width" constraint. * * @param int $value * @return $this */ public function minWidth($value) { } /** * Set the "min height" constraint. * * @param int $value * @return $this */ public function minHeight($value) { } /** * Set the "max width" constraint. * * @param int $value * @return $this */ public function maxWidth($value) { } /** * Set the "max height" constraint. * * @param int $value * @return $this */ public function maxHeight($value) { } /** * Set the "ratio" constraint. * * @param float $value * @return $this */ public function ratio($value) { } /** * Convert the rule to a validation string. * * @return string */ public function __toString() { } } class Exists { use \FluentCart\Framework\Support\Conditionable, \FluentCart\Framework\Validator\Rules\DatabaseRule; /** * Ignore soft deleted models during the existence check. * * @param string $deletedAtColumn * @return $this */ public function withoutTrashed($deletedAtColumn = 'deleted_at') { } /** * Convert the rule to a validation string. * * @return string */ public function __toString() { } } class In { /** * The name of the rule. */ protected $rule = 'in'; /** * The accepted values. * * @var array */ protected $values; /** * Create a new in rule instance. * * @param array $values * @return void */ public function __construct(array $values) { } /** * Convert the rule to a validation string. * * @return string * * @see \Illuminate\Validation\ValidationRuleParser::parseParameters */ public function __toString() { } } class NotIn { /** * The name of the rule. */ protected $rule = 'not_in'; /** * The accepted values. * * @var array */ protected $values; /** * Create a new "not in" rule instance. * * @param array $values * @return void */ public function __construct(array $values) { } /** * Convert the rule to a validation string. * * @return string */ public function __toString() { } } class RequiredIf { /** * The condition that validates the attribute. * * @var callable|bool */ public $condition; /** * Create a new required validation rule based on a condition. * * @param callable|bool $condition * @return void */ public function __construct($condition) { } /** * Convert the rule to a validation string. * * @return string */ public function __toString() { } } class Unique { use \FluentCart\Framework\Support\Conditionable, \FluentCart\Framework\Validator\Rules\DatabaseRule; /** * The ID that should be ignored. * * @var mixed */ protected $ignore; /** * The name of the ID column. * * @var string */ protected $idColumn = 'id'; /** * Ignore the given ID during the unique check. * * @param mixed $id * @param string|null $idColumn * @return $this */ public function ignore($id, $idColumn = null) { } /** * Ignore the given model during the unique check. * * @param \FluentCart\Framework\Database\Orm\Model $model * @param string|null $idColumn * @return $this */ public function ignoreModel($model, $idColumn = null) { } /** * Ignore soft deleted models during the unique check. * * @param string $deletedAtColumn * @return $this */ public function withoutTrashed($deletedAtColumn = 'deleted_at') { } /** * Convert the rule to a validation string. * * @return string */ public function __toString() { } } } namespace FluentCart\Framework\Validator { trait ValidateDatabaseRulesTrait { /** * Validate the existence of an attribute value in a database table. * * @param string $attribute * @param mixed $value * @param array $parameters * @return bool */ public function validateExists($attribute, $value, $parameters) { } /** * Parse the connection / table for the unique / exists rules. * * @param string $table * @return array */ public function parseTable($table) { } /** * Get the number of records that exist in storage. * * @param mixed $connection * @param string $table * @param string $column * @param mixed $value * @param array $parameters * @return int */ protected function getExistCount($connection, $table, $column, $value, $parameters) { } /** * Get the extra conditions for a unique / exists rule. * * @param array $segments * @return array */ protected function getExtraConditions(array $segments) { } /** * Count the number of objects in a collection having the given value. * * @param string $collection * @param string $column * @param string $value * @param int|null $excludeId * @param string|null $idColumn * @param array $extra * @return int */ public function getCount($collection, $column, $value, $excludeId = null, $idColumn = null, array $extra = []) { } /** * Count the number of objects in a collection with the given values. * * @param string $collection * @param string $column * @param array $values * @param array $extra * @return int */ public function getMultiCount($collection, $column, array $values, array $extra = []) { } /** * Add the given conditions to the query. * * @param \FluentCart\Framework\Database\Query\Builder $query * @param array $conditions * @return \FluentCart\Framework\Database\Query\Builder */ protected function addConditions($query, $conditions) { } /** * Add a "where" clause to the given query. * * @param \FluentCart\Framework\Database\Query\Builder $query * @param string $key * @param string $extraValue * @return void */ protected function addWhere($query, $key, $extraValue) { } /** * Get a query builder for the given table. * * @param string $table * @return \FluentCart\Framework\Database\Query\Builder */ protected function table($table) { } /** * Validate the uniqueness of an attribute value on a given database table. * * If a database column is not specified, the attribute will be used. * * @param string $attribute * @param mixed $value * @param array $parameters * @return bool */ public function validateUnique($attribute, $value, $parameters) { } /** * Get the excluded ID column and value for the unique rule. * * @param string|null $idColumn * @param array $parameters * @return array */ protected function getUniqueIds($idColumn, $parameters) { } /** * Prepare the given ID for querying. * * @param mixed $id * @return int */ protected function prepareUniqueId($id) { } /** * Get the extra conditions for a unique rule. * * @param array $parameters * @return array */ protected function getUniqueExtra($parameters) { } } trait ValidatesAttributes { use \FluentCart\Framework\Validator\ValidateDatabaseRulesTrait; /** * Require a certain number of parameters to be present. * * @param int $count * @param array $parameters * @param string $rule * * @return void * * @throws \InvalidArgumentException */ protected function requireParameterCount($count, $parameters, $rule) { } /** * Get the size of an attribute. * * @param string $attribute * @param mixed $value * * @return mixed */ protected function getSize($attribute, $value) { } /** * Deduce the value type of an attribute. * * @param $value * * @return string */ protected function deduceType($value, $attribute = null) { } /** * Guess the real type by examining rules. * * @param mixed $value * @param string|null $attribute * @return string */ protected function guessType($value, $attribute) { } /** * Check if parameter should be converted to boolean. * * @param string $parameter * @return bool */ protected function shouldConvertToBoolean($parameter) { } /** * Convert the given values to boolean if they are string "true" / "false". * * @param array $values * * @return array */ protected function convertValuesToBoolean($values) { } /** * Convert the given values to null if they are string "null". * * @param array $values * @return array */ protected function convertValuesToNull($values) { } /** * Validate that a required attribute exists. * * @param string $attribute * @param mixed $value * * @return bool */ protected function validateRequired($attribute, $value) { } /** * Validate that an attribute exists when another attribute has a given value. * * @param string $attribute * @param mixed $value * @param mixed $parameters * * @return bool */ protected function validateRequiredIf($attribute, $value, $parameters) { } /** * Validate that an attribute is required only if **any** of the * other specified fields are present. * * @param string $attribute * @param mixed $value * @param array $parameters * @return bool */ protected function validateRequiredWith($attribute, $value, $parameters) { } /** * Validate that an attribute is required only if **all** of the * other specified fields are present. * * @param string $attribute * @param mixed $value * @param array $parameters * @return bool */ protected function validateRequiredWithAll($attribute, $value, $parameters) { } /** * Validate that an attribute is required only if **any** of the * other specified fields are **not present**. * * @param string $attribute * @param mixed $value * @param array $parameters * @return bool */ protected function validateRequiredWithout($attribute, $value, $parameters) { } /** * Validate that an attribute is required only if **all** of the * other specified fields are **not present**. * * @param string $attribute * @param mixed $value * @param array $parameters * @return bool */ protected function validateRequiredWithoutAll($attribute, $value, $parameters) { } /** * Determine if the given attribute is present. * * @param string $attribute * @return boolean */ protected function isPresent($attribute) { } /** * Validate that an attribute is greater than value. * * @param string $attribute * @param mixed $value * @param array $parameters * @return bool */ protected function validateGt($attribute, $value, $parameters) { } /** * Validate that an attribute is greater than or equal to value. * * @param string $attribute * @param mixed $value * @param array $parameters * @return bool */ protected function validateGte($attribute, $value, $parameters) { } /** * Validate that an attribute is less than value. * * @param string $attribute * @param mixed $value * @param array $parameters * @return bool */ protected function validateLt($attribute, $value, $parameters) { } /** * Validate that an attribute is less than or equal to value. * * @param string $attribute * @param mixed $value * @param array $parameters * @return bool */ protected function validateLte($attribute, $value, $parameters) { } /** * Validate that an attribute is a valid e-mail address. * * @param string $attribute * @param mixed $value * * @return bool */ protected function validateEmail($attribute, $value) { } /** * Validate the size of an attribute. * * @param string $attribute * @param mixed $value * @param array $parameters * * @return bool */ protected function validateSize($attribute, $value, $parameters) { } /** * Validate the size of an attribute is greater than a minimum value. * * @param string $attribute * @param mixed $value * @param array $parameters * * @return bool */ protected function validateMin($attribute, $value, $parameters) { } /** * Validate the size of an attribute is less than a maximum value. * * @param string $attribute * @param mixed $value * @param array $parameters * * @return bool */ protected function validateMax($attribute, $value, $parameters) { } /** * Validate that two attributes match. * * @param string $attribute * @param mixed $value * @param array $parameters * * @return bool */ protected function validateSame($attribute, $value, $parameters) { } /** * Validate that an attribute is a valid URL. * * @param string $attribute * @param mixed $value * * @return bool */ protected function validateUrl($attribute, $value) { } /** * Validate that an attribute is a string. * * @param string $attribute * @param mixed $value * @return bool */ protected function validateString($attribute, $value) { } /** * Validate that an attribute is a integer. * * @param string $attribute * @param mixed $value * @return bool */ protected function validateInt($attribute, $value) { } /** * Validate that an attribute is a integer. * * @param string $attribute * @param mixed $value * @return bool */ protected function validateInteger($attribute, $value) { } /** * Validate that an attribute has a given number of decimal places. * * @param string $attribute * @param mixed $value * @param array $parameters * @return bool */ protected function validateDecimal($attribute, $value, $parameters) { } /** * Validate that an attribute is numeric. * * @param string $attribute * @param mixed $value * * @return bool */ protected function validateNumeric($attribute, $value) { } /** * Validate that an attribute is a valid date. * * @param string $attribute * @param mixed $value * @return bool */ protected function validateDate($attribute, $value) { } /** * Validate that an attribute matches a date format. * * @param string $attribute * @param mixed $value * @param array $parameters * @return bool */ protected function validateDateFormat($attribute, $value, $parameters) { } /** * Validate that an attribute is alphabetic. * * @param string $attribute * @param mixed $value * * @return bool */ protected function validateAlpha($attribute, $value) { } /** * Validate that an attribute is alphanum. * * @param string $attribute * @param mixed $value * * @return bool */ protected function validateAlphanum($attribute, $value) { } /** * Validate that an attribute is alphanum and -_. * * @param string $attribute * @param mixed $value * * @return bool */ protected function validateAlphadash($attribute, $value) { } /** * Validate the guessed extension of a file upload is in a set of file extensions. * * @param string $attribute * @param mixed $value * @param array $parameters * * @return bool */ protected function validateMimes($attribute, $value, $parameters) { } /** * Validate the MIME type of a file upload attribute is in a set of MIME types. * * @param string $attribute * @param mixed $value * @param array $parameters * @return bool */ protected function validateMimetypes($attribute, $value, $parameters) { } /** * Check that the given value is a valid file instance. * * @param mixed $value * * @return bool */ protected function isValidFileInstance($value) { } /** * Check if PHP uploads are explicitly allowed. * * @param mixed $value * @param array $parameters * * @return bool */ protected function shouldBlockPhpUpload($value, $parameters) { } /** * Validate that an attribute exists even if not filled. * * @param string $attribute * @param mixed $value * * @return bool */ protected function validatePresent($attribute, $value) { } /** * Validate that an attribute has a given number of digits. * * @param string $attribute * @param mixed $value * @param array $parameters * * @return bool */ protected function validateDigits($attribute, $value, $parameters) { } /** * Validate that an attribute is an array. * * @param string $attribute * @param mixed $value * @param array $parameters * @return bool */ protected function validateArray($attribute, $value, $parameters = []) { } /** * Validate that an array has all of the given keys. * * @param string $attribute * @param mixed $value * @param array $parameters * @return bool */ protected function validateRequiredArrayKeys($attribute, $value, $parameters) { } /** * Validate that an attribute passes a regular expression check. * * @param string $attribute * @param mixed $value * @param array $parameters * @return bool */ protected function validateRegex($attribute, $value, $parameters) { } /** * Validate an attribute is contained within a list of values. * * @param string $attribute * @param mixed $value * @param array $parameters * @return bool */ protected function validateIn($attribute, $value, $parameters) { } /** * Validate an attribute is not contained within a list of values. * * @param string $attribute * @param mixed $value * @param array $parameters * @return bool */ protected function validateNotIn($attribute, $value, $parameters) { } } class ValidationData { /** * Gather all data * @param string $attribute * @param array $masterData * @return array */ public static function initializeAndGatherData($attribute, $masterData) { } /** * Gather a copy of the attribute data filled with any missing attributes. * * @param string $attribute * @param array $masterData * * @return array */ protected static function initializeAttributeOnData($attribute, $masterData) { } /** * Get all of the exact attribute values for a given wildcard attribute. * * @param array $masterData * @param array $data * @param string $attribute * * @return array */ protected static function extractValuesForWildcards($masterData, $data, $attribute) { } /** * Extract data based on the given dot-notated path. * * Used to extract a sub-section of the data for faster iteration. * * @param string $attribute * @param array $masterData * * @return array */ public static function extractDataFromPath($attribute, $masterData) { } /** * Get the explicit part of the attribute name. * * E.g. 'foo.bar.*.baz' -> 'foo.bar' * * Allows us to not spin through all of the flattened data for some operations. * * @param string $attribute * * @return string */ public static function getLeadingExplicitAttributePath($attribute) { } } class ValidationException extends \Exception { /** * The validation errors * * @var array */ protected $errors = []; /** * Construct the Validation Exception Instance * @param string $message * @param integer $code * @param \Exception|null $previous * @param array $errors */ public function __construct($message = "", $code = 0, ?\Exception $previous = null, $errors = []) { } /** * Retrieve the validation errors * @return array */ public function errors() { } } class ValidationRuleParser { /** * The data being validated. * * @var array */ public $data; /** * Create a new validation rule parser. * * @param array $data * * @return void */ public function __construct(array $data) { } /** * Parse the human-friendly rules into a full rules array for the validator. * * @param $rules * * @return array */ public function explode($rules) { } /** * Explode the rules into an array of explicit rules. * * @param array $rules * * @return array */ protected function explodeRules($rules) { } /** * Explode the explicit rule into an array if necessary. * * @param mixed $rule * * @return array */ protected function explodeExplicitRule($rule) { } /** * Parse conditional rules. * * @param \FluentCart\Framework\Validator\Rules\ConditionalRules $rule * @return array */ protected function parseConditionalRules($rule) { } /** * Define a set of rules that apply to each element in an array attribute. * * @param array $results * @param string $attribute * @param string|array $rules * * @return array */ protected function explodeWildcardRules($results, $attribute, $rules) { } /** * Merge additional rules into a given attribute(s). * * @param array $results * @param string|array $attribute * @param string|array $rules * @param string|null $originalRuleKey * * @return array */ public function mergeRules($results, $attribute, $rules = [], $originalRuleKey = null) { } /** * Merge additional rules into a given attribute. * * @param array $results * @param string $attribute * @param string|array $rules * @param string|null $originalRuleKey * * @return array */ protected function mergeRulesForAttribute($results, $attribute, $rules, $originalRuleKey = null) { } /** * Extract the rule name and parameters from a rule. * * @param $rule * * @return array */ public static function parse($rule) { } } class Validator { use \FluentCart\Framework\Validator\ValidatesAttributes, \FluentCart\Framework\Validator\MessageBag; /** * The rules that should be applied to the data. * * @var array */ protected $dependentRules = []; /** * Indicates whether the validate method is called or not. * @var boolean */ protected $isReady = false; /** * The data under validation. * * @var array */ protected $data; /** * The valid data after validation. * * @var array */ protected $validated; /** * The rules to be applied to the data. * * @var array */ protected $rules = []; /** * All of the error messages. * * @var array */ protected $messages; /** * All of the user provided messages. * * @var array */ protected $customMessages = []; /** * The validation rules that imply the field is required. * * @var array */ protected $implicitRules = ['Required', 'Filled', 'RequiredWith', 'RequiredWithAll', 'RequiredWithout', 'RequiredWithoutAll', 'RequiredIf', 'RequiredUnless', 'Accepted', 'Present']; /** * The current rule being handled * @var mixed */ protected $currentRule = null; /** * Custom rules added by developer * @var array */ protected static $customRules = []; /** * Create a new Validator instance. * * @param array $data * @param array $rules * @param array $messages * * @return void */ public function __construct(array $data = [], array $rules = [], array $messages = []) { } /** * Create a new Validator instance. * * @param array $data * @param array $rules * @param array $messages * * @return \FluentCart\Framework\Validator\Validator */ public static function make(array $data, array $rules = [], array $messages = []) { } /** * Set the validation rules. * * @param array $rules * * @return $this */ protected function setRules(array $rules = []) { } /** * Validate the data against the provided rules. * * @return $this */ public function validate(array $data = [], array $rules = []) { } /** * Remove rules that can be skipped (nullable, required_if, sometimes). * * @param string $attribute * @param array $rules * @return array */ protected function filterExcludeables(string $attribute, array $rules) { } /** * Filter required_if rules based on other field values. * * @param string $attribute * @param array $rules * @return array */ protected function filterRequiredIf(string $attribute, array $rules) { } /** * Resolves wildcard attributes to actual values from data * * @param string $path * @return array */ protected function getValues(string $path) { } /** * Mark that validation is ready. * * @return $this */ protected function ready() { } /** * Validate each of the attribute of the data. * * @param string $attribute * @param string $rule * @param string|null $key * @param string|null $originalRuleKey * * @return void */ protected function validateAttribute($attribute, $rule, $key = null, $originalRuleKey = null) { } /** * Determine if the given rule depends on other fields. * * @param string $rule * @return bool */ protected function dependsOnOtherFields($rule) { } /** * Access the data by attribute name. * * @param $attribute * * @return mixed */ protected function getValue($attribute) { } /** * Add error message upon validation failed of an attribute. * * @param $attribute * @param $rule * @param $parameters * @param $originalRuleKey * * @return void */ protected function addFailure($attribute, $rule, $parameters, $originalRuleKey = null) { } /** * Add validation error(s) manually. * * @param string|array $attribute * @param string $message * @return void */ public function addError($attribute, $message = 'Something went wrong.') { } /** * Add a single validation error manually. * * @param string $attribute * @param string $message * @return void */ public function setError($attribute, $message) { } /** * Manually pass a validation by clearing the messages. * * @return void */ public function pass() { } /** * Manually fail a validation by adding messages. * * @return void */ public function fail($attribute = 'Field.Rule', $message = 'Something went wrong.') { } /** * Get the first validation error message, or null if none exist. * * @return string|null */ public function firstError() { } /** * Get a single validation error message. * * @return array */ public function error($key) { } /** * Get one or all of the validation error messages. * * @return array */ public function errors($key = null) { } /** * Determine if the data passes the validation rules. * * @return bool */ public function passes() { } /** * Determine if the data fails the validation rules. * * @return bool */ public function fails() { } /** * Get the valid data after validation has been passed. * * @return array */ public function validated() { } /** * Set the valid data after validation has * been passed for a specific attribute. * * @param string $attribute * @param mixed $value * @return null */ public function setValidatedAttributeData($attribute, $value) { } /** * Add conditions to a given field based on a Closure. * * @param string|array $attribute * @param string|array $rules * @param callable $callback * * @return $this */ public function sometimes($attribute, $rules, callable $callback) { } /** * Determine if the attribute has a required rule. * * @param $attribute * * @return bool */ public function hasRequired($attribute) { } /** * Determine if the attribute should be validated. * * @param $method * @param $attribute * @param $value * * @return bool */ public function shouldValidate($rule, $attribute, $value) { } /** * Determines if this object has this method. * * @param $method * * @return bool */ public function hasMethod($method) { } /** * Determine if a given rule implies the attribute is required. * * @param string $rule * * @return bool */ protected function isImplicit($rule) { } /** * Determine if the field is present, or the rule implies required. * * @param string $rule * @param string $attribute * @param mixed $value * * @return bool */ protected function presentOrRuleIsImplicit($rule, $attribute, $value) { } public function extend($rule, $callback, $message = null) { } /** * Get all the custom rules with handlers * * @return array */ public function getExtentions() { } /** * Handle dynamic calls for custom rules * @param string $method * @param array $params * @return bool (true) */ public function __call($method, $params) { } } } namespace FluentCart\Framework\View { class View { /** * Application Instance * @var \FluentCart\Framework\Foundation\Application $app */ protected $app; /** * View file path * * @var string */ protected $path; /** * View data * @var array */ protected $data = []; /** * Shared data inall the views * @var array */ protected static $sharedData = []; /** * Construct the view instamce * @param \FluentCart\Framework\Foundation\Application $app */ public function __construct($app) { } /** * Generate and echo/print a view file * @param string $path * @param array $data * @return void */ public function render($path, $data = []) { } /** * Generate a view file * @param string $path * @param array $data * @return string [generated html] * @throws \Exception */ public function make($path, $data = []) { } /** * Load view from specified location. * * @param string $path * @param array $data * @return string * @throws \Exception */ public function loadViewFrom($path, $data) { } /** * Throw view not found exception. * * @return void * @throws \Exception */ protected function handleViewNotFoundException($path) { } /** * Prepare data for view. * * @param array $data * @return self */ protected function prepareData($data) { } /** * Resolve the view file path * @param string $path * @return string */ protected function resolveFilePath($path) { } /** * Evaluate the view file * @param \FluentCart\Framework\Foundation\Application $app * @return $this */ protected function renderContent($app) { } /** * Get normalized path. * * @return string */ protected function getNormalizedPath() { } /** * Share global data for any view * @param string $key * @param mixed $value * @return void */ public function share($key, $value) { } /** * Reset all shared view data (useful for test isolation). * * @return void */ public static function resetSharedData() { } /** * Provides a fluent interface to set data * @param array|string $name * @param mixed $data * @return $this */ public function with($name, $data = []) { } /** * Set view path (used for micro). * * @param string $path */ public function setViewPath($path) { } /** * Get the resolved view path. * * @return string */ public function getResolvedPath() { } /** * Getter for the view. * * @param string $key */ public function __get($key) { } /** * Setter for the view * @param string $key * @param mixed $value */ public function __set($key, $value) { } /** * Return the view data. * * @return array */ public function toArray() { } /** * Dump the view result. * * @return string */ public function __toString() { } /** * Prevent unserialization (legacy PHP <7.4) */ public function __wakeup() { } /** * Prevent unserialization (PHP >=7.4) */ public function __unserialize(array $data) { } /** * Handle unserialization error. * * @return void * @throws \LogicException */ protected function handleUnserializeNotAllowedException() { } } } namespace { // WRCS: DEFINED_VERSION. /** * Registers this version of Action Scheduler. */ function fluent_cart_scheduler_register() { } /** * Initializes this version of Action Scheduler. */ function fluent_cart_scheduler_initialize() { } function fluentCart($module = \false) { } /** * * @return \FluentCart\App\Helpers\FluentCartUtilHelper */ function fluentCartUtil() { } function fluent_cart_success_log($title, $content, $otherInfo = []) { } function fluent_cart_error_log($title, $content, $otherInfo = []) { } function fluent_cart_warning_log($title, $content, $otherInfo = []) { } function fluent_cart_add_log($title, $content, $logStatus = "info", $otherInfo = []) { } /** * * @return \FluentCart\Api\Resource\FrontendResource\FluentMetaResource; * * param String $meta_key * param Boolean $default */ function fluent_cart_get_option($meta_key, $default = \false, $cache = \true) { } /** * * @return \FluentCart\App\Models\Meta|\FluentCart\Framework\Database\Orm\Builder; * * param $meta_key, $meta_value */ function fluent_cart_update_option($meta_key, $meta_value) { } function fluent_cart_api() { } function fluent_cart_get_current_product() { } function fluentcart_eql() { } function fluentcart_gql() { } function dd() { } }