Rename to RelationalEntity to avoid naming collission

This commit is contained in:
Julius Haertl
2017-01-31 13:43:35 +01:00
parent b0dd73b811
commit 6dc6f924cf
9 changed files with 11 additions and 10 deletions

View File

@@ -23,7 +23,7 @@
namespace OCA\Deck\Db;
class Acl extends Entity implements \JsonSerializable {
class Acl extends RelationalEntity implements \JsonSerializable {
const PERMISSION_READ = 0;
const PERMISSION_EDIT = 1;

View File

@@ -25,7 +25,7 @@ namespace OCA\Deck\Db;
use JsonSerializable;
class Board extends Entity implements JsonSerializable {
class Board extends RelationalEntity implements JsonSerializable {
public $id;
protected $title;

View File

@@ -26,7 +26,7 @@ namespace OCA\Deck\Db;
use JsonSerializable;
class Card extends Entity implements JsonSerializable {
class Card extends RelationalEntity implements JsonSerializable {
public $id;
protected $title;

View File

@@ -49,7 +49,7 @@ class CardMapper extends DeckMapper implements IPermissionMapper {
/**
* @param $id
* @return Entity if not found
* @return RelationalEntity if not found
*/
public function find($id) {
$sql = 'SELECT * FROM `*PREFIX*deck_cards` ' .

View File

@@ -26,7 +26,7 @@ namespace OCA\Deck\Db;
use JsonSerializable;
class Label extends Entity implements JsonSerializable {
class Label extends RelationalEntity implements JsonSerializable {
public $id;
protected $title;

View File

@@ -31,7 +31,7 @@
namespace OCA\Deck\Db;
class Entity extends \OCP\AppFramework\Db\Entity {
class RelationalEntity extends \OCP\AppFramework\Db\Entity {
private $_relations = array();

View File

@@ -26,7 +26,7 @@ namespace OCA\Deck\Db;
use JsonSerializable;
class Stack extends Entity implements JsonSerializable {
class Stack extends RelationalEntity implements JsonSerializable {
public $id;
protected $title;

View File

@@ -23,6 +23,7 @@
namespace OCA\Deck\Db;
use OCP\AppFramework\Db\Entity;
use OCP\IDBConnection;
@@ -53,7 +54,7 @@ class StackMapper extends DeckMapper implements IPermissionMapper {
}
public function delete(\OCP\AppFramework\Db\Entity $entity) {
public function delete(Entity $entity) {
// delete cards on stack
$this->cardMapper->deleteByStack($entity->getId());
return parent::delete($entity);

View File

@@ -26,7 +26,7 @@ namespace OCA\Deck\Db;
class EntityTest extends \PHPUnit_Framework_TestCase {
public function testRelation() {
$entity = new Entity();
$entity = new RelationalEntity();
$entity->foo = null;
$entity->addRelation('foo');
$entity->setFoo('test');
@@ -34,7 +34,7 @@ class EntityTest extends \PHPUnit_Framework_TestCase {
}
public function testWithoutRelation() {
$entity = new Entity();
$entity = new RelationalEntity();
$entity->foo = null;
$entity->setFoo('test');
$this->assertEquals(['foo'=>true], $entity->getUpdatedFields());