2017 © Pedro Peláez
 

contao-module contao-versions

Create versions within contao with ease and prevent entities from being purged by fromTable name. Also usable in frontend.

image

heimrichhannot/contao-versions

Create versions within contao with ease and prevent entities from being purged by fromTable name. Also usable in frontend.

  • Tuesday, June 20, 2017
  • by digitales@heimrich-hannot.de
  • Repository
  • 5 Watchers
  • 0 Stars
  • 1,561 Installations
  • PHP
  • 2 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 18 Versions
  • 38 % Grown

The README.md

Versions

This bundle enhances the contao version entity with persistent tables options and helper methods., (*1)

Features

  • Add fromTable names to huh_versions.persistent_tables that should persist within tl_version forever or a custom time frame.
  • Use the VersionModel to find tl_version models

Register persistent tables

To make your entities from a given fromTable persist add the table name to the huh_versions.persistent_tables within your project configuration (typical config/config.yml)., (*2)

# config/config.yml
huh_versions:
  persistent_tables:
    - tl_my_custom_entity
    - tl_keep_forever

Create a new version entry

Instead of using the versions class direct, you can use the VersionControl service instead., (*3)

use Contao\FrontendUser;
use Contao\Versions;
use HeimrichHannot\VersionsBundle\Version\VersionControl;

class MyCustomEntity 
{
    /** @var VersionControl */
    private $versionControl;

    protected function createVersion(int $id, FrontendUser $member): void
    {
        // Simple call
        $this->versionControl->createVersion('tl_my_custom_entity', $id);

        // Pass additional options
        $this->versionControl->createVersion('tl_my_custom_entity', $id, [
            'hideUser' => false,
            'additionalData' => [
                'memberid' => $member->id,
                'memberusername' => $member->username,
                'username' => 'FrontendUser',
                'userid' => 0,
            ],
            'instance' => new Versions('tl_my_custom_entity', $id),
        ]);
    }
}

VersionControl::createVersion options: - hideUser: (bool) Don't add user to version log entry. Default false - additionalData: (array|null) Pass data that should be stored within the log entry. The array keys must be existing database column names. Default null - instance: (Version|null)Pass a custom Versions instance instead of the default one. Default null, (*4)

Configuration reference

# Default configuration for extension with alias: "huh_versions"
huh_versions:

  # Set table names that should be persist within tl_versions.
  persistent_tables:

    # Examples:
    - tl_content
    - tl_my_custom_entity

  # Set the time period persistent table versions should be kept in version table. Set to 0 for forever.
  persistent_version_period: ~ # Example: 7776000

The Versions

20/06 2017

dev-master

9999999-dev https://bitbucket.com/heimrichhannot/contao-versions-bundle

Create versions within contao with ease and prevent entities from being purged by fromTable name. Also usable in frontend.

  Sources   Download

LGPL-3.0+

The Requires

 

contao versions

20/06 2017

2.0.0

2.0.0.0 https://bitbucket.com/heimrichhannot/contao-versions-bundle

Create versions within contao with ease and prevent entities from being purged by fromTable name. Also usable in frontend.

  Sources   Download

LGPL-3.0+

The Requires

 

contao versions

08/06 2017

1.0.14

1.0.14.0 https://github.com/heimrichhannot/contao-versions

Create versions within contao with ease and prevent entities from being purged by fromTable name.

  Sources   Download

LGPL-3.0+

The Requires

 

contao versions

08/06 2017

dev-contao3

dev-contao3 https://github.com/heimrichhannot/contao-versions

Create versions within contao with ease and prevent entities from being purged by fromTable name.

  Sources   Download

LGPL-3.0+

The Requires

 

contao versions

12/04 2017

1.0.13

1.0.13.0 https://github.com/heimrichhannot/contao-versions

Create versions within contao with ease and prevent entities from being purged by fromTable name.

  Sources   Download

LGPL-3.0+

The Requires

 

contao versions

06/04 2017

1.0.12

1.0.12.0 https://github.com/heimrichhannot/contao-versions

Create versions within contao with ease and prevent entities from being purged by fromTable name.

  Sources   Download

LGPL-3.0+

The Requires

 

contao versions

16/02 2017

1.0.11

1.0.11.0 https://github.com/heimrichhannot/contao-versions

Create versions within contao with ease and prevent entities from being purged by fromTable name.

  Sources   Download

LGPL-3.0+

The Requires

 

contao versions

18/01 2017

1.0.10

1.0.10.0 https://github.com/heimrichhannot/contao-versions

Create versions within contao with ease and prevent entities from being purged by fromTable name.

  Sources   Download

LGPL-3.0+

The Requires

 

contao versions

09/01 2017

1.0.9

1.0.9.0 https://github.com/heimrichhannot/contao-versions

Create versions within contao with ease and prevent entities from being purged by fromTable name.

  Sources   Download

LGPL-3.0+

The Requires

 

contao versions

16/12 2016

1.0.8

1.0.8.0 https://github.com/heimrichhannot/contao-versions

Create versions within contao with ease and prevent entities from being purged by fromTable name.

  Sources   Download

LGPL-3.0+

The Requires

 

contao versions

15/12 2016

1.0.7

1.0.7.0 https://github.com/heimrichhannot/contao-versions

Create versions within contao with ease and prevent entities from being purged by fromTable name.

  Sources   Download

LGPL-3.0+

The Requires

 

contao versions

21/10 2016

1.0.6

1.0.6.0 https://github.com/heimrichhannot/contao-versions

Create versions within contao with ease and prevent entities from being purged by fromTable name.

  Sources   Download

LGPL-3.0+

The Requires

 

contao versions

19/09 2016

1.0.5

1.0.5.0 https://github.com/heimrichhannot/contao-versions

Create versions within contao with ease and prevent entities from being purged by fromTable name.

  Sources   Download

LGPL-3.0+

The Requires

 

contao versions

07/09 2016

1.0.4

1.0.4.0 https://github.com/heimrichhannot/contao-versions

Create versions within contao with ease and prevent entities from being purged by fromTable name.

  Sources   Download

LGPL-3.0+

The Requires

 

contao versions

31/08 2016

1.0.3

1.0.3.0 https://github.com/heimrichhannot/contao-versions

Create versions within contao with ease and prevent entities from being purged by fromTable name.

  Sources   Download

LGPL-3.0+

The Requires

 

contao versions

31/08 2016

1.0.2

1.0.2.0 https://github.com/heimrichhannot/contao-versions

Create versions within contao with ease and prevent entities from being purged by fromTable name.

  Sources   Download

LGPL-3.0+

The Requires

 

contao versions

29/08 2016

1.0.1

1.0.1.0 https://github.com/heimrichhannot/contao-versions

Create versions within contao with ease and prevent entities from being purged by fromTable name.

  Sources   Download

LGPL-3.0+

The Requires

 

contao versions

24/08 2016