Since: 1.6

abstract class AdminModel extends FormModel

Prototype admin model.

Traits

Trait which supports form behavior.

Defines the trait for a FormFactoryInterface Aware Class.

DatabaseAwareTrait

MVCFactory aware trait.

DispatcherAwareTrait

Trait for classes which require a user to work with.

Defines the trait for a CacheControllerFactoryInterface Aware Class.

Trait which supports state behavior

Trait which contains the legacy getInstance functionality

Trait which contains the legacy methods that formerly were inherited from \Joomla\CMS\Object\CMSObject to set and get errors in a class.

Trait which contains the legacy methods that formerly were inherited from \Joomla\CMS\Object\CMSObject to set and get properties of the current class.

Properties

protected bool Since: 4.0.0
$__state_set

Indicates if the internal state has been set

from  StateBehaviorTrait
protected State Since: 4.0.0
$state

A state object

from  StateBehaviorTrait
protected array deprecated Since: 1.7.0
$_errors

An array of error messages or Exception objects.

from  LegacyErrorHandlingTrait
protected string Since: 4.0.0
$name

The model (base) name

from  BaseModel
static protected array Since: 4.0.0
$paths

The include paths

from  BaseModel
protected string Since: 3.0
$option

The URL option for the component.

from  BaseDatabaseModel
protected string Since: 3.0
$event_clean_cache

The event to trigger when cleaning cache.

from  BaseDatabaseModel
protected Form[] Since: 4.0.0
$_forms

Array of form objects.

from  FormBehaviorTrait
protected array Since: 3.6
$events_map

Maps events to plugin groups.

from  FormModel
string Since: 3.8.6
$typeAlias

The type alias for this content type (for example, 'com_content.article').

protected string Since: 1.6
$text_prefix

The prefix to use with controller messages.

protected string Since: 1.6
$event_after_delete

The event to trigger after deleting the data.

protected string Since: 1.6
$event_after_save

The event to trigger after saving the data.

protected string Since: 1.6
$event_before_delete

The event to trigger before deleting the data.

protected string Since: 1.6
$event_before_save

The event to trigger before saving the data.

protected string Since: 4.0.0
$event_before_change_state

The event to trigger before changing the published state of the data.

protected string Since: 1.6
$event_change_state

The event to trigger after changing the published state of the data.

protected string Since: 4.0.0
$event_before_batch

The event to trigger before batch.

protected string Since: 3.4
$batch_copymove

Batch copy/move command. If set to false, the batch copy/move command is not supported

protected array Since: 3.4
$batch_commands

Allowed batch commands

protected string Since: 3.4.4
$associationsContext

The context used for the associations table

protected ?bool Since: 3.8.2
$batchSet

A flag to indicate if member variables for batch actions (and saveorder) have been initialized

protected object Since: 3.8.2
$user

The user performing the actions (re-usable in batch methods & saveorder(), initialized via initBatch())

protected Table Since: 3.8.2
$table

A \Joomla\CMS\Table\Table instance (of appropriate type) to manage the DB records (re-usable in batch methods & saveorder(), initialized via initBatch())

protected string Since: 3.8.2
$tableClassName

The class name of the \Joomla\CMS\Table\Table instance managing the DB records (re-usable in batch methods & saveorder(), initialized via initBatch())

protected object Since: 3.8.2
$contentType

UCM Type corresponding to the current model class (re-usable in batch action methods, initialized via initBatch())

protected object Since: 3.8.2
$type

DB data of UCM Type corresponding to the current model class (re-usable in batch action methods, initialized via initBatch())

Methods

mixed
getState(string $property = null, mixed $default = null)

Method to get state variables.

mixed
setState(string $property, mixed $value = null)

Method to set state variables.

void
populateState()

Stock method to auto-populate the model state.

static string
_createFileName(string $type, array $parts = []) deprecated

Create the filename for a resource

static LegacyModelLoaderTrait|bool
getInstance(string $type, string $prefix = '', array $config = []) deprecated

