Download the PHP package andanteproject/timestampable-bundle without Composer

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

Andante Project Logo

Timestampable Bundle

Symfony Bundle - AndanteProject

Latest Version Github actions Framework Php7 PhpStan

A Symfony Bundle to handle entities createdAt and updatedAt dates with Doctrine. 🕰

Requirements

Symfony 4.x-6.x and PHP 7.4-8.1.

Install

Via Composer:

Features

Basic usage

After install, make sure you have the bundle registered in your symfony bundles list (config/bundles.php):

This should have been done automagically if you are using Symfony Flex. Otherwise, just register it by yourself.

Let's suppose we have a App\Entity\Article doctrine entity we want to track created and update dates. All you have to do is to implement Andante\TimestampableBundle\Timestampable\TimestampableInterface and use Andante\TimestampableBundle\Timestampable\TimestampableTrait trait.

Make sure to update you database schema following your doctrine workflow (bin/console doctrine:schema:update --force if you are a badass devil guy or with a migration if you choosed the be a better developer!).

You shoud see a new columns named created_at and updated_at (doctrine naming strategy.

Congrats! You're done! 🎉

Remember that TimestampableInterface and TimestampableTrait are shortcut to use CreatedAtTimestampableInterface+CreatedAtTimestampableTrait and UpdatedAtTimestampableInterface+UpdatedAtTimestampableTrait at the same time! If you need to track only create date or update date you can use these more specific interfaces!

To keep track of Implement interface Use this Trait
Create date Andante\TimestampableBundle\Timestampable\CreatedAtTimestampableInterface Andante\TimestampableBundle\Timestampable\CreatedAtTimestampableTrait
Update date Andante\TimestampableBundle\Timestampable\UpdatedAtTimestampableInterface Andante\TimestampableBundle\Timestampable\UpdatedAtTimestampableTrait
Both create and update dates Andante\TimestampableBundle\Timestampable\TimestampableInterface Andante\TimestampableBundle\Timestampable\TimestampableTrait

Usage with no trait

This allows you to, for instance, to have a different name for your properties (E.g. created instead of createdAt and updated instead of updatedAt). But you will need to explicit this in bundle configuration.

Configuration (completely optional)

This bundle is build thinking how to save you time and follow best practices as close as possible.

This means you can even ignore to have a andante_timestampable.yml config file in your application.

However, for whatever reason (legacy code?), use the bundle configuration to change most of the behaviors as your needs.

Built with love ❤️ by AndanteProject team.


All versions of timestampable-bundle with dependencies

PHP Build Version
Package Version
Requires php Version ^8.1
symfony/framework-bundle Version ^5.0 | ^6.0
doctrine/common Version ^2.13 || ^3.0
doctrine/event-manager Version ^1.2 | ^2.0
symfony/clock Version ^6.2
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 andanteproject/timestampable-bundle contains the following files

Loading the files please wait ....