alla fine ho risolto così :

codice:
$postsId =  array();
		
				foreach ($CategoryAddTable->getValues($categoryId) as $attributes ):
        			
        			array_push($postsId,$attributes['post_id']);

        		endforeach;
ma ho un' altra domanda:

devo inserire un if che all' ultimo array mi esegue una funzione,
come faccio???
Come si fa a conoscere l' ultimo array