$s Viva\API\Entity\Setting (11)
  • Properties (11)
  • Available methods (21)
  • Static class properties (3)
  • public categories -> array (4)
    $s->categories
    pizza => integer 60
    $s->categories['pizza']
    drink => integer 96
    $s->categories['drink']
    sauce => integer 94
    $s->categories['sauce']
    sushi => integer 765
    $s->categories['sushi']
    public constructor -> array (2)
    $s->constructor
    base => integer 23
    $s->constructor['base']
    sizes => array (2)
    $s->constructor['sizes']
    • Table (2)
    • Contents (2)
    • sizeprice
      03069
      14099
    • 0 => array (2)
      $s->constructor['sizes'][0]
      size => string (2) "30"
      $s->constructor['sizes'][0]['size']
      price => string (2) "69"
      $s->constructor['sizes'][0]['price']
      1 => array (2)
      $s->constructor['sizes'][1]
      size => string (2) "40"
      $s->constructor['sizes'][1]['size']
      price => string (2) "99"
      $s->constructor['sizes'][1]['price']
    public content -> string (0) ""
    $s->content
    public create_date -> string (19) "2021-01-31 20:48:59"
    $s->create_date
    public excerpt -> string (0) ""
    $s->excerpt
    public external_IP -> string (71) "http://isp1.vivapizza.dns-cloud.net,http://isp2.vivapizza.dns-cloud.net"
    $s->external_IP
    public id -> integer 39420
    $s->id
    public ratios -> array (2)
    $s->ratios
    • Table (2)
    • Contents (2)
    • sizeratioweight_ratio
      03011
      1401.51.5
    • 0 => array (3)
      $s->ratios[0]
      size => string (2) "30"
      $s->ratios[0]['size']
      ratio => string (1) "1"
      $s->ratios[0]['ratio']
      weight_ratio => string (1) "1"
      $s->ratios[0]['weight_ratio']
      1 => array (3)
      $s->ratios[1]
      size => string (2) "40"
      $s->ratios[1]['size']
      ratio => string (3) "1.5"
      $s->ratios[1]['ratio']
      weight_ratio => string (3) "1.5"
      $s->ratios[1]['weight_ratio']
    public slug -> string (15) "global-settings"
    $s->slug
    public status -> string (7) "publish"
    $s->status
    public title -> UTF-8 string (22) "Глобальні налаштування"
    $s->title
  • public load_ratios()
    $s->load_ratios()
    Defined in <ROOT>/app/themes/viva-api/Entity/Setting.php:18
    public save_ratios()
    $s->save_ratios()
    Defined in <ROOT>/app/themes/viva-api/Entity/Setting.php:24
    public load_categories()
    $s->load_categories()
    Defined in <ROOT>/app/themes/viva-api/Entity/Setting.php:28
    public save_categories()
    $s->save_categories()
    Defined in <ROOT>/app/themes/viva-api/Entity/Setting.php:39
    public load_constructor()
    $s->load_constructor()
    Defined in <ROOT>/app/themes/viva-api/Entity/Setting.php:43
    public save_constructor()
    $s->save_constructor()
    Defined in <ROOT>/app/themes/viva-api/Entity/Setting.php:50
    public get_ratio_by_size(string $size)
    $s->get_ratio_by_size(string $size)
    Defined in <ROOT>/app/themes/viva-api/Entity/Setting.php:54
    public __construct($matches = null) constructor of the class
    new \Viva\API\Entity\Setting($matches = null)
    /**
    * constructor of the class
    *
    * @param mixed $matches - Can be empty or id of wp_post or WP_POST object or array with values
    */
    
    Inherited from Viva\API\Entity\PostType
    Defined in <ROOT>/app/themes/viva-api/Entity/PostType.php:28
    public set($name, $value): $this - return object of class Global setters for all public fields of class
    $s->set($name, $value)
    /**
    * Global setters for all public fields of class
    *
    * @param $name - name of field
    * @param $value - value of field
    *
    * @return $this - return object of class
    */
    
    Inherited from Viva\API\Entity\PostType
    Defined in <ROOT>/app/themes/viva-api/Entity/PostType.php:52
    public get($name): mixed - value of the field $name or false if not exist Global getters for all public fields of class
    $s->get($name)
    /**
    * Global getters for all public fields of class
    *
    * @param $name - name of field
    *
    * @return mixed - value of the field $name or false if not exist
    */
    
    Inherited from Viva\API\Entity\PostType
    Defined in <ROOT>/app/themes/viva-api/Entity/PostType.php:72
    public load_field($field): $this Loaded and set the value for $field from DB
    $s->load_field($field)
    /**
    * Loaded and set the value for $field from DB
    *
    * @param $field
    *
    * @return $this
    */
    
    Inherited from Viva\API\Entity\PostType
    Defined in <ROOT>/app/themes/viva-api/Entity/PostType.php:93
    public save_field($field, $value = ''): $this Save the value for $field to the DB
    $s->save_field($field, $value = '')
    /**
    * Save the value for $field to the DB
    *
    * @param $field
    * @param $value
    *
    * @return $this
    */
    
    Inherited from Viva\API\Entity\PostType
    Defined in <ROOT>/app/themes/viva-api/Entity/PostType.php:113
    public create_from_post(WP_Post $post, $force = false): $this - return object of class loads values of fields from WP_Post
    $s->create_from_post(WP_Post $post, $force = false)
    /**
    * loads values of fields from WP_Post
    *
    * @param \WP_Post $post - The wp_post from which the data will be taken
    * @param bool $force - if false than data will taken if post_type == $MACHINE_NAME of class only, if true data will taken from any post
    *
    * @return $this - return object of class
    */
    
    Inherited from Viva\API\Entity\PostType
    Defined in <ROOT>/app/themes/viva-api/Entity/PostType.php:136
    public update_from_array(array $array): $this Set values for fields from array
    $s->update_from_array(array $array)
    /**
    * Set values for fields from array
    *
    * @param array $array - array where keys it is names of fields and values it is values of fields
    *
    * @return $this
    */
    
    Inherited from Viva\API\Entity\PostType
    Defined in <ROOT>/app/themes/viva-api/Entity/PostType.php:168
    public to_array()
    $s->to_array()
    Inherited from Viva\API\Entity\PostType
    Defined in <ROOT>/app/themes/viva-api/Entity/PostType.php:178
    public save($extra_fields = array()): $this Insert or Update data of object in the database
    $s->save($extra_fields = array())
    /**
    *
    * Insert or Update data of object in the database
    *
    * @param array $extra_fields
    *
    * @return $this
    */
    
    Inherited from Viva\API\Entity\PostType
    Defined in <ROOT>/app/themes/viva-api/Entity/PostType.php:210
    public static init($singular_name, $plural_name, $text_domain)
    \Viva\API\Entity\Setting::init($singular_name, $plural_name, $text_domain)
    /**
    * @param $singular_name
    * @param $plural_name
    * @param $text_domain
    */
    
    Defined in <ROOT>/app/themes/viva-api/Entity/Setting.php:72
    public static create($mixed)
    \Viva\API\Entity\PostType::create($mixed)
    Inherited from Viva\API\Entity\PostType
    Defined in <ROOT>/app/themes/viva-api/Entity/PostType.php:249
    public static register_meta_boxes() Function for register the meta boxes
    \Viva\API\Entity\PostType::register_meta_boxes()
    /**
    * Function for register the meta boxes
    */
    
    Inherited from Viva\API\Entity\PostType
    Defined in <ROOT>/app/themes/viva-api/Entity/PostType.php:283
    public static save_meta_box($post_id) Function for filter save_post. Save meta_data for post_type
    \Viva\API\Entity\PostType::save_meta_box($post_id)
    /**
    * Function for filter save_post. Save meta_data for post_type
    *
    * @param $post_id
    */
    
    Inherited from Viva\API\Entity\PostType
    Defined in <ROOT>/app/themes/viva-api/Entity/PostType.php:292
    public static get_featured_image($post_id, $size = 'thumbnail'): string Get featured image
    \Viva\API\Entity\PostType::get_featured_image($post_id, $size = 'thumbnail')
    /**
    * Get featured image
    *
    * @param $post_id
    * @param string $size
    *
    * @return string
    */
    
    Inherited from Viva\API\Entity\PostType
    Defined in <ROOT>/app/themes/viva-api/Entity/PostType.php:342
  • public static $MACHINE_NAME :: string (12) "viva_setting"
    \Viva\API\Entity\Setting::$MACHINE_NAME
    public static $METAFIELDS :: array (4)
    \Viva\API\Entity\Setting::$METAFIELDS
    0 => string (6) "ratios"
    \Viva\API\Entity\Setting::$METAFIELDS[0]
    1 => string (10) "categories"
    \Viva\API\Entity\Setting::$METAFIELDS[1]
    2 => string (11) "constructor"
    \Viva\API\Entity\Setting::$METAFIELDS[2]
    3 => string (11) "external_IP"
    \Viva\API\Entity\Setting::$METAFIELDS[3]
    public static $TAXONOMIES :: array (0)
    \Viva\API\Entity\Setting::$TAXONOMIES