Returns a Model object, always creating it

static void
addTablePath(mixed $path) deprecated

Adds to the stack of model table paths in LIFO order.

string
getError(int $i = null, bool $toString = true) deprecated

Get the most recent error message.

array
getErrors() deprecated

Return all errors, if any.

void
setError(string $error) deprecated

Add an error message.

mixed
def(string $property, mixed $default = null) deprecated

Sets a default value if not already assigned

mixed
get(string $property, mixed $default = null) deprecated

Returns a property of the object or the default value if the property is not set.

array
getProperties(bool $public = true) deprecated

Returns an associative array of object properties.

mixed
set(string $property, mixed $value = null) deprecated

Modifies a property of the object, creating it if it does not already exist.

bool
setProperties(mixed $properties) deprecated

Set the object properties based on a named array/hash.

__construct(array $config = [], MVCFactoryInterface|null $factory = null, FormFactoryInterface|null $formFactory = null)

Constructor.

static array
addIncludePath(mixed $path = '', string $prefix = '') deprecated

Add a directory where \JModelLegacy should search for models. You may either pass a string or an array of directories.

string
getName()

Method to get the model name

getMVCFactory()

Returns the MVC factory.

void
setMVCFactory(MVCFactoryInterface $mvcFactory)

Set the MVC factory.

getCurrentUser()

Returns the current user, if none is set the identity of the global app is returned. This will change in 6.0 and an empty user will be returned.

void
setCurrentUser(User $currentUser)

Sets the current user.

void
setCacheControllerFactory(CacheControllerFactoryInterface|null $cacheControllerFactory = null)

Set the cache controller factory to use.

object[]
_getList(DatabaseQuery|string $query, int $limitstart = 0, int $limit = 0)

Gets an array of objects from the results of database query.

int
_getListCount(DatabaseQuery|string $query)

Returns a record count for the query.

Table|bool
_createTable(string $name, string $prefix = 'Table', array $config = [])

Method to load and return a table object.

getTable(string $name = '', string $prefix = '', array $options = [])

Method to get a table object, load it if necessary.

bool
isCheckedOut(stdClass $item)

Method to check if the given record is checked out by the current user

void
cleanCache(string $group = null)

Clean the cache

bootComponent(string $component)

Boots the component with the given name.

DispatcherInterface
getDispatcher()

Get the event dispatcher.

void
dispatchEvent(EventInterface $event) deprecated

Dispatches the given event on the internal dispatcher, does a fallback to the global one.

DatabaseInterface
getDbo() deprecated

Method to get the database driver object.

void
setDbo(DatabaseInterface|null $db = null) deprecated

Set the database driver.

mixed
__get(string $name) deprecated

Proxy for _db variable.

loadForm(string $name, string $source = null, array $options = [], bool $clear = false, string $xpath = null)

Method to get a form object.

array
loadFormData()

Method to get the data that should be injected in the form.

void
preprocessData(string $context, mixed $data, string $group = 'content')

Method to allow derived classes to preprocess the data.

void
preprocessForm(Form $form, mixed $data, string $group = 'content')

Method to allow derived classes to preprocess the form.

getFormFactory()

Get the FormFactoryInterface.

$this
setFormFactory(FormFactoryInterface|null $formFactory = null)

Set the form factory to use.

bool
checkin(mixed $pks = [])

Method override to check-in a record or an array of record

bool
checkout(int $pk = null)

Method override to check-out a record.

array|bool
validate(Form $form, array $data, string $group = null)

Method to validate the form data.

bool
batch(array $commands, array $pks, array $contexts)

Method to perform batch operations on an item or a set of items.

bool
batchAccess(int $value, array $pks, array $contexts)

Batch access level changes for a group of rows.

array|bool
batchCopy(int $value, array $pks, array $contexts)

Batch copy items to a new category or current.

void
cleanupPostBatchCopy(TableInterface $table, int $newId, int $oldId)

