symfony-1.4

Symfony/sfDoctrineGuard Conditional Permissions

巧了我就是萌 提交于 2019-12-11 05:48:03
问题 I'm contemplating the best way to implement the conditional permissions i.e. Users and Teams are m-to-m. But each Team also has a 1-to-m "Leader" relationship with the User table as well. For simplicity sake, let's say we have two permission levels, "User" and "Admin". Then lets say, only certain Team administration task i.e. group emails, can only be sent by that team's leader. At the moment, every action that is specific to team leaders queries the database to check it the current user is

Symfony 1.4: How to manipulate the attributeHolder?

China☆狼群 提交于 2019-12-11 05:12:50
问题 I have an Attribute called 'admin_module' in myUser attributeHoler and i want to manipulate it...but i don't even get how to access the values stored there. I know how to get AttributeHolder in an action, but I don't have a clue, how to access the values in it. Any help appreciated...thanks in advance. ;) Edit after answers: get: $this->getUser()->getAttributeHolder()->set('beilagenbuchung.page', 1, 'admin_module'); set: $this->getUser()->getAttributeHolder()->get('beilagenbuchung.page', null

How to add a column in entity on Symfony 1.4 using line command?

自作多情 提交于 2019-12-11 05:04:03
问题 I have some problem. I work on symfony 1.4. I want to add a new column in my table and generate in php getter and setter to use it. So In my shema.yml I add my column in my table like this: version : {type: integer} userName_canonical : {type: varchar(255)} email_canonical : {type: varchar(255)} qualifications: {type: array} qualification_autre: {type: string} promo: {type: boolean, default: 0} next_request_at: {type: date, default: null}<----- But I search everywhere and I don't know how I

PHP warning: array_shift() expects parameter 1 to be array, null given in /home5/…/php/symfony/command/sfCommandManager.class.php

萝らか妹 提交于 2019-12-11 04:48:46
问题 array_shift() expects parameter 1 to be array, null given in /home5/.../php/symfony/command/sfCommandManager.class.php is the error I'm getting. I am trying to set up a Symfony 1.4 project using Bluehost, and I receive this error in the error log when I try to run symfony generate:project project name. 回答1: You need to give the array_shift() the parameter! Look this example: $stack = array("orange", "banana", "apple", "raspberry"); $fruit = array_shift($stack); // Here you give the parameter

How to convert this MySQL statement to symfony Propel? [closed]

亡梦爱人 提交于 2019-12-11 04:42:12
问题 This question is unlikely to help any future visitors; it is only relevant to a small geographic area, a specific moment in time, or an extraordinarily narrow situation that is not generally applicable to the worldwide audience of the internet. For help making this question more broadly applicable, visit the help center. Closed 6 years ago . Here's the MySQL: SELECT * FROM tbl1 WHERE name > ( SELECT name FROM tbl1 WHERE id = 3 ) ORDER BY name Here's my best guess at the Propel code but it's

Symfony 1.4/ Doctrine; n-m relation data cannot be accessed in template (indexSuccess)

ⅰ亾dé卋堺 提交于 2019-12-11 04:09:35
问题 I have a database with 3 tables. It's a simple n-m relationship. Student, Course and StudentHasCourse to handle n-m relationship. I post the schema.yml for reference, but it would not be really necessary. Course: connection: doctrine tableName: course columns: id: type: integer(4) fixed: false unsigned: false primary: true autoincrement: false name: type: string(45) fixed: false unsigned: false primary: false notnull: false autoincrement: false relations: StudentHasCourse: local: id foreign:

Naming Generated Functions in Propel

╄→гoц情女王★ 提交于 2019-12-11 03:52:56
问题 The ideo of cross-reference tables is introduced in Propel 1.5. This means that an entity can get a list of related items as if it were a one-to-many relation. So in a person-to-groups relationship, a person can call getGroups() , and a group can call getPersons() . This makes things much easier to handle. However, if an entity has a many-to-many relationship to itself, the names of the function calls become more complex. As an example, the following permits groups to contain groups within

Strange symfony i18n error

岁酱吖の 提交于 2019-12-11 03:35:04
问题 I use symfony 1.4.11. In my site I have 3 languages in my site "se","en","no". In my backend, I use only en, and I have in settings: all: .settings: default_culture: en But in some module, when in frontend I have "se" language, have error : Data file for "se" was not found. In frontend I try, make i18n with database; Stack trace: stack trace at () in SF_SYMFONY_LIB_DIR/i18n/sfCultureInfo.class.php line 301 ... if (is_file($filename) == false) { throw new sfException(sprintf('Data file for "%s

JSON encoding headers using Sendgrid

眉间皱痕 提交于 2019-12-11 03:14:07
问题 I am trying to change the filter status for the 'subscriptiontrack' using sendgrid. I think I am sending the headers incorrectly, but not totally sure. Working inside a symfony 1.4 framework. First I create an object of the header settings $hdr = new SmtpApiHeader(); $hdr->addFilterSetting('subscriptiontrack', 'enable', 0); $hdr->as_string(); which sets the filter settings and encodes the string Then I send it off the email class sendTestEmail::sendEmail($contents, $mailFrom, $testGroup,

Using sfFilter to update DB with Doctrine

强颜欢笑 提交于 2019-12-11 00:30:44
问题 I've created a sfFilter to update the current module where the user is at: class SessionFilter extends sfFilter { public function execute($filterChain){ if ($this->isFirstCall()){ $user = $this->getContext()->getUser()->getId(); $module = $this->getContext()->getModuleName(); Doctrine::getTable('ActiveSession')->set($user, $module); Doctrine::getTable('ActiveSession')->refresh(); } $filterChain->execute(); } } When I look up into the db I found out that the record has set the field 'module'