$ingredient Viva\API\Entity\Ingredient (15)
  • Properties (15)
  • Available methods (16)
  • Static class properties (4)
  • public additional -> string (1) "0"
    $ingredient->additional
    public constructor_start -> array (2)
    $ingredient->constructor_start
    0 => UTF-8 string (12) "сир моцарела"
    $ingredient->constructor_start[0]
    1 => UTF-8 string (7) "орегано"
    $ingredient->constructor_start[1]
    public content -> string (0) ""
    $ingredient->content
    public create_date -> string (19) "2020-09-05 19:29:03"
    $ingredient->create_date
    public crm_id_30 -> string (2) "94"
    $ingredient->crm_id_30
    public crm_id_40 -> string (2) "95"
    $ingredient->crm_id_40
    public excerpt -> string (0) ""
    $ingredient->excerpt
    public id -> integer 36752
    $ingredient->id
    public price -> string (0) ""
    $ingredient->price
    public qty -> null
    $ingredient->qty
    public slug -> string (12) "tomato-sauce"
    $ingredient->slug
    public solid -> string (1) "0"
    $ingredient->solid
    public status -> string (7) "publish"
    $ingredient->status
    public title -> UTF-8 string (13) "соус томатний"
    $ingredient->title
    public weight -> string (0) ""
    $ingredient->weight
  • public load_constructor_start()
    $ingredient->load_constructor_start()
    Defined in <ROOT>/app/themes/viva-api/Entity/Ingredient.php:30
    public save_constructor_start()
    $ingredient->save_constructor_start()
    Defined in <ROOT>/app/themes/viva-api/Entity/Ingredient.php:44
    public __construct($matches = null) constructor of the class
    new \Viva\API\Entity\Ingredient($matches = null)
    /**
    * constructor of the class
    *
    * @param mixed $matches - Can be empty or id of wp_post or WP_POST object or array with values
    */
    
    Inherited from Viva\API\Entity\PostType
    Defined in <ROOT>/app/themes/viva-api/Entity/PostType.php:28
    public set($name, $value): $this - return object of class Global setters for all public fields of class
    $ingredient->set($name, $value)
    /**
    * Global setters for all public fields of class
    *
    * @param $name - name of field
    * @param $value - value of field
    *
    * @return $this - return object of class
    */
    
    Inherited from Viva\API\Entity\PostType
    Defined in <ROOT>/app/themes/viva-api/Entity/PostType.php:52
    public get($name): mixed - value of the field $name or false if not exist Global getters for all public fields of class
    $ingredient->get($name)
    /**
    * Global getters for all public fields of class
    *
    * @param $name - name of field
    *
    * @return mixed - value of the field $name or false if not exist
    */
    
    Inherited from Viva\API\Entity\PostType
    Defined in <ROOT>/app/themes/viva-api/Entity/PostType.php:72
    public load_field($field): $this Loaded and set the value for $field from DB
    $ingredient->load_field($field)
    /**
    * Loaded and set the value for $field from DB
    *
    * @param $field
    *
    * @return $this
    */
    
    Inherited from Viva\API\Entity\PostType
    Defined in <ROOT>/app/themes/viva-api/Entity/PostType.php:93
    public save_field($field, $value = ''): $this Save the value for $field to the DB
    $ingredient->save_field($field, $value = '')
    /**
    * Save the value for $field to the DB
    *
    * @param $field
    * @param $value
    *
    * @return $this
    */
    
    Inherited from Viva\API\Entity\PostType
    Defined in <ROOT>/app/themes/viva-api/Entity/PostType.php:113
    public create_from_post(WP_Post $post, $force = false): $this - return object of class loads values of fields from WP_Post
    $ingredient->create_from_post(WP_Post $post, $force = false)
    /**
    * loads values of fields from WP_Post
    *
    * @param \WP_Post $post - The wp_post from which the data will be taken
    * @param bool $force - if false than data will taken if post_type == $MACHINE_NAME of class only, if true data will taken from any post
    *
    * @return $this - return object of class
    */
    
    Inherited from Viva\API\Entity\PostType
    Defined in <ROOT>/app/themes/viva-api/Entity/PostType.php:136
    public update_from_array(array $array): $this Set values for fields from array
    $ingredient->update_from_array(array $array)
    /**
    * Set values for fields from array
    *
    * @param array $array - array where keys it is names of fields and values it is values of fields
    *
    * @return $this
    */
    
    Inherited from Viva\API\Entity\PostType
    Defined in <ROOT>/app/themes/viva-api/Entity/PostType.php:168
    public to_array()
    $ingredient->to_array()
    Inherited from Viva\API\Entity\PostType
    Defined in <ROOT>/app/themes/viva-api/Entity/PostType.php:178
    public save($extra_fields = array()): $this Insert or Update data of object in the database
    $ingredient->save($extra_fields = array())
    /**
    *
    * Insert or Update data of object in the database
    *
    * @param array $extra_fields
    *
    * @return $this
    */
    
    Inherited from Viva\API\Entity\PostType
    Defined in <ROOT>/app/themes/viva-api/Entity/PostType.php:210
    public static init($singular_name, $plural_name, $text_domain)
    \Viva\API\Entity\Ingredient::init($singular_name, $plural_name, $text_domain)
    /**
    * @param $singular_name
    * @param $plural_name
    * @param $text_domain
    */
    
    Defined in <ROOT>/app/themes/viva-api/Entity/Ingredient.php:53
    public static create($mixed)
    \Viva\API\Entity\PostType::create($mixed)
    Inherited from Viva\API\Entity\PostType
    Defined in <ROOT>/app/themes/viva-api/Entity/PostType.php:249
    public static register_meta_boxes() Function for register the meta boxes
    \Viva\API\Entity\PostType::register_meta_boxes()
    /**
    * Function for register the meta boxes
    */
    
    Inherited from Viva\API\Entity\PostType
    Defined in <ROOT>/app/themes/viva-api/Entity/PostType.php:283
    public static save_meta_box($post_id) Function for filter save_post. Save meta_data for post_type
    \Viva\API\Entity\PostType::save_meta_box($post_id)
    /**
    * Function for filter save_post. Save meta_data for post_type
    *
    * @param $post_id
    */
    
    Inherited from Viva\API\Entity\PostType
    Defined in <ROOT>/app/themes/viva-api/Entity/PostType.php:292
    public static get_featured_image($post_id, $size = 'thumbnail'): string Get featured image
    \Viva\API\Entity\PostType::get_featured_image($post_id, $size = 'thumbnail')
    /**
    * Get featured image
    *
    * @param $post_id
    * @param string $size
    *
    * @return string
    */
    
    Inherited from Viva\API\Entity\PostType
    Defined in <ROOT>/app/themes/viva-api/Entity/PostType.php:342
  • public static $MACHINE_NAME :: string (10) "ingredient"
    \Viva\API\Entity\Ingredient::$MACHINE_NAME
    public static $METAFIELDS :: array (8)
    \Viva\API\Entity\Ingredient::$METAFIELDS
    0 => string (5) "price"
    \Viva\API\Entity\Ingredient::$METAFIELDS[0]
    1 => string (6) "weight"
    \Viva\API\Entity\Ingredient::$METAFIELDS[1]
    2 => string (10) "additional"
    \Viva\API\Entity\Ingredient::$METAFIELDS[2]
    3 => string (5) "solid"
    \Viva\API\Entity\Ingredient::$METAFIELDS[3]
    4 => string (5) "image"
    \Viva\API\Entity\Ingredient::$METAFIELDS[4]
    5 => string (9) "crm_id_30"
    \Viva\API\Entity\Ingredient::$METAFIELDS[5]
    6 => string (9) "crm_id_40"
    \Viva\API\Entity\Ingredient::$METAFIELDS[6]
    7 => string (17) "constructor_start"
    \Viva\API\Entity\Ingredient::$METAFIELDS[7]
    public static $CATEGORY_TAXONOMY_NAME :: string (19) "ingredient_category"
    \Viva\API\Entity\Ingredient::$CATEGORY_TAXONOMY_NAME
    public static $TAXONOMIES :: array (1)
    \Viva\API\Entity\Ingredient::$TAXONOMIES
    ingredient_category => array (2)
    \Viva\API\Entity\Ingredient::$TAXONOMIES['ingredient_category']
    singular => string (19) "Ingredient category"
    \Viva\API\Entity\Ingredient::$TAXONOMIES['ingredient_category']['singular']
    plural => string (21) "Ingredient categories"
    \Viva\API\Entity\Ingredient::$TAXONOMIES['ingredient_category']['plural']
