symfony

Attempted to load class “Month” from namespace “DoctrineExtensions\Query\Mysql”. Did you forget a “use” statement for another namespace

只谈情不闲聊 提交于 2021-02-19 01:13:37
问题 I get the error Attempted to load class "Month" from namespace "DoctrineExtensions\Query\Mysql". Did you forget a "use" statement for another namespace when i'm trying to create a query that fetch data by year and month Inside my repository public function getCongePris($mois,$annee,$matricule) { $emConfig = $this->_em->getConfiguration(); $emConfig->addCustomDatetimeFunction('YEAR', 'DoctrineExtensions\Query\Mysql\Year'); $emConfig->addCustomDatetimeFunction('MONTH', 'DoctrineExtensions\Query

Attempted to load class “Month” from namespace “DoctrineExtensions\Query\Mysql”. Did you forget a “use” statement for another namespace

主宰稳场 提交于 2021-02-19 01:13:23
问题 I get the error Attempted to load class "Month" from namespace "DoctrineExtensions\Query\Mysql". Did you forget a "use" statement for another namespace when i'm trying to create a query that fetch data by year and month Inside my repository public function getCongePris($mois,$annee,$matricule) { $emConfig = $this->_em->getConfiguration(); $emConfig->addCustomDatetimeFunction('YEAR', 'DoctrineExtensions\Query\Mysql\Year'); $emConfig->addCustomDatetimeFunction('MONTH', 'DoctrineExtensions\Query

source mapping with assetic in symfony2

我只是一个虾纸丫 提交于 2021-02-18 21:11:53
问题 there is this cool feature Source Maps in html5. In my Symfony2 project I use jQuery mobile which uses this feature (I use the BmatznerJQueryMobileBundle for integration). In my <head> i do following: {% javascripts '@BmatznerJQueryBundle/Resources/public/js/jquery.min.js' '@BmatznerJQueryMobileBundle/Resources/public/js/jquery.mobile.min.js' %} <script src="{{ asset_url }}"></script> {% endjavascripts %} This works fine for the js files, but Chrome gets an 404 error trying to get the source

source mapping with assetic in symfony2

|▌冷眼眸甩不掉的悲伤 提交于 2021-02-18 21:04:01
问题 there is this cool feature Source Maps in html5. In my Symfony2 project I use jQuery mobile which uses this feature (I use the BmatznerJQueryMobileBundle for integration). In my <head> i do following: {% javascripts '@BmatznerJQueryBundle/Resources/public/js/jquery.min.js' '@BmatznerJQueryMobileBundle/Resources/public/js/jquery.mobile.min.js' %} <script src="{{ asset_url }}"></script> {% endjavascripts %} This works fine for the js files, but Chrome gets an 404 error trying to get the source

Symfony 2 - Loading roles from database

陌路散爱 提交于 2021-02-17 20:51:36
问题 My roles are stored in the database and I am trying to load them dynamically upon login. What I'm doing is querying for the roles and setting them on the user object in my user provider as seen here: public function loadUserByUsername($username) { $q = $this ->createQueryBuilder('u') ->where('u.username = :username') ->setParameter('username', $username) ->getQuery() ; try { // The Query::getSingleResult() method throws an exception // if there is no record matching the criteria. $user = $q-

What's the difference between api key, client id and service account?

荒凉一梦 提交于 2021-02-17 18:58:49
问题 I needed to access a Google's service, i.e. Google Analytics, from my Symfony 2 application, so I had to use the Google api client (version 2). Before accessing Google Analytics' info, I had to create either a api key, a client id or a service account in the Google API Console. At the end, I created a service account, and a file was downloaded. This file is used by the Google api client to grant access to my Google Analytics account and its respective collected info. My question are: What are

Symfony Process - Command not found

核能气质少年 提交于 2021-02-17 07:14:07
问题 I'm trying to execute ffmpeg commands using Symfony Process Component but command is not being processed. What am I doing wrong? I get the error The command "'ffmpeg -i [...........]' failed. Exit Code: 127(Command not found)" <?php $info = pathinfo($file); $dir = "{$info['dirname']}/{$info['filename']}"; File::makeDirectory($dir, 0755, true) $process = new Process(["ffmpeg -i {$info['basename']} -codec copy -map 0 -f segment -segment_list {$dir}/playlist.m3u8 -segment_list_flags +live

ID not saved in OneToMany relationship

大城市里の小女人 提交于 2021-02-17 05:17:05
问题 I'm working on a project using Symfony2. But I'm running into a problem. I have an entity Purchase and another, TypePurchase. They have an OneToMany-relationship, but when I look inside of the table of TypePurchase, the Purchase entity ID is not saved. It's value is null. I already tried $types->setPurchase($this) in the addType method Purchase. But this gives me the result that only the first added entity get's an ID, the next one is again null. This is my field and ID field in Purchase: /**

Set Redis cache prefix key on Symfony

两盒软妹~` 提交于 2021-02-17 02:09:07
问题 I'm using Redis to manage some caching within my Symfony 3.4 app, configured like this: config.yml framework: cache: default_redis_provider: 'redis://127.0.0.1:6379' pools: cache.catalog: adapter: cache.adapter.redis provider: iwid.custom_redis_provider default_lifetime: 86400 public: true cache.language: adapter: cache.adapter.redis provider: iwid.custom_redis_provider default_lifetime: 86400 public: true services.yml services: iwid.custom_redis_provider: class: Redis factory: ['Symfony

POST request on many-to-many association

余生长醉 提交于 2021-02-16 15:27:10
问题 I have two entities with a many-to-many association: class User extends BaseUser and class Calendar { /** * @var integer * * @ORM\Column(name="id", type="integer") * @ORM\Id * @ORM\GeneratedValue(strategy="AUTO") */ private $id; /** * @var string * * @ORM\Column(name="name", type="text") */ private $name; /** * @var string * * @ORM\Column(name="view", type="text") * @Assert\Choice(choices = {"work week", "week", "month", "year"}, message = "Choose a valid view.") */ private $view; /** *