Function that can be overridden to do any data cleanup after batch copying data

bool
batchLanguage(string $value, array $pks, array $contexts)

Batch language changes for a group of rows.

bool
batchMove(int $value, array $pks, array $contexts)

Batch move items to a new category

bool
batchTag(int $value, array $pks, array $contexts) deprecated

Batch tag a list of item.

bool
canDelete(object $record)

Method to test whether a record can be deleted.

bool
canEditState(object $record)

Method to test whether a record can have its state changed.

bool
delete(array $pks)

Method to delete one or more records.

array
generateNewTitle(int $categoryId, string $alias, string $title)

Method to change the title & alias.

stdClass|false
getItem(int $pk = null)

Method to get a single record.

string[]
getReorderConditions(Table $table)

A protected method to get a set of ordering conditions.

void
prepareTable(Table $table)

Prepare and sanitise the table data prior to saving.

bool
publish(array $pks, int $value = 1)

Method to change the published state of one or more records.

bool|null
reorder(int $pks, int $delta = 0)

Method to adjust the ordering of a row.

bool
save(array $data)

Method to save the form data.

bool
saveorder(array $pks = [], int $order = null)

Saves the manually set order of records.

bool
checkCategoryId(int $categoryId)

Method to check the validity of the category ID for batch copy and move

void
generateTitle(int $categoryId, Table $table)

A method to preprocess generating a new title in order to allow tables with alternative names for alias and title to use the batch move and copy methods

void
initBatch()

Method to initialize member variables used by batch methods and other methods like saveorder()

bool
editAssociations(array $data) deprecated

Method to load an item in com_associations.

bool
redirectToAssociations(array $data)

Method to load an item in com_associations.

Details

mixed getState(string $property = null, mixed $default = null)

Since: 4.0.0

Method to get state variables.

Parameters

string $property

Optional parameter name

mixed $default

Optional default value

Return Value

mixed

The property where specified, the state object where omitted

mixed setState(string $property, mixed $value = null)

Since: 4.0.0

Method to set state variables.

Parameters

string $property

The name of the property

mixed $value

The value of the property to set or null

Return Value

mixed

The previous value of the property or null if not set

protected void populateState()

Since: 1.6

Stock method to auto-populate the model state.

Return Value

void

static protected string _createFileName(string $type, array $parts = []) deprecated

Since: 3.0

deprecated 4.3 will be removed in 6.0 Will be removed without replacement

Create the filename for a resource

Parameters

string $type

The resource type to create the filename for.

array $parts

An associative array of filename information.

Return Value

string

The filename

static LegacyModelLoaderTrait|bool getInstance(string $type, string $prefix = '', array $config = []) deprecated

Since: 3.0

deprecated 4.3 will be removed in 6.0 Will be removed without replacement. Get the model through the MVCFactory instead Example: Factory::getApplication()->bootComponent('com_xxx')->getMVCFactory()->createModel($type, $prefix, $config);

Returns a Model object, always creating it

Parameters

string $type

The model type to instantiate

string $prefix

Prefix for the model class name. Optional.

array $config

Configuration array for model. Optional.

Return Value

LegacyModelLoaderTrait|bool

A \JModelLegacy instance or false on failure

static void addTablePath(mixed $path) deprecated

Since: 3.0

deprecated 4.3 will be removed in 6.0 Will be removed without replacement. Get the model through the MVCFactory instead

Adds to the stack of model table paths in LIFO order.

Parameters

mixed $path

The directory as a string or directories as an array to add.

Return Value

void

string getError(int $i = null, bool $toString = true) deprecated

Since: 1.7.0

deprecated 3.1.4 will be removed in 6.0 Will be removed without replacement Catch thrown Exceptions instead of getError

Get the most recent error message.

Parameters

int $i

Option error index.

bool $toString

Indicates if Exception objects should return their error message.

Return Value

string

Error message

array getErrors() deprecated