$product_data Viva\API\Entity\Product (11)
  • Properties (11)
  • Available methods (23)
  • Static class properties (4)
  • public content -> null
    $product_data->content
    public create_date -> null
    $product_data->create_date
    public excerpt -> null
    $product_data->excerpt
    public id -> integer -1
    $product_data->id
    public ingredients -> array (2)
    $product_data->ingredients
    0 => UTF-8 string (12) "сир моцарела"
    $product_data->ingredients[0]
    1 => UTF-8 string (7) "орегано"
    $product_data->ingredients[1]
    public lent -> null
    $product_data->lent
    public slug -> null
    $product_data->slug
    public status -> string (7) "publish"
    $product_data->status
    public template -> null
    $product_data->template
    public title -> UTF-8 string (38) "Піца за Вашим рецептом (соус томатний)"
    $product_data->title
    public variations -> array (2)
    $product_data->variations
    94 => stdClass (2)
    $product_data->variations[94]
    • Properties (2)
    • public price -> string (2) "69"
      $product_data->variations[94]->price
      public size -> string (2) "30"
      $product_data->variations[94]->size
    95 => stdClass (2)
    $product_data->variations[95]
    • Properties (2)
    • public price -> string (2) "99"
      $product_data->variations[95]->price
      public size -> string (2) "40"
      $product_data->variations[95]->size
  • public load_variations()
    $product_data->load_variations()
    Defined in <ROOT>/app/themes/viva-api/Entity/Product.php:26
    public save_variations()
    $product_data->save_variations()
    Defined in <ROOT>/app/themes/viva-api/Entity/Product.php:38
    public load_ingredients()
    $product_data->load_ingredients()
    Defined in <ROOT>/app/themes/viva-api/Entity/Product.php:42
    public save_ingredients()
    $product_data->save_ingredients()
    Defined in <ROOT>/app/themes/viva-api/Entity/Product.php:56
    public load_lent()
    $product_data->load_lent()
    Defined in <ROOT>/app/themes/viva-api/Entity/Product.php:60
    public save_lent()
    $product_data->save_lent()
    Defined in <ROOT>/app/themes/viva-api/Entity/Product.php:66
    public get_variation_by_id(string $id = '')
    $product_data->get_variation_by_id(string $id = '')
    Defined in <ROOT>/app/themes/viva-api/Entity/Product.php:70
    public get_price(string $variationId = ''): string Get product variation price by variation id
    $product_data->get_price(string $variationId = '')
    /**
    * Get product variation price by variation id
    *
    * @param string|null $variationId
    *
    * @return string
    */
    
    Defined in <ROOT>/app/themes/viva-api/Entity/Product.php:81
    public get_size_by_variation_id(string $variationId = ''): string
    $product_data->get_size_by_variation_id(string $variationId = '')
    Defined in <ROOT>/app/themes/viva-api/Entity/Product.php:88
    public __construct($matches = null) constructor of the class
    new \Viva\API\Entity\Product($matches = null)
    /**
    * constructor of the class
    *
    * @param mixed $matches - Can be empty or id of wp_post or WP_POST object or array with values
    */
    
    Inherited from Viva\API\Entity\PostType
    Defined in <ROOT>/app/themes/viva-api/Entity/PostType.php:28
    public set($name, $value): $this - return object of class Global setters for all public fields of class
    $product_data->set($name, $value)
    /**
    * Global setters for all public fields of class
    *
    * @param $name - name of field
    * @param $value - value of field
    *
    * @return $this - return object of class
    */
    
    Inherited from Viva\API\Entity\PostType
    Defined in <ROOT>/app/themes/viva-api/Entity/PostType.php:52
    public get($name): mixed - value of the field $name or false if not exist Global getters for all public fields of class
    $product_data->get($name)
    /**
    * Global getters for all public fields of class
    *
    * @param $name - name of field
    *
    * @return mixed - value of the field $name or false if not exist
    */
    
    Inherited from Viva\API\Entity\PostType
    Defined in <ROOT>/app/themes/viva-api/Entity/PostType.php:72
    public load_field($field): $this Loaded and set the value for $field from DB
    $product_data->load_field($field)
    /**
    * Loaded and set the value for $field from DB
    *
    * @param $field
    *
    * @return $this
    */
    
    Inherited from Viva\API\Entity\PostType
    Defined in <ROOT>/app/themes/viva-api/Entity/PostType.php:93
    public save_field($field, $value = ''): $this Save the value for $field to the DB
    $product_data->save_field($field, $value = '')
    /**
    * Save the value for $field to the DB
    *
    * @param $field
    * @param $value
    *
    * @return $this
    */
    
    Inherited from Viva\API\Entity\PostType
    Defined in <ROOT>/app/themes/viva-api/Entity/PostType.php:113
    public create_from_post(WP_Post $post, $force = false): $this - return object of class loads values of fields from WP_Post
    $product_data->create_from_post(WP_Post $post, $force = false)
    /**
    * loads values of fields from WP_Post
    *
    * @param \WP_Post $post - The wp_post from which the data will be taken
    * @param bool $force - if false than data will taken if post_type == $MACHINE_NAME of class only, if true data will taken from any post
    *
    * @return $this - return object of class
    */
    
    Inherited from Viva\API\Entity\PostType
    Defined in <ROOT>/app/themes/viva-api/Entity/PostType.php:136
    public update_from_array(array $array): $this Set values for fields from array
    $product_data->update_from_array(array $array)
    /**
    * Set values for fields from array
    *
    * @param array $array - array where keys it is names of fields and values it is values of fields
    *
    * @return $this
    */
    
    Inherited from Viva\API\Entity\PostType
    Defined in <ROOT>/app/themes/viva-api/Entity/PostType.php:168
    public to_array()
    $product_data->to_array()
    Inherited from Viva\API\Entity\PostType
    Defined in <ROOT>/app/themes/viva-api/Entity/PostType.php:178
    public save($extra_fields = array()): $this Insert or Update data of object in the database
    $product_data->save($extra_fields = array())
    /**
    *
    * Insert or Update data of object in the database
    *
    * @param array $extra_fields
    *
    * @return $this
    */
    
    Inherited from Viva\API\Entity\PostType
    Defined in <ROOT>/app/themes/viva-api/Entity/PostType.php:210
    public static init($singular_name, $plural_name, $text_domain)
    \Viva\API\Entity\Product::init($singular_name, $plural_name, $text_domain)
    /**
    * @param $singular_name
    * @param $plural_name
    * @param $text_domain
    */
    
    Defined in <ROOT>/app/themes/viva-api/Entity/Product.php:98
    public static create($mixed)
    \Viva\API\Entity\PostType::create($mixed)
    Inherited from Viva\API\Entity\PostType
    Defined in <ROOT>/app/themes/viva-api/Entity/PostType.php:249
    public static register_meta_boxes() Function for register the meta boxes
    \Viva\API\Entity\PostType::register_meta_boxes()
    /**
    * Function for register the meta boxes
    */
    
    Inherited from Viva\API\Entity\PostType
    Defined in <ROOT>/app/themes/viva-api/Entity/PostType.php:283
    public static save_meta_box($post_id) Function for filter save_post. Save meta_data for post_type
    \Viva\API\Entity\PostType::save_meta_box($post_id)
    /**
    * Function for filter save_post. Save meta_data for post_type
    *
    * @param $post_id
    */
    
    Inherited from Viva\API\Entity\PostType
    Defined in <ROOT>/app/themes/viva-api/Entity/PostType.php:292
    public static get_featured_image($post_id, $size = 'thumbnail'): string Get featured image
    \Viva\API\Entity\PostType::get_featured_image($post_id, $size = 'thumbnail')
    /**
    * Get featured image
    *
    * @param $post_id
    * @param string $size
    *
    * @return string
    */
    
    Inherited from Viva\API\Entity\PostType
    Defined in <ROOT>/app/themes/viva-api/Entity/PostType.php:342
  • public static $MACHINE_NAME :: string (7) "product"
    \Viva\API\Entity\Product::$MACHINE_NAME
    public static $METAFIELDS :: array (4)
    \Viva\API\Entity\Product::$METAFIELDS
    0 => string (10) "variations"
    \Viva\API\Entity\Product::$METAFIELDS[0]
    1 => string (11) "ingredients"
    \Viva\API\Entity\Product::$METAFIELDS[1]
    2 => string (4) "lent"
    \Viva\API\Entity\Product::$METAFIELDS[2]
    3 => string (8) "template"
    \Viva\API\Entity\Product::$METAFIELDS[3]
    public static $CATEGORY_TAXONOMY_NAME :: string (16) "product_category"
    \Viva\API\Entity\Product::$CATEGORY_TAXONOMY_NAME
    public static $TAXONOMIES :: array (1)
    \Viva\API\Entity\Product::$TAXONOMIES
    product_category => array (2)
    \Viva\API\Entity\Product::$TAXONOMIES['product_category']
    singular => string (16) "Product category"
    \Viva\API\Entity\Product::$TAXONOMIES['product_category']['singular']
    plural => string (18) "Product categories"
    \Viva\API\Entity\Product::$TAXONOMIES['product_category']['plural']
$product Viva\API\Entity\Product (11)
  • Properties (11)
  • Available methods (23)
  • Static class properties (4)
  • public content -> string (0) ""
    $product->content
    public create_date -> string (19) "2020-11-19 14:52:23"
    $product->create_date
    public excerpt -> string (0) ""
    $product->excerpt
    public id -> integer 38553
    $product->id
    public ingredients -> array (6)
    $product->ingredients
    0 => UTF-8 string (21) "соус томатний гострий"
    $product->ingredients[0]
    1 => UTF-8 string (12) "сир моцарела"
    $product->ingredients[1]
    2 => UTF-8 string (16) "салямі баварська"
    $product->ingredients[2]
    3 => UTF-8 string (14) "цибуля червона"
    $product->ingredients[3]
    4 => UTF-8 string (12) "томати свіжі"
    $product->ingredients[4]
    5 => UTF-8 string (7) "орегано"
    $product->ingredients[5]
    public lent -> boolean false
    $product->lent
    public slug -> string (20) "picza-meksika-gostra"
    $product->slug
    public status -> string (7) "publish"
    $product->status
    public template -> string (6) "double"
    $product->template
    public title -> UTF-8 string (21) "Піца Мексика (гостра)"
    $product->title
    public variations -> array (2)
    $product->variations
    156 => stdClass (6)
    $product->variations[156]
    • Properties (6)
    • public crm_id -> string (3) "156"
      $product->variations[156]->crm_id
      public id -> string (0) ""
      $product->variations[156]->id
      public price -> string (3) "105"
      $product->variations[156]->price
      public size -> string (2) "30"
      $product->variations[156]->size
      public volume -> string (0) ""
      $product->variations[156]->volume
      public weight -> string (3) "500"
      $product->variations[156]->weight
    157 => stdClass (6)
    $product->variations[157]
    • Properties (6)
    • public crm_id -> string (3) "157"
      $product->variations[157]->crm_id
      public id -> string (0) ""
      $product->variations[157]->id
      public price -> string (3) "150"
      $product->variations[157]->price
      public size -> string (2) "40"
      $product->variations[157]->size
      public volume -> string (0) ""
      $product->variations[157]->volume
      public weight -> string (3) "900"
      $product->variations[157]->weight
  • public load_variations()
    $product->load_variations()
    Defined in <ROOT>/app/themes/viva-api/Entity/Product.php:26
    public save_variations()
    $product->save_variations()
    Defined in <ROOT>/app/themes/viva-api/Entity/Product.php:38
    public load_ingredients()
    $product->load_ingredients()
    Defined in <ROOT>/app/themes/viva-api/Entity/Product.php:42
    public save_ingredients()
    $product->save_ingredients()
    Defined in <ROOT>/app/themes/viva-api/Entity/Product.php:56
    public load_lent()
    $product->load_lent()
    Defined in <ROOT>/app/themes/viva-api/Entity/Product.php:60
    public save_lent()
    $product->save_lent()
    Defined in <ROOT>/app/themes/viva-api/Entity/Product.php:66
    public get_variation_by_id(string $id = '')
    $product->get_variation_by_id(string $id = '')
    Defined in <ROOT>/app/themes/viva-api/Entity/Product.php:70
    public get_price(string $variationId = ''): string Get product variation price by variation id
    $product->get_price(string $variationId = '')
    /**
    * Get product variation price by variation id
    *
    * @param string|null $variationId
    *
    * @return string
    */
    
    Defined in <ROOT>/app/themes/viva-api/Entity/Product.php:81
    public get_size_by_variation_id(string $variationId = ''): string
    $product->get_size_by_variation_id(string $variationId = '')
    Defined in <ROOT>/app/themes/viva-api/Entity/Product.php:88
    public __construct($matches = null) constructor of the class
    new \Viva\API\Entity\Product($matches = null)
    /**
    * constructor of the class
    *
    * @param mixed $matches - Can be empty or id of wp_post or WP_POST object or array with values
    */
    
    Inherited from Viva\API\Entity\PostType
    Defined in <ROOT>/app/themes/viva-api/Entity/PostType.php:28
    public set($name, $value): $this - return object of class Global setters for all public fields of class
    $product->set($name, $value)
    /**
    * Global setters for all public fields of class
    *
    * @param $name - name of field
    * @param $value - value of field
    *
    * @return $this - return object of class
    */
    
    Inherited from Viva\API\Entity\PostType
    Defined in <ROOT>/app/themes/viva-api/Entity/PostType.php:52
    public get($name): mixed - value of the field $name or false if not exist Global getters for all public fields of class
    $product->get($name)
    /**
    * Global getters for all public fields of class
    *
    * @param $name - name of field
    *
    * @return mixed - value of the field $name or false if not exist
    */
    
    Inherited from Viva\API\Entity\PostType
    Defined in <ROOT>/app/themes/viva-api/Entity/PostType.php:72
    public load_field($field): $this Loaded and set the value for $field from DB
    $product->load_field($field)
    /**
    * Loaded and set the value for $field from DB
    *
    * @param $field
    *
    * @return $this
    */
    
    Inherited from Viva\API\Entity\PostType
    Defined in <ROOT>/app/themes/viva-api/Entity/PostType.php:93
    public save_field($field, $value = ''): $this Save the value for $field to the DB
    $product->save_field($field, $value = '')
    /**
    * Save the value for $field to the DB
    *
    * @param $field
    * @param $value
    *
    * @return $this
    */
    
    Inherited from Viva\API\Entity\PostType
    Defined in <ROOT>/app/themes/viva-api/Entity/PostType.php:113
    public create_from_post(WP_Post $post, $force = false): $this - return object of class loads values of fields from WP_Post
    $product->create_from_post(WP_Post $post, $force = false)
    /**
    * loads values of fields from WP_Post
    *
    * @param \WP_Post $post - The wp_post from which the data will be taken
    * @param bool $force - if false than data will taken if post_type == $MACHINE_NAME of class only, if true data will taken from any post
    *
    * @return $this - return object of class
    */
    
    Inherited from Viva\API\Entity\PostType
    Defined in <ROOT>/app/themes/viva-api/Entity/PostType.php:136
    public update_from_array(array $array): $this Set values for fields from array
    $product->update_from_array(array $array)
    /**
    * Set values for fields from array
    *
    * @param array $array - array where keys it is names of fields and values it is values of fields
    *
    * @return $this
    */
    
    Inherited from Viva\API\Entity\PostType
    Defined in <ROOT>/app/themes/viva-api/Entity/PostType.php:168
    public to_array()
    $product->to_array()
    Inherited from Viva\API\Entity\PostType
    Defined in <ROOT>/app/themes/viva-api/Entity/PostType.php:178
    public save($extra_fields = array()): $this Insert or Update data of object in the database
    $product->save($extra_fields = array())
    /**
    *
    * Insert or Update data of object in the database
    *
    * @param array $extra_fields
    *
    * @return $this
    */
    
    Inherited from Viva\API\Entity\PostType
    Defined in <ROOT>/app/themes/viva-api/Entity/PostType.php:210
    public static init($singular_name, $plural_name, $text_domain)
    \Viva\API\Entity\Product::init($singular_name, $plural_name, $text_domain)
    /**
    * @param $singular_name
    * @param $plural_name
    * @param $text_domain
    */
    
    Defined in <ROOT>/app/themes/viva-api/Entity/Product.php:98
    public static create($mixed)
    \Viva\API\Entity\PostType::create($mixed)
    Inherited from Viva\API\Entity\PostType
    Defined in <ROOT>/app/themes/viva-api/Entity/PostType.php:249
    public static register_meta_boxes() Function for register the meta boxes
    \Viva\API\Entity\PostType::register_meta_boxes()
    /**
    * Function for register the meta boxes
    */
    
    Inherited from Viva\API\Entity\PostType
    Defined in <ROOT>/app/themes/viva-api/Entity/PostType.php:283
    public static save_meta_box($post_id) Function for filter save_post. Save meta_data for post_type
    \Viva\API\Entity\PostType::save_meta_box($post_id)
    /**
    * Function for filter save_post. Save meta_data for post_type
    *
    * @param $post_id
    */
    
    Inherited from Viva\API\Entity\PostType
    Defined in <ROOT>/app/themes/viva-api/Entity/PostType.php:292
    public static get_featured_image($post_id, $size = 'thumbnail'): string Get featured image
    \Viva\API\Entity\PostType::get_featured_image($post_id, $size = 'thumbnail')
    /**
    * Get featured image
    *
    * @param $post_id
    * @param string $size
    *
    * @return string
    */
    
    Inherited from Viva\API\Entity\PostType
    Defined in <ROOT>/app/themes/viva-api/Entity/PostType.php:342
  • public static $MACHINE_NAME :: string (7) "product"
    \Viva\API\Entity\Product::$MACHINE_NAME
    public static $METAFIELDS :: array (4)
    \Viva\API\Entity\Product::$METAFIELDS
    0 => string (10) "variations"
    \Viva\API\Entity\Product::$METAFIELDS[0]
    1 => string (11) "ingredients"
    \Viva\API\Entity\Product::$METAFIELDS[1]
    2 => string (4) "lent"
    \Viva\API\Entity\Product::$METAFIELDS[2]
    3 => string (8) "template"
    \Viva\API\Entity\Product::$METAFIELDS[3]
    public static $CATEGORY_TAXONOMY_NAME :: string (16) "product_category"
    \Viva\API\Entity\Product::$CATEGORY_TAXONOMY_NAME
    public static $TAXONOMIES :: array (1)
    \Viva\API\Entity\Product::$TAXONOMIES
    product_category => array (2)
    \Viva\API\Entity\Product::$TAXONOMIES['product_category']
    singular => string (16) "Product category"
    \Viva\API\Entity\Product::$TAXONOMIES['product_category']['singular']
    plural => string (18) "Product categories"
    \Viva\API\Entity\Product::$TAXONOMIES['product_category']['plural']