public class Author

class.author.php #9

The Author class represents a Symphony Author object. Authors are the backend users in Symphony.

Methods

integer|boolean commit()

This is the insert method for the Author. This takes the current $this->_fields values and adds them to the database using either the AuthorManager::edit or AuthorManager::add functions. An existing user is determined by if an ID is already set. When the database is updated successfully, the id of the author is set.

Returns

When a new Author is added or updated, an integer of the Author ID will be returned, otherwise false will be returned for a failed update.

See Also
string createAuthToken()

Creates an author token using the Cryptography::hash function and the current Author's username and password. The default hash function is SHA1

See Also
mixed get(string $field)

Retrieves the value from the Author object by field from $this->_fields array. If field is omitted, all fields are returned.

Parameters
  • $field stringMaps directly to a column in the tbl_authors table. Defaults to null

Returns

If the field is not set or is empty, returns null. If the field is not provided, returns the $this->_fields array Otherwise returns a string.

string getFullName()

A convenience method that returns an Authors full name

boolean isAuthor()

Returns boolean if the current Author is of the author user type.

boolean isDeveloper()

Returns boolean if the current Author is of the developer user type.

boolean isManager()

Returns boolean if the current Author is of the manager user type.

boolean isPrimaryAccount()

Returns boolean if the current Author is the original creator of this Symphony installation.

boolean isTokenActive()

Returns boolean if the current Author's authentication token is active or not.

void remove(string $field)

Given a field, remove it from $this->_fields

Parameters
  • $field stringMaps directly to a column in the tbl_authors table. Defaults to null

void set(string $field, string $value)

Stores a key=>value pair into the Author object's $this->_fields array.

Parameters
  • $field stringMaps directly to a column in the tbl_authors table.

  • $value stringThe value for the given $field

boolean validate(array $errors)

Prior to saving an Author object, the validate function ensures that the values in $this->_fields array are correct. As of Symphony 2.3 Authors must have unique username AND email address. This function returns boolean, with an $errors array provided by reference to the callee function.

Symphony • Open Source XSLT CMS

Server Requirements

  • PHP 5.3-5.6 or 7.0-7.3
  • PHP's LibXML module, with the XSLT extension enabled (--with-xsl)
  • MySQL 5.5 or above
  • An Apache or Litespeed webserver
  • Apache's mod_rewrite module or equivalent

Compatible Hosts

Sign in

Login details