We’ve just updated this as a new package for Laravel 5. GROUP BY m.mac, vi.id, m.id, m.firstseen, m.lastseen,Ĭ.id, c.abbreviatedName, s.name, o.organisationĪbout a year ago, I released a Doctrine2 provider for Laravel 4. LEFT JOIN Entities\\OUI o WITH SUBSTRING( m.mac, 1, 6 ) = o.oui GROUP_CONCAT( DISTINCT ipv6.address ) AS ip6,ĬOALESCE( o.organisation, 'Unknown' ) AS organisation GROUP_CONCAT( DISTINCT ipv4.address ) AS ip4, M.firstseen AS firstseen, m.lastseen AS lastseen,Ĭ.id AS customerid, c.abbreviatedName AS customer, We have not yet pushed the updated code into IXP Manager mainline but the above referenced function / code is not replaced with the DQL query: SELECT m.mac AS mac, vi.id AS viid, m.id AS id, The COALESCE() function is used for this: COALESCE( o.organisation, 'Unknown' ) AS organisation.This is as simple as ensuring you LEFT JOIN.We can do this using a DQL construct such as: JOIN Entities\OUI o WITH SUBSTRING( m.mac, 1, 6 ) = o.oui. This is not always practical and sometimes we need to join tables on the result of some equality test. Normally with Doctrine2, all relationships would be well-defined with foreign keys.We want to present the switch ports to the user and GROUP_CONCAT() allows us to aggregate these as a comma separated concatenated string (e.g. The specific example here is that when a MAC address associated with a virtual interface can be visible in multiple switch ports.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |