• LifterLMS
  • Knowledge Base
  • Academy
  • Blog
  • Podcast
  • Contributors

LifterLMS LifterLMS

Code Reference

  • Home
  • Code Reference
Skip to content
Filter by type:
Search
Browse: Home / Code Reference / Classes / LLMS_User_Postmeta / LLMS_User_Postmeta::__construct()

LLMS_User_Postmeta::__construct( mixed $item = null, bool $hydrate = true )

Constructor

Contents

  • Description
    • Parameters
    • Source
    • Changelog
  • Related
    • Uses
    • Used By
  • User Contributed Notes

Description #Description


Parameters #Parameters

$item

(mixed) (Optional) meta_id of a user postmeta item or an object with at least an "id"

Default value: null

$hydrate

(bool) (Optional) if true, hydrates the object on instantiation (if an ID was found via $item)

Default value: true


Top ↑

Source #Source

File: includes/models/model.llms.user.postmeta.php

	public function __construct( $item = null, $hydrate = true ) {

		if ( is_numeric( $item ) ) {

			$this->id = $item;

		} elseif ( is_object( $item ) && isset( $item->id ) ) {

			$this->id = $item->id;

		}

		parent::__construct();

		if ( $this->id && $hydrate ) {
			$this->hydrate();
		}

	}

Expand full source code Collapse full source code View on GitHub


Top ↑

Changelog #Changelog

Changelog
Version Description
3.15.0 Introduced.

Top ↑

Related #Related

Top ↑

Uses #Uses

Uses
Uses Description
includes/abstracts/llms.abstract.database.store.php: LLMS_Abstract_Database_Store::__construct()

Constructor

Top ↑

Used By #Used By

Used By
Used By Description
includes/functions/llms.functions.user.postmeta.php: llms_delete_user_postmeta()

Delete user postmeta data

includes/functions/llms.functions.user.postmeta.php: llms_update_user_postmeta()

Update user postmeta data

includes/class.llms.query.user.postmeta.php: LLMS_Query_User_Postmeta::get_metas()

Retrieve an array of LLMS_User_Postmetas for the given set of results


Top ↑

User Contributed Notes #User Contributed Notes

You must log in before being able to contribute a note or feedback.





Permalink:
© 2014 - 2019 LifterLMS · Privacy Policy · Terms and Conditions