pub struct Promotions { /* private fields */ }Implementations§
Source§impl Promotions
impl Promotions
pub fn create( &self, code: String, name: String, discount_type: String, discount_value: f64, min_purchase: Option<f64>, max_uses: Option<i32>, ) -> PhpResult<Promotion>
pub fn get(&self, id: String) -> PhpResult<Option<Promotion>>
pub fn get_by_code(&self, code: String) -> PhpResult<Option<Promotion>>
pub fn list(&self) -> PhpResult<Vec<Promotion>>
pub fn activate(&self, id: String) -> PhpResult<Promotion>
pub fn deactivate(&self, id: String) -> PhpResult<Promotion>
pub fn get_active(&self) -> PhpResult<Vec<Promotion>>
pub fn is_valid( &self, code: String, order_total: Option<f64>, ) -> PhpResult<bool>
pub fn delete(&self, id: String) -> PhpResult<bool>
Trait Implementations§
Source§impl Clone for Promotions
impl Clone for Promotions
Source§fn clone(&self) -> Promotions
fn clone(&self) -> Promotions
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl<'a> FromZendObject<'a> for &'a Promotions
impl<'a> FromZendObject<'a> for &'a Promotions
Source§fn from_zend_object(obj: &'a ZendObject) -> Result<Self>
fn from_zend_object(obj: &'a ZendObject) -> Result<Self>
Extracts
Self from the source ZendObject.Source§impl<'a> FromZendObjectMut<'a> for &'a mut Promotions
impl<'a> FromZendObjectMut<'a> for &'a mut Promotions
Source§fn from_zend_object_mut(obj: &'a mut ZendObject) -> Result<Self>
fn from_zend_object_mut(obj: &'a mut ZendObject) -> Result<Self>
Extracts
Self from the source ZendObject.Source§impl<'a> FromZval<'a> for &'a Promotions
impl<'a> FromZval<'a> for &'a Promotions
Source§impl<'a> FromZvalMut<'a> for &'a mut Promotions
impl<'a> FromZvalMut<'a> for &'a mut Promotions
Source§impl IntoZendObject for Promotions
impl IntoZendObject for Promotions
Source§fn into_zend_object(self) -> Result<ZBox<ZendObject>>
fn into_zend_object(self) -> Result<ZBox<ZendObject>>
Attempts to convert
self into a Zend object.Source§impl IntoZval for Promotions
impl IntoZval for Promotions
Source§impl RegisteredClass for Promotions
impl RegisteredClass for Promotions
Source§const CLASS_NAME: &'static str = "StateSet\\Promotions"
const CLASS_NAME: &'static str = "StateSet\\Promotions"
PHP class name of the registered class.
Source§const CONSTRUCTOR: Option<ConstructorMeta<Self>> = None
const CONSTRUCTOR: Option<ConstructorMeta<Self>> = None
Optional class constructor.
Source§fn get_metadata() -> &'static ClassMetadata<Self>
fn get_metadata() -> &'static ClassMetadata<Self>
Returns a reference to the class metadata, which stores the class entry
and handlers. Read more
Auto Trait Implementations§
impl Freeze for Promotions
impl RefUnwindSafe for Promotions
impl Send for Promotions
impl Sync for Promotions
impl Unpin for Promotions
impl UnsafeUnpin for Promotions
impl UnwindSafe for Promotions
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more