symfony - Some difficulties to understand a namesapace and his use -
i haves difficulties understand namespace's use :
namespace utilisateurs\utilisateursbundle\entity; use fos\userbundle\entity\user baseuser;
i have found namespace called fos (in /applications/mamp/htdocs/ecommerce/vendor/friendsofsymfony/user-bundle) :
namespace fos\userbundle;
but don't understand \entity\user.
this code of entity :
<?php // src/acme/userbundle/entity/user.php namespace utilisateurs\utilisateursbundle\entity; use fos\userbundle\entity\user baseuser; use doctrine\orm\mapping orm; /** * @orm\entity * @orm\table(name="utilisateurs") */ class utilisateurs extends baseuser { /** * @orm\id * @orm\column(type="integer") * @orm\generatedvalue(strategy="auto") */ protected $id; public function __construct() { parent::__construct(); // own logic } }
when understand namespace, able fix problem :
fatal error: class 'fos\userbundle\entity\user' not found in /applications/mamp/htdocs/ecommerce/src/utilisateurs/utilisateursbundle/entity/utilisateurs.php on line 14 [2015-08-16 17:19:57] php.critical: fatal error: class 'fos\userbundle\entity\user' not found {"type":1,"file":"/applications/mamp/htdocs/ecommerce/src/utilisateurs/utilisateursbundle/entity/utilisateurs.php","line":14,"level":-1,"stack":[]}
fatal error: class 'fos\userbundle\propel\om\baseuser' not found in /applications/mamp/htdocs/ecommerce/vendor/friendsofsymfony/user-bundle/propel/user.php on line 18
i recommend watch php namespaces in 120 seconds screencast.
Comments
Post a Comment