473,386 Members | 1,738 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Using Zend and Object property/functions follow-up

Using Zend and Object property/functions follow-up:

With Zend, using PHP5, I am trying to acess property of an object that
is stored in a member variable.
I'm quite new in using PHP5 and class functions but I haven't seen
anything that could answer me. Would someone please tell me what I am
doing wrong or link me to somewhere I may find some help please

Neko
DEMO:

class A
{

private $m_oObjectC = NULL;

function __construct()
{
$this->m_oObjectC = new B();
}

private function test()
{
// I canot see the attribute listing at the second ->
as if it could not read property.
// I know that like that, there is no way it may know
what is the current object
// but this is what my question is about, how to 'CAST'

// or whatever it take to get the class information.
$var = $this->m_oObjectC->FctClassC();
}
}

class B
{

function __construct()
{
$oObjectC = new C();

// Some manipulations

return $oObjectC;
}

}

class C
{

function __construct()
{

}

function FctClassC()
{
// Some manipulations
}

}

Jun 21 '06 #1
1 1576
Hello,
class A
$var = $this->m_oObjectC->FctClassC();
you are trying to access method FctClassC() in Class B,
but Class B has not that method
class B
$oObjectC = new C();


in constructor you are initialising local variable
$oObjectC, it's can't be accessed from anywhere
after constructor finished

Solution:
1. change class B declaration on: Class B extends C
2. in constructor class B change: $this->oObjectC = new C();

Read about OOP.

I hope it's help.
--
Best Regards,
Juliusz
http://www.jetfish.net
Jun 22 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

13
by: AJ | last post by:
Hi all At the moment, I use Dreamweaver to develop the basics of my PHP stuff and then hand tune anything that I need to. I'm now looking at the next level and was wondering about Zend. What...
28
by: Daniel | last post by:
Hello =) I have an object which contains a method that should execute every x ms. I can use setInterval inside the object construct like this - self.setInterval('ObjectName.methodName()',...
4
by: KathyB | last post by:
I have the following script in an html page: function goToPosition() { varGoTo = document.write(document.cookie("Position")); document.scrollTo(0, varGoTo); } </head> <body...
16
by: sneill | last post by:
How is it possible to take the value of a variable (in this case, MODE_CREATE, MODE_UPDATE, etc) and use that as an object property name? In the following example I want 'oIcon' object to have...
121
by: typingcat | last post by:
First of all, I'm an Asian and I need to input Japanese, Korean and so on. I've tried many PHP IDEs today, but almost non of them supported Unicode (UTF-8) file. I've found that the only Unicode...
11
by: Brent Ritchie | last post by:
Hello all, I have been using C# in my programming class and I have grown quite fond of C# properties. Having a method act like a variable that I can control access to is really something. As...
1
by: Xristos Nikolopoulos | last post by:
Hello, I have made an application that needs to upload files, the application is deployed in several folders, and each folder has its php files. The problem is, I have in the folder I want to...
1
by: mosesdinakaran | last post by:
Hi All, Is there a difference between Zend Extension and PHP Extensions In php.ini For Mysql we have extension=mysql.so But for XDEBUG we have
13
by: Josip | last post by:
I'm trying to limit a value stored by object (either int or float): class Limited(object): def __init__(self, value, min, max): self.min, self.max = min, max self.n = value def...
23
Frinavale
by: Frinavale | last post by:
JavaScript is a very strange place for me... So, I decided that, before I attempt to create an Object, I should first learn about Objects. I had actually created one before with the help of a...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.