Since: 1.7.0

deprecated 3.1.4 will be removed in 6.0 Will be removed without replacement Catch thrown Exceptions instead of getErrors

Return all errors, if any.

Return Value

array

Array of error messages.

void setError(string $error) deprecated

Since: 1.7.0

deprecated 3.1.4 will be removed in 6.0 Will be removed without replacement Throw an Exception instead of using setError

Add an error message.

Parameters

string $error

Error message.

Return Value

void

mixed def(string $property, mixed $default = null) deprecated

Since: 1.7.0

deprecated 4.3.0 will be removed in 6.0 Defining dynamic properties should not be used anymore

Sets a default value if not already assigned

Parameters

string $property

The name of the property.

mixed $default

The default value.

Return Value

mixed

mixed get(string $property, mixed $default = null) deprecated

Since: 1.7.0

deprecated 4.3.0 will be removed in 6.0 Create a proper getter function for the property

Returns a property of the object or the default value if the property is not set.

Parameters

string $property

The name of the property.

mixed $default

The default value.

Return Value

mixed

The value of the property.

See also

\Joomla\CMS\Object\CMSObject::getProperties()

array getProperties(bool $public = true) deprecated

Since: 1.7.0

deprecated 4.3.0 will be removed in 6.0 Create a proper getter function for the property

Returns an associative array of object properties.

Parameters

bool $public

If true, returns only the public properties.

Return Value

array

See also

\Joomla\CMS\Object\CMSObject::get()

mixed set(string $property, mixed $value = null) deprecated

Since: 1.7.0

deprecated 4.3.0 will be removed in 6.0 Create a proper setter function for the property

Modifies a property of the object, creating it if it does not already exist.

Parameters

string $property

The name of the property.

mixed $value

The value of the property to set.

Return Value

mixed

Previous value of the property.

bool setProperties(mixed $properties) deprecated

Since: 1.7.0

deprecated 4.3.0 will be removed in 6.0 Create a proper setter function for the property

Set the object properties based on a named array/hash.

Parameters

mixed $properties

Either an associative array or another object.

Return Value

bool

See also

\Joomla\CMS\Object\CMSObject::set()

__construct(array $config = [], MVCFactoryInterface|null $factory = null, FormFactoryInterface|null $formFactory = null)

Since: 1.6

Constructor.

Parameters

array $config

An array of configuration options (name, state, ignore_request).

MVCFactoryInterface|null $factory

The factory.

FormFactoryInterface|null $formFactory

The form factory.

Exceptions

Exception

static array addIncludePath(mixed $path = '', string $prefix = '') deprecated

Since: 3.0

deprecated 4.3 will be removed in 6.0 Will be removed without replacement. Get the model through the MVCFactory + namespace instead

Add a directory where \JModelLegacy should search for models. You may either pass a string or an array of directories.

Parameters

mixed $path

A path or array[sting] of paths to search.

string $prefix

A prefix for models.

Return Value

array

An array with directory elements. If prefix is equal to '', all directories are returned.

See also

LegacyModelLoaderTrait::getInstance

string getName()

Since: 4.0.0

Method to get the model name

The model name. By default parsed using the classname or it can be set by passing a $config['name'] in the class constructor

Return Value

string

The name of the model

Exceptions

Exception

protected MVCFactoryInterface getMVCFactory()

Since: 4.0.0

Returns the MVC factory.

void setMVCFactory(MVCFactoryInterface $mvcFactory)

Since: 4.0.0

Set the MVC factory.

Parameters

MVCFactoryInterface $mvcFactory

The MVC factory

Return Value

void

protected User getCurrentUser()

Since: 4.2.0

Returns the current user, if none is set the identity of the global app is returned. This will change in 6.0 and an empty user will be returned.

Return Value

User

void setCurrentUser(User $currentUser)

Since: 4.2.0

Sets the current user.

Parameters

User $currentUser

The current user object

Return Value

void

