Skip to content
This repository has been archived by the owner on Jan 16, 2023. It is now read-only.

Commit

Permalink
Move entities into unified namespace
Browse files Browse the repository at this point in the history
  • Loading branch information
recrsn authored and imphil committed May 19, 2019
1 parent 343c3ae commit 8bc25a0
Show file tree
Hide file tree
Showing 56 changed files with 158 additions and 132 deletions.
16 changes: 8 additions & 8 deletions site/app/config/config_dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,11 +55,11 @@ assetic:
easy_admin:
site_name: 'LibreCores Admin'
entities:
- Librecores\ProjectRepoBundle\Entity\GitSourceRepo
- Librecores\ProjectRepoBundle\Entity\Organization
- Librecores\ProjectRepoBundle\Entity\OrganizationMember
- Librecores\ProjectRepoBundle\Entity\Project
# - Librecores\ProjectRepoBundle\Entity\SourceStats
# - Librecores\ProjectRepoBundle\Entity\SourceStatsAuthor
# - Librecores\ProjectRepoBundle\Entity\SourceStatsCommitHistogram
- Librecores\ProjectRepoBundle\Entity\User
- App\Entity\GitSourceRepo
- App\Entity\Organization
- App\Entity\OrganizationMember
- App\Entity\Project
# - App\Entity\SourceStats
# - App\Entity\SourceStatsAuthor
# - App\Entity\SourceStatsCommitHistogram
- App\Entity\User
6 changes: 3 additions & 3 deletions site/app/config/packages/algolia_search.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@ algolia_search:
prefix: "%algolia_search_prefix%"
indices:
- name: projects
class: Librecores\ProjectRepoBundle\Entity\Project
class: App\Entity\Project

- name: organization
class: Librecores\ProjectRepoBundle\Entity\Organization
class: App\Entity\Organization

- name: user
class: Librecores\ProjectRepoBundle\Entity\User
class: App\Entity\User
7 changes: 7 additions & 0 deletions site/app/config/packages/doctrine.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,13 @@ doctrine:
orm:
auto_generate_proxy_classes: "%kernel.debug%"
auto_mapping: true
mappings:
App:
is_bundle: false
type: annotation
dir: '%kernel.project_dir%/src/App/Entity'
prefix: 'App\Entity'
alias: App
dql:
datetime_functions:
DAY: 'DoctrineExtensions\Query\Mysql\Day'
Expand Down
2 changes: 1 addition & 1 deletion site/app/config/packages/fos_user.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
fos_user:
db_driver: orm
firewall_name: main
user_class: 'Librecores\ProjectRepoBundle\Entity\User'
user_class: 'App\Entity\User'
service:
user_manager: librecores_user_manager
mailer: fos_user.mailer.twig_swift
Expand Down
2 changes: 1 addition & 1 deletion site/src/App/DataFixtures/ORM/LoadBaseData.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
use Doctrine\Common\DataFixtures\AbstractFixture;
use Doctrine\Common\DataFixtures\FixtureInterface;
use Doctrine\Common\Persistence\ObjectManager;
use Librecores\ProjectRepoBundle\Entity\Organization;
use App\Entity\Organization;

/**
* Create the required minimum database entries
Expand Down
12 changes: 6 additions & 6 deletions site/src/App/DataFixtures/ORM/LoadDevTestData.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@
use Doctrine\Common\DataFixtures\AbstractFixture;
use Doctrine\Common\DataFixtures\FixtureInterface;
use Doctrine\Common\Persistence\ObjectManager;
use Librecores\ProjectRepoBundle\Entity\GitSourceRepo;
use Librecores\ProjectRepoBundle\Entity\Organization;
use Librecores\ProjectRepoBundle\Entity\OrganizationMember;
use Librecores\ProjectRepoBundle\Entity\Project;
use Librecores\ProjectRepoBundle\Entity\User;
use App\Entity\GitSourceRepo;
use App\Entity\Organization;
use App\Entity\OrganizationMember;
use App\Entity\Project;
use App\Entity\User;
use Symfony\Component\DependencyInjection\ContainerAwareInterface;
use Symfony\Component\DependencyInjection\ContainerAwareTrait;

Expand Down Expand Up @@ -105,7 +105,7 @@ public function load(ObjectManager $manager)
* @param string $username
* @param string $password
*
* @return \Librecores\ProjectRepoBundle\Entity\User
* @return \App\Entity\User
*/
private function createUser($username, $password)
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
<?php

