This is a commercially supported module.
PLEASE DO NOT DISTRIBUTE
Copyright (C) 2014-2020 by Ryan Cramer
Click any linked item for full usage details and examples. Hookable methods are indicated with the icon. In addition to those shown below, the FieldtypeLikes class also inherits all the methods and properties of: Fieldtype, WireData and Wire.
Common
| Name | Return | Summary | |
|---|
FieldtypeLikes::deleteOldLikes() FieldtypeLikes::deleteOldLikes(Field $field) FieldtypeLikes::deleteOldLikes(Field $field) | None | Delete old/expired likes from the duplicate checking table | |
FieldtypeLikes::get() FieldtypeLikes::get($key) FieldtypeLikes::get($key) | None | | |
FieldtypeLikes::getBlankValue() FieldtypeLikes::getBlankValue(Page $page, Field $field) FieldtypeLikes::getBlankValue(Page $page, Field $field) | int | Get blank value | |
FieldtypeLikes::getCompatibleFieldtypes() FieldtypeLikes::getCompatibleFieldtypes($field) FieldtypeLikes::getCompatibleFieldtypes($field) | None | | |
FieldtypeLikes::getConfigInputfields() FieldtypeLikes::getConfigInputfields(Field $field) FieldtypeLikes::getConfigInputfields(Field $field) | InputfieldWrapper | Get inputfields to configure the field | |
FieldtypeLikes::getDatabaseSchema() FieldtypeLikes::getDatabaseSchema(Field $field) FieldtypeLikes::getDatabaseSchema(Field $field) | array | Get database schema | |
FieldtypeLikes::getIP() FieldtypeLikes::getIP() FieldtypeLikes::getIP() | int | Return current IP address as an integer | |
FieldtypeLikes::getInputfield() FieldtypeLikes::getInputfield(Page $page, Field $field) FieldtypeLikes::getInputfield(Page $page, Field $field) | InputfieldInteger | Get Inputfield | |
FieldtypeLikes::getLikedPageIDs() FieldtypeLikes::getLikedPageIDs() FieldtypeLikes::getLikedPageIDs(string $fieldName = '') | array | Get array of liked page IDs (non-validated) | |
FieldtypeLikes::getLikedPages() FieldtypeLikes::getLikedPages() FieldtypeLikes::getLikedPages(string $fieldName = '', $limit = 25) | PageArray | Return a PageArray of pages that the user liked | |
FieldtypeLikes::isValidLicense() FieldtypeLikes::isValidLicense() FieldtypeLikes::isValidLicense() | bool | Returns whether the current license key is valid for the domain its running on | |
FieldtypeLikes::renderLikes() FieldtypeLikes::renderLikes(Page $page) FieldtypeLikes::renderLikes(Page $page, string $fieldName = '') | string | Sample working output, for example purposes (or use it if it's exactly what you need) | |
FieldtypeLikes::sanitizeValue() FieldtypeLikes::sanitizeValue(Page $page, Field $field, int $value) FieldtypeLikes::sanitizeValue(Page $page, Field $field, int $value) | int | Sanitize value | |
Properties
| Name | Return | Summary | |
|---|
| FieldtypeLikes::cookiePrefix | string | When used JS "likeCookiePrefix" must also be set. | |
| FieldtypeLikes::licenseKey | string | | |
| FieldtypeLikes::likedPageIDs | array | Page IDs that current user session has liked (not validated) | |
| FieldtypeLikes::likedPages | PageArray | Pages the current user session has liked | |
| FieldtypeLikes::useReadyCookie | bool | Use basic request protection with cookie and page IDs? DEFAULT: true | |
Additional methods and properties
In addition to the methods and properties above, FieldtypeLikes also inherits the methods and properties of these classes:
API reference based on ProcessWire core version 3.0.259