protected CacheControllerFactoryInterface getCacheControllerFactory()

Since: 4.2.0

Get the CacheControllerFactoryInterface.

void setCacheControllerFactory(CacheControllerFactoryInterface|null $cacheControllerFactory = null)

Since: 4.2.0

Set the cache controller factory to use.

Parameters

CacheControllerFactoryInterface|null $cacheControllerFactory

The cache controller factory to use.

Return Value

void

protected object[] _getList(DatabaseQuery|string $query, int $limitstart = 0, int $limit = 0)

Since: 3.0

Gets an array of objects from the results of database query.

Parameters

DatabaseQuery|string $query

The query.

int $limitstart Offset.
int $limit

The number of records.

Return Value

object[]

An array of results.

Exceptions

RuntimeException

protected int _getListCount(DatabaseQuery|string $query)

Since: 3.0

Returns a record count for the query.

Note: Current implementation of this method assumes that getListQuery() returns a set of unique rows, thus it uses SELECT COUNT(*) to count the rows. In cases that getListQuery() uses DISTINCT then either this method must be overridden by a custom implementation at the derived Model Class or a GROUP BY clause should be used to make the set unique.

Parameters

DatabaseQuery|string $query

The query.

Return Value

int

Number of rows for query.

protected Table|bool _createTable(string $name, string $prefix = 'Table', array $config = [])

Since: 3.0

Method to load and return a table object.

Parameters

string $name

The name of the view

string $prefix

The class prefix. Optional.

array $config

Configuration settings to pass to Table::getInstance

Return Value

Table|bool

Table object or boolean false if failed

See also

Table::getInstance

Table getTable(string $name = '', string $prefix = '', array $options = [])

Since: 3.0

Method to get a table object, load it if necessary.

Parameters

string $name

The table name. Optional.

string $prefix

The class prefix. Optional.

array $options

Configuration array for model. Optional.

Return Value

Table

A Table object

Exceptions

Exception

bool isCheckedOut(stdClass $item)

Method to check if the given record is checked out by the current user

Parameters

stdClass $item

The record to check

Return Value

bool

protected void cleanCache(string $group = null)

Since: 3.0

Clean the cache

Parameters

string $group

The cache group

Return Value

void

protected ComponentInterface bootComponent(string $component)

Since: 4.0.0

Boots the component with the given name.

Parameters

string $component

The component name, eg. com_content.

Return Value

ComponentInterface

The service container

DispatcherInterface getDispatcher()

Since: 4.4.0

Get the event dispatcher.

The override was made to keep a backward compatibility for legacy component. TODO: Remove the override in 6.0

Return Value

DispatcherInterface

Exceptions

UnexpectedValueException

protected void dispatchEvent(EventInterface $event) deprecated

Since: 4.1.0

deprecated 4.4 will be removed in 6.0. Use $this->getDispatcher() directly.

Dispatches the given event on the internal dispatcher, does a fallback to the global one.

Parameters

EventInterface $event

The event

Return Value

void

DatabaseInterface getDbo() deprecated

Since: 4.2.0

deprecated 4.3 will be removed in 6.0 Use getDatabase() instead Example: $model->getDatabase();

Method to get the database driver object.

Return Value

DatabaseInterface

void setDbo(DatabaseInterface|null $db = null) deprecated

Since: 4.2.0

deprecated 4.3 will be removed in 6.0 Use setDatabase() instead Example: $model->setDatabase($db);

Set the database driver.

Parameters

DatabaseInterface|null $db

The database driver.

Return Value

void

mixed __get(string $name) deprecated

Since: 4.2.0

deprecated 4.3 will be removed in 6.0 Use getDatabase() instead of directly accessing _db

Proxy for _db variable.

Parameters

string $name

The name of the element

Return Value

mixed

The value of the element if set, null otherwise

protected Form loadForm(string $name, string $source = null, array $options = [], bool $clear = false, string $xpath = null)

Since: 4.0.0

Method to get a form object.