namespace Librecores\ProjectRepoBundle\Entity;
namespace App\Entity;

use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;

/**
* A classification hierarchy for the projects
*
* This class contains classification categories that can be use to classify a project
* for better categorization
* This class contains classification categories that can be use to classify a
* project for better categorization
*
* @author Sandip Kumar Bhuyan <[email protected]>
*
Expand Down Expand Up @@ -130,7 +131,7 @@ public function setName($name)
/**
* Add child category
*
* @param \Librecores\ProjectRepoBundle\Entity\ClassificationHierarchy $child
* @param ClassificationHierarchy $child
*
* @return ClassificationHierarchy
*/
Expand All @@ -144,7 +145,7 @@ public function addChild(ClassificationHierarchy $child)
/**
* Remove child category
*
* @param \Librecores\ProjectRepoBundle\Entity\ClassificationHierarchy $child
* @param ClassificationHierarchy $child
*/
public function removeChild(ClassificationHierarchy $child)
{
Expand All @@ -154,7 +155,7 @@ public function removeChild(ClassificationHierarchy $child)
/**
* Get children category
*
* @return \Doctrine\Common\Collections\Collection
* @return Collection
*/
public function getChildren()
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace Librecores\ProjectRepoBundle\Entity;
namespace App\Entity;

use DateTime;
use Doctrine\ORM\Mapping as ORM;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace Librecores\ProjectRepoBundle\Entity;
namespace App\Entity;

use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace Librecores\ProjectRepoBundle\Entity;
namespace App\Entity;

use Doctrine\ORM\Mapping as ORM;

Expand All @@ -24,7 +24,7 @@ public function __construct($url = null)

/**
* {@inheritDoc}
* @see \Librecores\ProjectRepoBundle\Entity\SourceRepo::getType()
* @see \App\Entity\SourceRepo::getType()
*/
public function getType()
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace Librecores\ProjectRepoBundle\Entity;
namespace App\Entity;

/**
* Statistics about a programming language in a source code repository
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace Librecores\ProjectRepoBundle\Entity;
namespace App\Entity;

use DateTime;
use Doctrine\Common\Collections\ArrayCollection;
Expand Down Expand Up @@ -99,6 +99,7 @@ class Organization
private $creator;

// metadata

/**
* When was this organization created?
*
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace Librecores\ProjectRepoBundle\Entity;
namespace App\Entity;

use DateTime;
use Doctrine\ORM\Mapping as ORM;
Expand All @@ -23,20 +23,23 @@ class OrganizationMember
const PERMISSION_SUPPORT = 'SUPPORT';
const PERMISSION_MEMBER = 'MEMBER';
const PERMISSION_ADMIN = 'ADMIN';

/**
* @var Organization
*
* @ORM\ManyToOne(targetEntity="Organization", inversedBy="members")
* @ORM\JoinColumn(name="organizationId", referencedColumnName="id", nullable=FALSE)
*/
protected $organization;

/**
* @var User
*
* @ORM\ManyToOne(targetEntity="User", inversedBy="organizationMemberships")
* @ORM\JoinColumn(name="userId", referencedColumnName="id", nullable=FALSE)
*/
protected $user;

/**
* @var string
*
Expand All @@ -45,6 +48,7 @@ class OrganizationMember
* @ORM\Column(type="string")
*/
protected $permission = self::PERMISSION_REQUEST;

/**
* When was this mapping created?
*
Expand All @@ -55,6 +59,7 @@ class OrganizationMember
protected $createdAt;

// metadata

/**
* When was this mapping last updated?
*
Expand All @@ -63,6 +68,7 @@ class OrganizationMember
* @ORM\Column(type="datetime")
*/
protected $updatedAt;

/**
* @var int
*
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace Librecores\ProjectRepoBundle\Entity;
namespace App\Entity;

use DateTime;
use Doctrine\Common\Collections\ArrayCollection;
Expand Down Expand Up @@ -34,6 +34,7 @@ class Project
{
const STATUS_ASSIGNED = 'ASSIGNED';
const STATUS_UNASSIGNED = 'UNASSIGNED';

/**
* Classifications assigned to this project
*
Expand All @@ -44,6 +45,7 @@ class Project
* @ORM\JoinColumn(name="projectId", referencedColumnName="id")
*/
protected $classifications;

/**
* Internal project ID
*
Expand All @@ -54,6 +56,7 @@ class Project
* @ORM\GeneratedValue(strategy="AUTO")
*/
private $id;

/**
* Status of the project
*
Expand All @@ -64,6 +67,7 @@ class Project
* @ORM\Column(type="string", options={"default" : Project::STATUS_ASSIGNED})
*/
private $status = self::STATUS_ASSIGNED;

/**
* User owning this project
*
Expand All @@ -75,6 +79,7 @@ class Project
private $parentUser;

// Associations

/**
* Organization owning this project
*
Expand All @@ -84,6 +89,7 @@ class Project
* @ORM\JoinColumn(nullable=true)
*/
private $parentOrganization;

/**
* Short name of the project
*
Expand Down Expand Up @@ -157,7 +163,7 @@ class Project
/**
* @var SourceRepo
*
* @Assert\Type(type="Librecores\ProjectRepoBundle\Entity\SourceRepo")
* @Assert\Type(type="App\Entity\SourceRepo")
* @Assert\Valid()
*
* @ORM\OneToOne(targetEntity="SourceRepo", inversedBy="project", cascade={"persist", "remove"})
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace Librecores\ProjectRepoBundle\Entity;
namespace App\Entity;

use DateTime;
use Doctrine\ORM\Mapping as ORM;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace Librecores\ProjectRepoBundle\Entity;
namespace App\Entity;

use DateTime;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace Librecores\ProjectRepoBundle\Entity;
namespace App\Entity;

use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace Librecores\ProjectRepoBundle\Entity;
namespace App\Entity;

use Doctrine\ORM\Mapping as ORM;
use InvalidArgumentException;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace Librecores\ProjectRepoBundle\Entity;
namespace App\Entity;

use DateTime;
use Doctrine\Common\Collections\ArrayCollection;
Expand Down Expand Up @@ -30,6 +30,7 @@ class User extends BaseUser


// OAuth-related entries

/**
* GitHub User ID provided by the OAuth service.
*
Expand Down Expand Up @@ -73,6 +74,7 @@ class User extends BaseUser
protected $googleOAuthAccessToken;

// associations

/**
* @var ArrayCollection
*
Expand All @@ -98,6 +100,7 @@ class User extends BaseUser
protected $organizationMemberships;

// profile data

/**
* Full (real) name of the user
*
Expand All @@ -108,6 +111,7 @@ class User extends BaseUser
protected $name;

// metadata

/**
* When was this user created?
*
Expand Down
2 changes: 1 addition & 1 deletion site/src/App/RepoCrawler/CrawlerException.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
namespace App\RepoCrawler;

use Exception;
use Librecores\ProjectRepoBundle\Entity\SourceRepo;
use App\Entity\SourceRepo;
use Throwable;

class CrawlerException extends Exception
Expand Down
Loading

0 comments on commit 8bc25a0

Please sign in to comment.