public function replicate(Agent $agent, Program &$victim) { if ($agent->getName() === 'Smith') { $victim = clone $agent; } }
<div class="box general"> <div class="agent card"> <div class="photo"> <?php echo get_the_post_thumbnail($agent->getId(), array(70, 70)); ?> </div> <span class="call-to-action"><?php echo __('Contact the agent', THEME_NAME); ?> </span> <h5 class="name"><?php echo $agent->getName(); ?> </h5> <div class="contact-info"> <?php if ($agent->hasPhone()) { ?> <strong>phone:</strong> <?php echo $agent->getPhone(); ?> <br> <?php } ?>
<tr> <th>#</th> <th>name</th> <th>since</th> <th>deliveries</th> <th>rating</th> <th>actions</th> </tr> </thead> <tbody>'; foreach ($agents as $agentID) { $agent = new Agent($agentID); $pageBody .= ' <tr> <td>' . $count . '</td> <td>' . $agent->getName() . '</td> <td>' . $agent->getDateJoined() . '</td> <td>' . $agent->getDeliveries() . '</td> <td>' . $agent->getRating() . '</td> <td> <ul> <li> <a href="?section=agents&action=view&target=' . $agentID . '">view</a> </li> <li> <a href="?section=agents&action=edit&target=' . $agentID . '">edit</a> </li> </ul> </td> </tr>'; }