Parameters

string $name

The name of the form.

string $source

The form source. Can be XML string if file flag is set to false.

array $options

Optional array of options for the form creation.

bool $clear

Optional argument to force load a new form.

string $xpath

An optional xpath to search for the fields.

Return Value

Form

Exceptions

Exception

See also

Form

protected array loadFormData()

Since: 4.0.0

Method to get the data that should be injected in the form.

Return Value

array

The default data is an empty array.

protected void preprocessData(string $context, mixed $data, string $group = 'content')

Since: 4.0.0

Method to allow derived classes to preprocess the data.

Parameters

string $context

The context identifier.

mixed $data

The data to be processed. It gets altered directly.

string $group

The name of the plugin group to import (defaults to "content").

Return Value

void

protected void preprocessForm(Form $form, mixed $data, string $group = 'content')

Since: 4.0.0

Method to allow derived classes to preprocess the form.

Parameters

Form $form

A Form object.

mixed $data

The data expected for the form.

string $group

The name of the plugin group to import (defaults to "content").

Return Value

void

Exceptions

Exception

See also

FormField

FormFactoryInterface getFormFactory()

Since: 4.0.0

Get the FormFactoryInterface.

$this setFormFactory(FormFactoryInterface|null $formFactory = null)

Since: 4.0.0

Set the form factory to use.

Parameters

FormFactoryInterface|null $formFactory

The form factory to use.

Return Value

$this

bool checkin(mixed $pks = [])

Since: 1.6

Method override to check-in a record or an array of record

Parameters

mixed $pks

The ID of the primary key or an array of IDs

Return Value

bool

False on failure or error, true otherwise.

bool checkout(int $pk = null)

Since: 1.6

Method override to check-out a record.

Parameters

int $pk

The numeric id of the primary key.

Return Value

bool

False on failure or error, true otherwise.

array|bool validate(Form $form, array $data, string $group = null)

Since: 1.6

Method to validate the form data.

Parameters

Form $form

The form to validate against.

array $data

The data to validate.

string $group

The name of the field group to validate.

Return Value

array|bool

Array of filtered data if valid, false otherwise.

See also

FormRule
InputFilter

bool batch(array $commands, array $pks, array $contexts)

Since: 1.7

Method to perform batch operations on an item or a set of items.

Parameters

array $commands

An array of commands to perform.

array $pks

An array of item ids.

array $contexts

An array of item contexts.

Return Value

bool

Returns true on success, false on failure.

protected bool batchAccess(int $value, array $pks, array $contexts)

Since: 1.7

Batch access level changes for a group of rows.

Parameters

int $value

The new value matching an Asset Group ID.

array $pks

An array of row IDs.

array $contexts

An array of item contexts.

Return Value

bool

True if successful, false otherwise and internal error is set.

protected array|bool batchCopy(int $value, array $pks, array $contexts)

Since: 1.7

Batch copy items to a new category or current.

Parameters

int $value

The new category.

array $pks

An array of row IDs.

array $contexts

An array of item contexts.

Return Value

array|bool

An array of new IDs on success, boolean false on failure.

protected void cleanupPostBatchCopy(TableInterface $table, int $newId, int $oldId)

Since: 3.8.12

Function that can be overridden to do any data cleanup after batch copying data

Parameters

TableInterface $table

The table object containing the newly created item

int $newId

The id of the new item

int $oldId

The original item id

Return Value

void

protected bool batchLanguage(string $value, array $pks, array $contexts)

Since: 2.5

Batch language changes for a group of rows.

Parameters

string $value

The new value matching a language.

array $pks

An array of row IDs.

array $contexts

An array of item contexts.

Return Value

bool

True if successful, false otherwise and internal error is set.

protected bool batchMove(int $value, array $pks, array $contexts)

Since: 1.7

Batch move items to a new category

Parameters

int $value

The new category ID.

array $pks

An array of row IDs.

array $contexts

An array of item contexts.

