I have a class with two arrays as members. $ member_albums and $ member_photos.
As part of the initialization, I take the data as from the URL to add each photo as a value in the participantโs photo array. This is done by the method inside the class. However, I cannot add values โโor even modify existing ones. Help?
Here is the method -
private function build_urls() {
if ($this->member_albums && $this->member_photos) {
if ($this->member_albums['Count'] > 0) {
for ($x = 0; $x < $this->member_albums['Count']; $x++) {
$curr_AlbumId = $this->member_albums['Items'][$x][MEMBER_ALBUM_ID]['S'];
if ($this->member_photos[$curr_AlbumId]['Count'] > 0) {
for ($y = 0; $y < $this->member_photos[$curr_AlbumId]['Count']; $y++) {
$this->member_photos[$curr_AlbumId]['Items'][$y]['url'] = array('S' =>
'http://www.example/somephoto.jpg');
}
}
}
}
}
}
Edit:
Adding an example data structure for arrays.
$member_albums -
[Count] => 1 [Items] => Array ( [0] => Array ( [Timestamp] => Array ( [N] => 468839229.371792 ) [Year] => Array ( [N] => 0 ) [UserId] => Array ( [S] => A05737C7-7D63-4EA8-8316-9D274DAE1BD0 ) [AlbumId] => Array ( [S] => album_3 ) )
$member_photos -
[Count] => 9 [Items] => Array ( [0] => Array ( [ShotId] => Array ( [S] => Photo4 ) [AlbumId] => Array ( [S] => album_3 ) [UserId] => Array ( [S] => A05737C7-7D63-4EA8-8316-9D274DAE1BD0 ) [Year] => Array ( [N] => 0 ) )
source
share