Tagged Questions

Topics related to PHP classes implemented by Drupal core code.

learn more… | top users | synonyms

0
votes
0answers
33 views

How do I include PHP classes having the same name as Drupal classes?

I'm working on a custom module connecting Drupal and another website. The other website is hosted on the same server so I decided to includes the classes in order to interract with it. (Using ...
0
votes
1answer
34 views

Add different classes to the images that where uploaded with multi-upload

I'm looking for the best solution to add different classes to images that where multi uploaded to one field. So not a class to the field, but a possibility to add different classes to each single ...
1
vote
1answer
21 views

Drupal 7 way to allow instantiating derived classes

I have a class called MyService, a function to get the only instance of it custom_get_my_service(), and multiple functions a,b, etc that call the instance getter, as you can see below. All of this is ...
0
votes
1answer
40 views

Trying to find variable names from $user array

I need to manually pull through user images and and users first name for a comment section, but i cant find what these array items are named, if anybody knows please tell me and or tell me how to find ...
0
votes
1answer
67 views

Problem loading classes in drupal module

I'm having trouble loading classes in drupal7. Let me start with a WORKING EXAMPLE that doesn't have problems. If I create a file called sites/all/modules/johnmodule/test.php with the following ...
0
votes
1answer
59 views

db_select usage in class and returned object

I'd like to use db_select in a static public function of a certain class. The query should be a base query, which may then be customized in the calling function. Returning the result sets seems to ...
1
vote
1answer
1k views

How to add back button for specific content?

Just realised all my pages are now displaying a back button with this code I added to node.tpl.php <FORM><INPUT Type="button" VALUE="Back" onClick="history.go(-1);return ...
2
votes
2answers
483 views

Modules and namespaces

I have strange problem or maybe I'm doing something wrong. I've create my own module. My .info file looks like this: ... files[] = DdFactory.inc files[] = ArticleManager.inc ... In ...
1
vote
2answers
134 views

Using classes in nodes

I need a little bit of guidance, I made a custom class and im trying to use it in a node but of course it throwing a white screen at me. So my question is how can I go about using a custom class for ...
4
votes
5answers
4k views

In Drupal 7, how does Drupal handle autoloading of classes?

How does Drupal handle autoloading of classes through modules? For instance, if I have an Events module, and I declare a class called Event, and then in the .info file I include the class file, how is ...
3
votes
4answers
3k views

What causes the error “Call-time pass-by-reference has been deprecated?”

My understanding is that objects in PHP 5.3 are all passed by reference so using the &$ notation is not necessary. My problem is using date_views module where I'm getting this error. Deprecated ...
15
votes
4answers
4k views

Best practice for building modules using classes

I'm looking to start building my modules as classes now that lazy/auto-load are in Drupal 7, and I'd love to look at some modules (contrib or core) that are doing a great job of it. Is there a ...
3
votes
1answer
252 views

What is the purpose of the PHP class FileTransfer?

What is the purpose of the PHP class FileTransfer? In which cases, should a module deal with that class or one of its child classes?
1
vote
1answer
125 views

What is the difference between the classes ArchiverTar and Archive_Tar?

What is the difference between the classes ArchiverTar and Archive_Tar? Which one is a Drupal module supposed to use?