Return Value

bool

True if successful, false otherwise and internal error is set.

protected bool batchTag(int $value, array $pks, array $contexts) deprecated

Since: 3.1

deprecated 5.3 will be removed in 7.0

Batch tag a list of item.

Parameters

int $value

The value of the new tag.

array $pks

An array of row IDs.

array $contexts

An array of item contexts.

Return Value

bool

True if successful, false otherwise and internal error is set.

protected bool canDelete(object $record)

Since: 1.6

Method to test whether a record can be deleted.

Parameters

object $record

A record object.

Return Value

bool

True if allowed to delete the record. Defaults to the permission for the component.

protected bool canEditState(object $record)

Since: 1.6

Method to test whether a record can have its state changed.

Parameters

object $record

A record object.

Return Value

bool

True if allowed to change the state of the record. Defaults to the permission for the component.

bool delete(array $pks)

Since: 1.6

Method to delete one or more records.

Parameters

array $pks

An array of record primary keys.

Return Value

bool

True if successful, false if an error occurs.

protected array generateNewTitle(int $categoryId, string $alias, string $title)

Since: 1.7

Method to change the title & alias.

Parameters

int $categoryId

The id of the category.

string $alias

The alias.

string $title

The title.

Return Value

array

Contains the modified title and alias.

stdClass|false getItem(int $pk = null)

Since: 1.6

Method to get a single record.

Parameters

int $pk

The id of the primary key.

Return Value

stdClass|false

Object on success, false on failure.

protected string[] getReorderConditions(Table $table)

Since: 1.6

A protected method to get a set of ordering conditions.

Parameters

Table $table

A Table object.

Return Value

string[]

An array of conditions to add to ordering queries.

protected void prepareTable(Table $table)

Since: 1.6

Prepare and sanitise the table data prior to saving.

Parameters

Table $table

A reference to a Table object.

Return Value

void

bool publish(array $pks, int $value = 1)

Since: 1.6

Method to change the published state of one or more records.

Parameters

array $pks

A list of the primary keys to change.

int $value

The value of the published state.

Return Value

bool

True on success.

bool|null reorder(int $pks, int $delta = 0)

Since: 1.6

Method to adjust the ordering of a row.

Returns NULL if the user did not have edit privileges for any of the selected primary keys.

Parameters

int $pks

The ID of the primary key to move.

int $delta

Increment, usually +1 or -1

Return Value

bool|null

False on failure or error, true on success, null if the $pk is empty (no items selected).

bool save(array $data)

Since: 1.6

Method to save the form data.

Parameters

array $data

The form data.

Return Value

bool

True on success, False on error.

bool saveorder(array $pks = [], int $order = null)

Since: 1.6

Saves the manually set order of records.

Parameters

array $pks

An array of primary key ids.

int $order

+1 or -1

Return Value

bool

Boolean true on success, false on failure

protected bool checkCategoryId(int $categoryId)

Since: 3.2

Method to check the validity of the category ID for batch copy and move

Parameters

int $categoryId

The category ID to check

Return Value

bool

void generateTitle(int $categoryId, Table $table)

Since: 3.2

A method to preprocess generating a new title in order to allow tables with alternative names for alias and title to use the batch move and copy methods

Parameters

int $categoryId

The target category id

Table $table

The Table within which move or copy is taking place

Return Value

void

void initBatch()

Since: 3.8.2

Method to initialize member variables used by batch methods and other methods like saveorder()

Return Value

void

bool editAssociations(array $data) deprecated

Since: 3.9.0

deprecated 4.3 will be removed in 6.0 It is handled by regular save method now.

Method to load an item in com_associations.

Parameters

array $data

The form data.

Return Value

bool

True if successful, false otherwise.

protected bool redirectToAssociations(array $data)

Since: 3.9.17

Method to load an item in com_associations.

Parameters

array $data

The form data.

Return Value

bool

True if successful, false otherwise.

Exceptions

Exception