Service Calls -- quick question

When I see code like this, which is a page block on the Profile page :

$iPID = $this->oProfileGen->_iProfileID;
        $sNickName = $this->oProfileGen->_aProfile['NickName'];
        if ($iPID) {
        $aParams = array();
        $aParams['PID'] = $iPID;
        $aParams['DisplayPagination'] = 1;
        $aParams['DisplayLink'] = 1;
        return BxDolService::call('photos', 'profile_photo_block', array($aParams), 'Search'); }

What does that last line actually call?  I look at the boonex photos module, and there's no function named 'profile_photo_block'.  Obviously, this is the code that displays the relevant photo, but I'm having a hard time mapping the Content of a page block to the appropriate method.

Thx,

Tac

 

Quote · 28 Nov 2010

It calls function serviceProfilePhotoBlock ($aParams) in modules/boonex/photos/classes/BxPhotosSearch.php

https://www.deanbassett.com
Quote · 28 Nov 2010

Thanks, that helps.  So the 'Search' means call the BxPhotosSearch class (where do we get the ;BxPhotos' prefix from?  And the method name that's called goes from lowercase-with-underscores to camel caps, right?

Is there any documentation for this?  Or is it something you just learn by asking and prodding?

The idea that you call something with one_format and it calls ->anotherFormat() makes simple searching for these things very, very difficult.

Anyway, that does help a lot, thanks!

 

Tac

Quote · 28 Nov 2010

 

Thanks, that helps.  So the 'Search' means call the BxPhotosSearch class (where do we get the ;BxPhotos' prefix from?  And the method name that's called goes from lowercase-with-underscores to camel caps, right?

Is there any documentation for this?  Or is it something you just learn by asking and prodding?

The idea that you call something with one_format and it calls ->anotherFormat() makes simple searching for these things very, very difficult.

Anyway, that does help a lot, thanks!

 

Tac

The service call can exist in any class within the module. Determined by the last call to the function. If omited, Module is used. In this case Search was specified.

If you look at the file names...

They all start with the prefix BxPhotos. That prefix is specified in the config file of the module. modules\boonex\photos\install\config.php.

So that last peram is matched to the rest of the filename after the prefix which is Search.


First peram specifies the module name which is photos.

Second peram specifies the name of the function. Which is profile_photo_block. That is converted by removing the _ and making the starting char of each word uppercase. So ProfilePhotoBlock. The the prefix service is added completing the name of the function serviceProfilePhotoBlock

The third peram is an array containing the perams that are passed to the function.


Yea, it is complicated, and there are no usefull docs. We all learn by looking and doing.




https://www.deanbassett.com
Quote · 28 Nov 2010

I've been working on a data export tool, to make looking at the database easier.  Any interest in testing it before release?

Here's a snippet from the page blocks section, within the Profile page:

_FieldCaption_Admin Controls_View: 
      Desc: Profile Fields Block
      Page: profile
      PageWidth: 998px
      Func: PFBlock
      Content: 21
      Visible: non,memb
      DesignBox: 1
      Column: 2
      ColWidth: 66

 

What does Func: PFBlock mean, with content = 21?  Func: PHP I know means process the Content as PHP, I assume this is an index to something, but not sure.

Thx,

Tac

Quote · 28 Nov 2010
 
 
Below is the legacy version of the Boonex site, maintained for Dolphin.Pro 7.x support.
The new Dolphin solution is powered by UNA Community Management System.