Skip to content

Commit

Permalink
Merge branch 'hotfix' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
willkoua committed Jun 2, 2016
2 parents 139d12e + c5c096c commit bb78299
Show file tree
Hide file tree
Showing 3 changed files with 67 additions and 0 deletions.
40 changes: 40 additions & 0 deletions config/Migrations/20160602174229_update_projetc_fileds.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
<?php

use Phinx\Migration\AbstractMigration;

class UpdateProjetcFileds extends AbstractMigration
{
/**
* Change Method.
*
* Write your reversible migrations using this method.
*
* More information on writing migrations is available here:
* http://docs.phinx.org/en/latest/migrations.html#the-abstractmigration-class
*
* The following commands can be used in this method and Phinx will
* automatically reverse them when rolling back:
*
* createTable
* renameTable
* addColumn
* renameColumn
* addIndex
* addForeignKey
*
* Remember to call "create()" or "update()" and NOT "save()" when working
* with the Table class.
*/
public function change()
{
$table = $this->table('projects');

$table->removeColumn('updated');
$table->removeColumn('created');

$table->addColumn('created', 'datetime', ['default' => null, 'null' => true]);
$table->addColumn('modified', 'datetime', ['default' => null, 'null' => true]);

$table->update();
}
}
26 changes: 26 additions & 0 deletions src/Model/Entity/Project.php
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,32 @@ public function editMentors($mentors)
return $mentors;
}

/**
* Set the created
*
* @param string $created created
*
* @return string $created
*/
public function editCreated($created)
{
$this->set('created', $created);
return $created;
}

/**
* Set the modified
*
* @param string $modified modified
*
* @return string $modified
*/
public function editModified($modified)
{
$this->set('modified', $modified);
return $modified;
}

/**
* Modify mentors
*
Expand Down
1 change: 1 addition & 0 deletions src/Model/Table/ProjectsTable.php
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ public function initialize(array $config)
'joinTable' => 'projects_mentors'
]
);
$this->addBehavior('Timestamp');
}

/**
Expand Down

0 comments on commit bb78299

Please sign in to comment.