Download the PHP package windwalker/record without Composer

On this page you can find all versions of the php package windwalker/record. 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 record

Windwalker Record

Windwalker Record is a simple ActiveRecord to operate database row.

Installation via Composer

Add this to the require block in your composer.json.

Use Record

New a instance.

Or create a class:

Load A Record

Check row exists

Bind Data

If we have a table with only 3 columns:

Name
name
username
password

The fields which not in this table will be remove after binding data.

That makes our fields in Record will always same as DB table.

Store

Create A New Row

If primary not exists, Record will create a new row in table.

Update A Existing Row

If primary key exists, Record will update it.

Validate

Check method help you validate data.

Then we call validate() before store().

Delete

Mutator and Accessor

Mutator and accessor is a setter and getter to do some extra modification when you access value via magic methods.

This is an example of mutator:

Use camel-case style to define a method, then when you access the created_date field, this method will be auto executed.

And an example of accessor:

And now you can get DateTime object back:

Casts

Add casts to auto convert value type after read from DB:

Supports casts:

NestedRecord

NestedRecord is a tool help us handle Nested Set Model.

Create Table

Name: categories

Name Type Description Need For NestedRecord
id int Primary Key
parent_id int ID of Parent Node V
title varchar Category title
path varchar Node path V
lft int Left key V
rgt int Right key V
level int Node level V

Initialise

Every nested set should have a root node.

NOTE: The root node id is 1.

Create Node

Set as first child of ROOT

Now we will have a new node and it id is 2. Create a new node as last child of 2.

Available positions:

Move Node

Re Ordering

Move To Other Node

Move to node 3 as last child.

Rebuild

If a tree was not correct, using rebuild to reset all lft, rgt of this branch.

getPath

Method to get an array of nodes from a given node to its root.

getTree

Method to get a node and all its child nodes.

Event

Record has an event system that we can process logic before & after every DB operation.

Add event methods in your Record class.

Or add listeners to Dispatcher (You must install windwalker/event first).

Available events:


All versions of record with dependencies

PHP Build Version
Package Version
Requires php Version >=7.1.3
windwalker/database Version ~3.0
windwalker/datamapper Version ~3.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 windwalker/record contains the following files

Loading the files please wait ....