Download the PHP package friedolinfoerder/wp-activerecord without Composer

On this page you can find all versions of the php package friedolinfoerder/wp-activerecord. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package wp-activerecord

WordPress ActiveRecord

WordPress ActiveRecord implements the active record pattern to easily retrieve, update and delete rows of database tables without struggling with raw SQL query strings. The goal of this library is to provide a small but yet powerful ORM for the CMS WordPress, which should be easy to implement. Therefore it only consists of two classes: ActiveRecord and Query:

Installation

Usage

You can use the library in your plugin or directly in your functions.php file. All you have to do is to require the ActiveRecord class and define your model classes (e.g. Slideshow):

With this you can create new rows, update and save them like this:

API

Class ActiveRecord

Static Properties

Property $casts

Cast row values to native types.

Example:

Static Methods

Method create([$attributes])

Create a model with an array of attributes

Example:
Method delete_by_id($id)

Delete a row by id

Example:
Method get([$id])

Get all model instances or a model instance by id

Example:
Method get_{type}_by_{column}($value [, $...])

Dynmamic finder method: Get a var, rows, results or model instances

Example:
Method get_table_name()

Get the table name

Example:
Method insert($data)

Insert one or multiple rows into the database

Example:
Method query()

Get a query instance

Example:
Method update($column [, $value])

Shortcut method for creating a query instance and calling update on it

Example:
Method wpdb()

Get the wpdb instance

Example:

Instance methods

Method delete()

Delete the model

Example:
Method save()

Save the model

Example:

Event methods

Method save_pre($isNew)

Called before saving the model

Example:
Method save_post($isNew)

Called after saving the model

Example:
Method delete_pre()

Called before deleting the model

Example:
Method delete_post()

Called after deleting the model

Example:

Class Query

Static Methods

Method wpdb()

Get the wpdb instance

Example:

Instance Methods

Select rows

Method select([$...])
Example:
Method delete()

Delete rows

Example:
Method update([$column [, $value]])

Update rows (Alias for \wp_activerecord\Query::set)

Example:
Method set($column [, $value])

Set columns, which should be updated

Example:
Method insert($data)

Insert rows

Example:
Method where($column [, $type_or_value [, $value]])

Add a where condition

Example:
Method and_where($column [, $type_or_value [, $value]])

Alias for where.

Method or_where($column [, $type_or_value [, $value]])

Alias for where, but adds a new group to the where clause, which will be added with the keyword OR

Method group_by($column [, $order])

Add a group by section

Example:
Method having($column [, $type_or_value [, $value]])

Add a having condition

Example:
Method and_having($column [, $type_or_value [, $value]])

Alias for having.

Method or_having($column [, $type_or_value [, $value]])

Alias for having, but adds a new group to the having clause, which will be added with the keyword OR

Method order_by($column [, $order])

Add a order by section

Example:
Method limit($limit)

Add a limit

Example:
Method offset($offset)

Add a offset

Example:
Method join($table, $attribute, $foreign_attribute [, $type])

Add a join condition

Example:
Method sql()

Create the final sql statement

Example:
Method get_results()

Get the results of the query

Example:
Method get_row()

Get the row of the query

Example:
Method get_col()

Get the column of the query

Example:
Method get_var()

Get the value of the query

Example:
Method get()

Get the results of the query as an array of model instances

Example:
Method get_one()

Get the results of the query as a model instances

Example:
Method execute()

Execute the query

Example:

License

This code is licensed under the MIT license.


All versions of wp-activerecord with dependencies

PHP Build Version
Package Version
Requires php Version >=5.5.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package friedolinfoerder/wp-activerecord contains the following files

Loading the files please wait ....